Skip to content

Commit b560d6f

Browse files
committed
Deprecate Vertex AI connector
1 parent 9da6e47 commit b560d6f

30 files changed

+482
-77
lines changed

python/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Highlights
44
- Flexible Agent Framework: build, orchestrate, and deploy AI agents and multi-agent systems
55
- Multi-Agent Systems: Model workflows and collaboration between AI specialists
66
- Plugin Ecosystem: Extend with Python, OpenAPI, Model Context Protocol (MCP), and more
7-
- LLM Support: OpenAI, Azure OpenAI, Hugging Face, Mistral, Vertex AI, ONNX, Ollama, NVIDIA NIM, and others
7+
- LLM Support: OpenAI, Azure OpenAI, Hugging Face, Mistral, Google AI, ONNX, Ollama, NVIDIA NIM, and others
88
- Vector DB Support: Azure AI Search, Elasticsearch, Chroma, and more
99
- Process Framework: Build structured business processes with workflow modeling
1010
- Multimodal: Text, vision, audio

python/samples/concepts/setup/ALL_SETTINGS.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@
2525
| Google AI | [GoogleAIChatCompletion](../../../semantic_kernel/connectors/ai/google/google_ai/services/google_ai_chat_completion.py) | gemini_model_id, <br> api_key | GOOGLE_AI_GEMINI_MODEL_ID, <br> GOOGLE_AI_API_KEY | Yes, <br> Yes | [GoogleAISettings](../../../semantic_kernel/connectors/ai/google/google_ai/google_ai_settings.py) |
2626
| | [GoogleAITextCompletion](../../../semantic_kernel/connectors/ai/google/google_ai/services/google_ai_text_completion.py) | gemini_model_id, <br> api_key | GOOGLE_AI_GEMINI_MODEL_ID, <br> GOOGLE_AI_API_KEY | Yes, <br> Yes | |
2727
| | [GoogleAITextEmbedding](../../../semantic_kernel/connectors/ai/google/google_ai/services/google_ai_text_embedding.py) | embedding_model_id, <br> api_key | GOOGLE_AI_EMBEDDING_MODEL_ID, <br> GOOGLE_AI_API_KEY | Yes, <br> Yes | |
28-
| Vertex AI | [VertexAIChatCompletion](../../../semantic_kernel/connectors/ai/google/vertex_ai/services/vertex_ai_chat_completion.py) | project_id, <br> region, <br> gemini_model_id | VERTEX_AI_PROJECT_ID, <br> VERTEX_AI_REGION, <br> VERTEX_AI_GEMINI_MODEL_ID | Yes, <br> No, <br> Yes | [VertexAISettings](../../../semantic_kernel/connectors/ai/google/vertex_ai/vertex_ai_settings.py) |
29-
| | [VertexAITextCompletion](../../../semantic_kernel/connectors/ai/google/google_ai/services/google_ai_text_completion.py) | project_id, <br> region, <br> gemini_model_id | VERTEX_AI_PROJECT_ID, <br> VERTEX_AI_REGION, <br> VERTEX_AI_GEMINI_MODEL_ID | Yes, <br> No, <br> Yes | |
30-
| | [VertexAITextEmbedding](../../../semantic_kernel/connectors/ai/google/google_ai/services/google_ai_text_embedding.py) | project_id, <br> region, <br> embedding_model_id | VERTEX_AI_PROJECT_ID, <br> VERTEX_AI_REGION, <br> VERTEX_AI_EMBEDDING_MODEL_ID | Yes, <br> No, <br> Yes | |
28+
| Vertex AI | [GoogleAIChatCompletion](../../../semantic_kernel/connectors/ai/google/google_ai/services/google_ai_chat_completion.py) | project_id, <br> region, <br> gemini_model_id | GOOGLE_AI_CLOUD_PROJECT_ID, <br> GOOGLE_AI_CLOUD_REGION, <br> GOOGLE_AI_GEMINI_MODEL_ID, <br> GOOGLE_AI_USE_VERTEXAI | Yes, <br> No, <br> Yes, <br> Yes (must set to true) | [GoogleAISettings](../../../semantic_kernel/connectors/ai/google/google_ai/google_ai_settings.py) |
29+
| | [GoogleAITextCompletion](../../../semantic_kernel/connectors/ai/google/google_ai/services/google_ai_text_completion.py) | project_id, <br> region, <br> gemini_model_id | GOOGLE_AI_CLOUD_PROJECT_ID, <br> GOOGLE_AI_CLOUD_REGION, <br> GOOGLE_AI_GEMINI_MODEL_ID, <br> GOOGLE_AI_USE_VERTEXAI | Yes, <br> No, <br> Yes, <br> Yes (must set to true) | |
30+
| | [GoogleAITextEmbedding](../../../semantic_kernel/connectors/ai/google/google_ai/services/google_ai_text_embedding.py) | project_id, <br> region, <br> embedding_model_id | GOOGLE_AI_CLOUD_PROJECT_ID, <br> GOOGLE_AI_CLOUD_REGION, <br> GOOGLE_AI_EMBEDDING_MODEL_ID, <br> GOOGLE_AI_USE_VERTEXAI | Yes, <br> No, <br> Yes, <br> Yes (must set to true) | |
3131
| HuggingFace | [HuggingFaceTextCompletion](../../../semantic_kernel/connectors/ai/hugging_face/services/hf_text_completion.py) | ai_model_id | N/A | Yes | |
3232
| | [HuggingFaceTextEmbedding](../../../semantic_kernel/connectors/ai/hugging_face/services/hf_text_embedding.py) | ai_model_id | N/A | Yes | |
3333
| NVIDIA NIM | [NvidiaChatCompletion](../../../semantic_kernel/connectors/ai/nvidia/services/nvidia_chat_completion.py) | ai_model_id, <br> api_key, <br> base_url | NVIDIA_CHAT_MODEL_ID, <br> NVIDIA_API_KEY, <br> NVIDIA_BASE_URL | Yes (default: meta/llama-3.1-8b-instruct), <br> Yes, <br> No | [NvidiaAISettings](../../../semantic_kernel/connectors/ai/nvidia/settings/nvidia_settings.py) |

python/samples/concepts/setup/chat_completion_services.py

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -249,10 +249,7 @@ def get_google_ai_chat_completion_service_and_request_settings() -> tuple[
249249
Please refer to the Semantic Kernel Python documentation for more information:
250250
https://learn.microsoft.com/en-us/python/api/semantic-kernel/semantic_kernel?view=semantic-kernel
251251
"""
252-
from semantic_kernel.connectors.ai.google.google_ai import (
253-
GoogleAIChatCompletion,
254-
GoogleAIChatPromptExecutionSettings,
255-
)
252+
from semantic_kernel.connectors.ai.google import GoogleAIChatCompletion, GoogleAIChatPromptExecutionSettings
256253

257254
chat_service = GoogleAIChatCompletion(service_id=service_id)
258255
request_settings = GoogleAIChatPromptExecutionSettings(service_id=service_id)
@@ -356,13 +353,10 @@ def get_vertex_ai_chat_completion_service_and_request_settings() -> tuple[
356353
Please refer to the Semantic Kernel Python documentation for more information:
357354
https://learn.microsoft.com/en-us/python/api/semantic-kernel/semantic_kernel?view=semantic-kernel
358355
"""
359-
from semantic_kernel.connectors.ai.google.vertex_ai import (
360-
VertexAIChatCompletion,
361-
VertexAIChatPromptExecutionSettings,
362-
)
356+
from semantic_kernel.connectors.ai.google import GoogleAIChatCompletion, GoogleAIChatPromptExecutionSettings
363357

364-
chat_service = VertexAIChatCompletion(service_id=service_id)
365-
request_settings = VertexAIChatPromptExecutionSettings(service_id=service_id)
358+
chat_service = GoogleAIChatCompletion(service_id=service_id, use_vertexai=True)
359+
request_settings = GoogleAIChatPromptExecutionSettings(service_id=service_id)
366360

367361
return chat_service, request_settings
368362

python/samples/concepts/setup/text_completion_services.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -262,12 +262,9 @@ def get_vertex_ai_text_completion_service_and_request_settings() -> tuple[
262262
Please refer to the Semantic Kernel Python documentation for more information:
263263
https://learn.microsoft.com/en-us/python/api/semantic-kernel/semantic_kernel?view=semantic-kernel
264264
"""
265-
from semantic_kernel.connectors.ai.google.vertex_ai import (
266-
VertexAITextCompletion,
267-
VertexAITextPromptExecutionSettings,
268-
)
265+
from semantic_kernel.connectors.ai.google import GoogleAITextCompletion, GoogleAITextPromptExecutionSettings
269266

270-
text_service = VertexAITextCompletion()
271-
request_settings = VertexAITextPromptExecutionSettings()
267+
text_service = GoogleAITextCompletion()
268+
request_settings = GoogleAITextPromptExecutionSettings()
272269

273270
return text_service, request_settings

python/samples/concepts/setup/text_embedding_services.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -296,13 +296,10 @@ def get_vertex_ai_text_embedding_service_and_request_settings() -> tuple[
296296
Please refer to the Semantic Kernel Python documentation for more information:
297297
https://learn.microsoft.com/en-us/python/api/semantic-kernel/semantic_kernel?view=semantic-kernel
298298
"""
299-
from semantic_kernel.connectors.ai.google.vertex_ai import (
300-
VertexAIEmbeddingPromptExecutionSettings,
301-
VertexAITextEmbedding,
302-
)
299+
from semantic_kernel.connectors.ai.google import GoogleAIEmbeddingPromptExecutionSettings, GoogleAITextEmbedding
303300

304-
embedding_service = VertexAITextEmbedding()
301+
embedding_service = GoogleAITextEmbedding()
305302
# Note: not all models support specifying the dimensions or there may be constraints on the dimensions
306-
request_settings = VertexAIEmbeddingPromptExecutionSettings(output_dimensionality=768)
303+
request_settings = GoogleAIEmbeddingPromptExecutionSettings(output_dimensionality=768)
307304

308305
return embedding_service, request_settings

python/semantic_kernel/connectors/ai/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ All base clients inherit from the [`AIServiceClientBase`](../../services/ai_serv
3838
| [Google AI](./google/README.md) | [`GoogleAIChatCompletion`](./google/google_ai/services/google_ai_chat_completion.py) |
3939
| | [`GoogleAITextCompletion`](./google/google_ai/services/google_ai_text_completion.py) |
4040
| | [`GoogleAITextEmbedding`](./google/google_ai/services/google_ai_text_embedding.py) |
41-
| [Vertex AI](./google/README.md) | [`VertexAIChatCompletion`](./google/vertex_ai/services/vertex_ai_chat_completion.py) |
42-
| | [`VertexAITextCompletion`](./google/vertex_ai/services/vertex_ai_text_completion.py) |
43-
| | [`VertexAITextEmbedding`](./google/vertex_ai/services/vertex_ai_text_embedding.py) |
41+
| [Vertex AI](./google/README.md) | [`GoogleAIChatCompletion`](./google/google_ai/services/google_ai_chat_completion.py) |
42+
| | [`GoogleAITextCompletion`](./google/google_ai/services/google_ai_text_completion.py) |
43+
| | [`GoogleAITextEmbedding`](./google/google_ai/services/google_ai_text_embedding.py) |
4444
| HuggingFace | [`HuggingFaceTextCompletion`](./hugging_face/services/hf_text_completion.py) |
4545
| | [`HuggingFaceTextEmbedding`](./hugging_face/services/hf_text_embedding.py) |
4646
| Mistral AI | [`MistralAIChatCompletion`](./mistral_ai/services/mistral_ai_chat_completion.py) |

python/semantic_kernel/connectors/ai/google/README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Once you have an API key, you can start using Gemini models in SK using the `goo
1414
kernel = Kernel()
1515
kernel.add_service(
1616
GoogleAIChatCompletion(
17-
gemini_model_id="gemini-1.5-flash",
17+
gemini_model_id="gemini-2.5-flash",
1818
api_key="...",
1919
)
2020
)
@@ -39,9 +39,11 @@ Once you have your project and your environment is set up, you can start using G
3939
```Python
4040
kernel = Kernel()
4141
kernel.add_service(
42-
VertexAIChatCompletion(
42+
GoogleAIChatCompletion(
4343
project_id="...",
44-
gemini_model_id="gemini-1.5-flash",
44+
region="...",
45+
gemini_model_id="gemini-2.5-flash",
46+
use_vertexai=True,
4547
)
4648
)
4749
...
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Copyright (c) Microsoft. All rights reserved.
2+
3+
from semantic_kernel.connectors.ai.google.google_ai.google_ai_prompt_execution_settings import (
4+
GoogleAIChatPromptExecutionSettings,
5+
GoogleAIEmbeddingPromptExecutionSettings,
6+
GoogleAIPromptExecutionSettings,
7+
GoogleAITextPromptExecutionSettings,
8+
)
9+
from semantic_kernel.connectors.ai.google.google_ai.services.google_ai_chat_completion import GoogleAIChatCompletion
10+
from semantic_kernel.connectors.ai.google.google_ai.services.google_ai_text_completion import GoogleAITextCompletion
11+
from semantic_kernel.connectors.ai.google.google_ai.services.google_ai_text_embedding import GoogleAITextEmbedding
12+
13+
__all__ = [
14+
"GoogleAIChatCompletion",
15+
"GoogleAIChatPromptExecutionSettings",
16+
"GoogleAIEmbeddingPromptExecutionSettings",
17+
"GoogleAIPromptExecutionSettings",
18+
"GoogleAITextCompletion",
19+
"GoogleAITextEmbedding",
20+
"GoogleAITextPromptExecutionSettings",
21+
]

python/semantic_kernel/connectors/ai/google/google_ai/google_ai_settings.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,19 @@ class GoogleAISettings(KernelBaseSettings):
2828
- api_key: SecretStr - The API key for the Google AI service deployment.
2929
This value can be found in the Google AI service deployment.
3030
(Env var GOOGLE_AI_API_KEY)
31+
- cloud_project_id: str - The Google Cloud project ID.
32+
(Env var GOOGLE_AI_CLOUD_PROJECT_ID)
33+
- cloud_region: str - The Google Cloud region.
34+
(Env var GOOGLE_AI_CLOUD_REGION)
35+
- use_vertexai: bool - Whether to use Vertex AI. If true, cloud_project_id and cloud_region must be provided.
36+
(Env var GOOGLE_AI_USE_VERTEXAI)
3137
"""
3238

3339
env_prefix: ClassVar[str] = "GOOGLE_AI_"
3440

3541
gemini_model_id: str | None = None
3642
embedding_model_id: str | None = None
37-
api_key: SecretStr
43+
api_key: SecretStr | None = None
44+
cloud_project_id: str | None = None
45+
cloud_region: str | None = None
46+
use_vertexai: bool = False

python/semantic_kernel/connectors/ai/google/google_ai/services/google_ai_base.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
from abc import ABC
44
from typing import ClassVar
55

6+
from google.genai import Client
7+
68
from semantic_kernel.connectors.ai.google.google_ai.google_ai_settings import GoogleAISettings
79
from semantic_kernel.kernel_pydantic import KernelBaseModel
810

@@ -13,3 +15,5 @@ class GoogleAIBase(KernelBaseModel, ABC):
1315
MODEL_PROVIDER_NAME: ClassVar[str] = "googleai"
1416

1517
service_settings: GoogleAISettings
18+
19+
client: Client | None = None

0 commit comments

Comments
 (0)