Skip to content

fix(translator): apply temperature/maxTokens/topP for AzureOpenAI#1972

Open
mesutoezdil wants to merge 1 commit into
kagent-dev:mainfrom
mesutoezdil:fix/azure-openai-config-params
Open

fix(translator): apply temperature/maxTokens/topP for AzureOpenAI#1972
mesutoezdil wants to merge 1 commit into
kagent-dev:mainfrom
mesutoezdil:fix/azure-openai-config-params

Conversation

@mesutoezdil
Copy link
Copy Markdown
Contributor

@mesutoezdil mesutoezdil commented Jun 6, 2026

AzureOpenAIConfig defines temperature, maxTokens, and topP but the translator never wrote them to the agent config JSON. The adk.AzureOpenAI struct also lacked these fields so they were silently dropped.

The Python AzureOpenAI model inherits BaseOpenAI and already reads these params, so the runtime handles them once they appear in the JSON.

Copilot AI review requested due to automatic review settings June 6, 2026 14:22
@github-actions github-actions Bot added bug Something isn't working and removed bug Something isn't working labels Jun 6, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds Azure OpenAI parameter support to the ADK model translation and introduces new translator golden test fixtures for an Azure-backed agent.

Changes:

  • Extend adk.AzureOpenAI to serialize max_tokens, temperature, and top_p.
  • Populate Azure OpenAI temperature/top_p (and max tokens if set) during model translation.
  • Add new translator input/output fixtures for an azure-agent scenario.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

File Description
go/core/internal/controller/translator/agent/testdata/outputs/azure_agent.json New expected translated manifest/config output for an Azure OpenAI agent scenario.
go/core/internal/controller/translator/agent/testdata/inputs/azure_agent.yaml New test input defining ModelConfig + Agent for Azure OpenAI translation.
go/core/internal/controller/translator/agent/adk_api_translator.go Sets Azure OpenAI temperature/top_p and conditionally max_tokens during translation.
go/api/adk/types.go Adds Azure OpenAI JSON fields for max_tokens, temperature, and top_p.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread go/core/internal/controller/translator/agent/testdata/outputs/azure_agent.json Outdated
Comment thread go/core/internal/controller/translator/agent/testdata/outputs/azure_agent.json Outdated
Comment thread go/core/internal/controller/translator/agent/testdata/outputs/azure_agent.json Outdated
Comment thread go/core/internal/controller/translator/agent/adk_api_translator.go Outdated
@mesutoezdil mesutoezdil force-pushed the fix/azure-openai-config-params branch 6 times, most recently from 1d9bab7 to 2b8f5d2 Compare June 6, 2026 14:34
Fields defined in AzureOpenAIConfig were never forwarded to the adk
struct. Add them and cover with a unit test.

Signed-off-by: mesutoezdil <mesudozdil@gmail.com>
@mesutoezdil mesutoezdil force-pushed the fix/azure-openai-config-params branch from 2b8f5d2 to 9a0dda5 Compare June 6, 2026 14:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants