microsoft/semantic-kernel · error · ServiceInvalidExecutionSettingsError
The settings must be an VertexAIChatPromptExecutionSettings.
Error message
The settings must be an VertexAIChatPromptExecutionSettings.
What it means
Raised by VertexAIChatCompletion._verify_function_choice_settings when the PromptExecutionSettings passed for tool/function calling is not a VertexAIChatPromptExecutionSettings instance. Auto-invocation configuration is Vertex-specific, so the connector type-checks settings before applying function-choice behavior.
Source
Thrown at python/semantic_kernel/connectors/ai/google/vertex_ai/services/vertex_ai_chat_completion.py:187
response: AsyncIterable[GenerationResponse] = await model.generate_content_async(
contents=self._prepare_chat_history_for_request(chat_history),
generation_config=settings.prepare_settings_dict(),
tools=settings.tools,
tool_config=settings.tool_config,
stream=True,
)
async for chunk in response:
yield [
self._create_streaming_chat_message_content(chunk, candidate, function_invoke_attempt)
for candidate in chunk.candidates
]
@override
def _verify_function_choice_settings(self, settings: "PromptExecutionSettings") -> None:
if not isinstance(settings, VertexAIChatPromptExecutionSettings):
raise ServiceInvalidExecutionSettingsError("The settings must be an VertexAIChatPromptExecutionSettings.")
if settings.candidate_count is not None and settings.candidate_count > 1:
raise ServiceInvalidExecutionSettingsError(
"Auto-invocation of tool calls may only be used with a "
"VertexAIChatPromptExecutionSettings.candidate_count of 1."
)
@override
def _update_function_choice_settings_callback(
self,
) -> Callable[["FunctionCallChoiceConfiguration", "PromptExecutionSettings", FunctionChoiceType], None]:
return update_settings_from_function_choice_configuration
@override
def _reset_function_choice_settings(self, settings: "PromptExecutionSettings") -> None:
if hasattr(settings, "tool_config"):
settings.tool_config = None
if hasattr(settings, "tools"):
settings.tools = NoneView on GitHub (pinned to c028a0c7dc)
Solutions
- Use VertexAIChatPromptExecutionSettings when calling VertexAIChatCompletion, especially with function calling enabled.
- Let the service coerce settings by passing a dict or using get_prompt_execution_settings_from_settings, or instantiate the correct subclass directly.
- Register the Vertex service under a dedicated service_id and request its matching settings class from the kernel.
Example fix
# before settings = PromptExecutionSettings() # or OpenAIChatPromptExecutionSettings # after from semantic_kernel.connectors.ai.google.vertex_ai.vertex_ai_prompt_execution_settings import VertexAIChatPromptExecutionSettings settings = VertexAIChatPromptExecutionSettings()
Defensive patterns
Strategy: type-guard
Validate before calling
from semantic_kernel.connectors.ai.google.vertex_ai.vertex_ai_prompt_execution_settings import VertexAIChatPromptExecutionSettings assert isinstance(settings, VertexAIChatPromptExecutionSettings), 'Use VertexAIChatPromptExecutionSettings for Vertex AI function calling'
Type guard
def is_vertex_settings(settings) -> bool:
from semantic_kernel.connectors.ai.google.vertex_ai.vertex_ai_prompt_execution_settings import VertexAIChatPromptExecutionSettings
return isinstance(settings, VertexAIChatPromptExecutionSettings) Prevention
- Use the connector-specific settings subclass that matches the service.
- Keep per-provider settings objects instead of sharing one across connectors.
- When enabling function calling, double-check the settings class type.
When it happens
Trigger: Enabling function calling / tool invocation (e.g. FunctionChoiceBehavior.Auto) but supplying a generic PromptExecutionSettings or a settings object from a different connector (OpenAI, MistralAI) to a Vertex AI chat completion call.
Common situations: Reusing execution settings created for another provider across connectors. Passing a base PromptExecutionSettings instead of the Vertex-specific subclass when configuring kernel function invocation.
Related errors
- Auto-invocation of tool calls may only be used with a Vertex
- Expected OpenAISettings, got {type(settings).__name__}
- The settings must be an AzureAIInferenceChatPromptExecutionS
- Auto invocation of tool calls may only be used with a single
- The settings must be an GoogleAIChatPromptExecutionSettings.
AI-assisted analysis of microsoft/semantic-kernel@c028a0c7dc (2026-08-13).
Data as JSON: /api/errors/ad121b74fe510a5f.
Report an issue: GitHub.