fix(autogen-ext): add extra_body to OpenAI client config and serialization models - #8077
fix(autogen-ext): add extra_body to OpenAI client config and serialization models#8077Muhammad Maaz (Maazkorejo) wants to merge 2 commits into
Conversation
…ation models Signed-off-by: Muhammad Maaz <maazkorejo00@gmail.com>
|
@microsoft-github-policy-service agree |
Esan (EsanRAHIMI)
left a comment
There was a problem hiding this comment.
The configuration additions look consistent with the runtime create arguments, and covering both direct initialization and component loading is useful. One coverage gap is that the serialization assertion only inspects the reloaded client's private _create_args; it never asserts the public dump_component() payload itself. If dumping silently omitted extra_body and another path repopulated it, this test could give a misleading result. Could the test assert dumped.config.extra_body (or the equivalent serialized field) before reloading, and also verify the reloaded public dump round-trip? That would pin the exact component-serialization boundary this PR is intended to fix.
|
Hi Esan (@EsanRAHIMI) , thanks for the review! I have updated the test suite to:
The updated commit has been pushed to the PR branch! |
Esan (EsanRAHIMI)
left a comment
There was a problem hiding this comment.
Thanks for the update. The new assertions directly cover the public dump payload and the post-reload public round-trip, including the Azure client path. This addresses my review feedback.
Description
Fixes #7418
OpenAIChatCompletionClientsupportedextra_bodyin runtime create args, butextra_bodywas missing fromCreateArguments(TypedDict) andCreateArgumentsConfigModel(Pydantic model) inautogen_ext.models.openai.config.As a result, configuring
extra_bodythrough component configurations (e.g., in AutoGen Studio orChatCompletionClient.load_component(...)) silently dropped the field.Changes Made
extra_body: Optional[Dict[str, Any]]toCreateArgumentsinsrc/autogen_ext/models/openai/config/__init__.py.extra_body: Dict[str, Any] | None = NonetoCreateArgumentsConfigModel.test_extra_body_configuration_and_serializationintests/models/test_openai_model_client.pyverifying client initialization,load_component, anddump_componentroundtrips.Checklist