Skip to content

fix(autogen-ext): preserve Azure model info in component config - #8113

Open
YZJF,YCDG,DJLY,ZZZB (YZJF) wants to merge 1 commit into
microsoft:mainfrom
YZJF:fix/azure-model-info-component-roundtrip
Open

fix(autogen-ext): preserve Azure model info in component config#8113
YZJF,YCDG,DJLY,ZZZB (YZJF) wants to merge 1 commit into
microsoft:mainfrom
YZJF:fix/azure-model-info-component-roundtrip

Conversation

@YZJF

Copy link
Copy Markdown

Why are these changes needed?

Before this change, AzureOpenAIChatCompletionClient removed model_info and
the deprecated model_capabilities from the SDK arguments before saving
_raw_config. As a result, dump_component() omitted the model capabilities required
to load a custom Azure deployment whose name is not in AutoGen's built-in model
table.

Save the original constructor configuration for component serialization, while
continuing to pass the filtered arguments to the Azure SDK. This mirrors the
existing OpenAIChatCompletionClient behavior introduced in #5315.

The regression test uses a fake endpoint and key, serializes an unknown Azure
deployment to JSON, then loads it back and verifies that model_info is
preserved. It makes no network model call.

Related issue number

N/A — this is an Azure parity gap discovered while auditing component
serialization; no matching open issue or PR was found.

Checks

  • No documentation update is needed; this restores the documented component configuration round-trip behavior.
  • I've added a regression test corresponding to the fix.
  • GitHub automated checks have not run yet.

Local validation

  • uv run --no-sync pytest packages/autogen-ext/tests/models/test_openai_model_client.py -k azure_openai_chat_completion_client_serializes_model_info -q (1 passed)
  • uv run --no-sync pytest packages/autogen-ext/tests/models/test_openai_model_client.py -q (54 passed, 33 skipped)
  • uv run --no-sync ruff format --check packages/autogen-ext/src/autogen_ext/models/openai/_openai_client.py packages/autogen-ext/tests/models/test_openai_model_client.py
  • uv run --no-sync ruff check packages/autogen-ext/src/autogen_ext/models/openai/_openai_client.py packages/autogen-ext/tests/models/test_openai_model_client.py
  • Scoped MyPy and Pyright checks on the changed source and test files (both passed)

I also attempted the full autogen-ext MyPy command; this dependency subset reports existing missing-optional-integration type errors in unrelated Semantic Kernel, Ollama, and llama-cpp files, not in the changed files.

AI assistance

This change and regression test were prepared with AI assistance. The local validation commands above were run against this branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant