semantic-kernel icon indicating copy to clipboard operation
semantic-kernel copied to clipboard

.Net: Bug: Google AI client ignores modelId passed to PromptExecutionSettings

Open dszymon opened this issue 6 months ago • 1 comments

Describe the bug Google AI client always uses modelId passed to the constructor

To Reproduce Steps to reproduce the behavior:

  1. Create an instance of Google AI client
  2. Pass model1 to the constructor
  3. Use a different model in PromptExecutionSettings passed to any generation method
  4. Client ignores the ModelId property

Expected behavior Client should always prefer ModelId from PromptExecutionSettings

Platform

  • Language: C#
  • Source: Microsoft.SemanticKernel.Connectors.Google 1.66.0-alpha (nuget)
  • AI model: any
  • IDE: Rider
  • OS: any

dszymon avatar Oct 23 '25 09:10 dszymon

Same goes for OpenAIChatCompletionService. It only uses this._client.ModelId, a executionSettings?.ModelId ?? would be nice.

KevinHuang-Intersense avatar Nov 10 '25 01:11 KevinHuang-Intersense