Skip to content

Python: [BREAKING] parameter naming and other fixes - #1255

Merged
eavanvalkenburg merged 10 commits into
microsoft:mainfrom
eavanvalkenburg:fix_output_format_agent_streaming
Oct 7, 2025
Merged

Python: [BREAKING] parameter naming and other fixes#1255
eavanvalkenburg merged 10 commits into
microsoft:mainfrom
eavanvalkenburg:fix_output_format_agent_streaming

Conversation

@eavanvalkenburg

@eavanvalkenburg eavanvalkenburg commented Oct 7, 2025

Copy link
Copy Markdown
Member

Motivation and Context

Made the use of model_id consistent across agents, chat_clients and types, in some places model was used, that is now always model_id.
Also made some improvements in parameter names on the agents for the additional options passed to the chat client.
Improved the parsing of additional_properties for several clients.
Improved the handling of Responses Reasoning content, and improved sample
Also removed to_provider_settings from ChatOptions, as it was not used, and to_dict does a similar thing.
Added handling of type to exclude from to_dict.

Closes #1245 #1246

Description

Contribution Checklist

  • The code builds clean without any errors or warnings
  • The PR follows the Contribution Guidelines
  • All unit tests pass, and I have added new tests where possible
  • Is this a breaking change? If yes, add "[BREAKING]" prefix to the title of the PR.

Copilot AI review requested due to automatic review settings October 7, 2025 10:49
@markwallace-microsoft markwallace-microsoft added the python Usage: [Issues, PRs], Target: Python label Oct 7, 2025

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull Request Overview

This PR standardizes parameter naming across the Agent Framework by making model_id the consistent parameter name instead of the previously mixed usage of model and model_id. Additionally, it improves parameter handling for additional chat options and enhances reasoning content processing in OpenAI clients.

  • Renamed model parameter to model_id across agents, chat clients, and type definitions for consistency
  • Renamed request_kwargs to additional_chat_options in agent constructors for clarity
  • Improved parsing and handling of additional properties in OpenAI chat and responses clients

Reviewed Changes

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

Show a summary per file
File Description
python/samples/getting_started/agents/openai/openai_responses_client_reasoning.py Updated sample to use gpt-5 model and improved reasoning content handling with proper additional_chat_options usage
python/packages/devui/agent_framework_devui/models/_discovery_models.py Changed model field to model_id in EntityInfo model
python/packages/devui/agent_framework_devui/_session.py Updated parameter name from model to model_id in session management
python/packages/devui/agent_framework_devui/_discovery.py Updated model parameter references to use model_id
python/packages/core/tests/openai/test_openai_chat_client_base.py Added test for additional_properties handling and cleaned up test formatting
python/packages/core/tests/core/test_types.py Removed unused imports, updated exception handling to use ContentError, and removed redundant test cases
python/packages/core/tests/core/test_observability.py Updated test calls to use model_id parameter instead of model
python/packages/core/agent_framework/openai/_responses_client.py Enhanced additional properties parsing and added summary content handling for reasoning responses
python/packages/core/agent_framework/openai/_chat_client.py Improved options preparation with better additional properties handling
python/packages/core/agent_framework/observability.py Updated observability tracking to use model_id parameter consistently
python/packages/core/agent_framework/exceptions.py Added new ContentError exception class
python/packages/core/agent_framework/azure/_shared.py Removed unused parameter documentation
python/packages/core/agent_framework/_types.py Major refactoring of content parsing, ChatOptions, and parameter handling with improved error handling
python/packages/core/agent_framework/_serialization.py Enhanced serialization to conditionally exclude type field
python/packages/core/agent_framework/_middleware.py Updated middleware to use model_id instead of model
python/packages/core/agent_framework/_clients.py Comprehensive parameter renaming from model to model_id and improved documentation
python/packages/core/agent_framework/_agents.py Updated ChatAgent to use additional_chat_options instead of request_kwargs and improved parameter handling
python/packages/azure-ai/agent_framework_azure_ai/_chat_client.py Updated Azure AI client to use model_id parameter and added ToolDefinition case handling

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread python/packages/core/tests/core/test_types.py
Comment thread python/packages/core/tests/core/test_types.py
@markwallace-microsoft

markwallace-microsoft commented Oct 7, 2025

Copy link
Copy Markdown
Contributor

Python Test Coverage

Python Test Coverage Report •
FileStmtsMissCoverMissing
packages/azure-ai/agent_framework_azure_ai
   _chat_client.py3626781%235, 240, 262–265, 269–270, 272, 346, 418, 487–488, 490–491, 499, 511–513, 517–519, 527–530, 540, 548–553, 560, 568–569, 577–578, 583–584, 588–595, 600–601, 609, 615, 623–625, 628, 683, 712–714, 717–718, 733, 738, 777–778, 911
packages/core/agent_framework
   _agents.py2707572%290, 349–351, 397, 445, 463, 621, 684–687, 704, 714, 792–795, 797, 800–802, 920–923, 925, 928–930, 1012, 1017, 1047, 1052–1055, 1057, 1059, 1061, 1064–1069, 1071–1072, 1075, 1077, 1087–1088, 1090–1091, 1095, 1097–1098, 1106–1110, 1118–1119, 1121, 1123–1124, 1126, 1128, 1130, 1162, 1203–1204, 1206, 1219
   _clients.py1151586%235, 293, 404, 423–424, 469–472, 516, 704, 708, 747, 835, 837
   _middleware.py396997%797, 813, 860–861, 1064–1065, 1110, 1259, 1472
   _serialization.py971584%185, 195–196, 201, 256, 260, 274, 276–280, 298–299, 312
   _types.py8779988%130–131, 149–150, 287, 289, 296, 315, 355, 401–402, 438, 588, 702–703, 705, 730, 737, 754–756, 829, 834–835, 837, 844–845, 847, 869, 876, 879–881, 886–887, 893–895, 1016, 1142, 1323, 1327, 1329, 1573–1575, 1581–1582, 1750, 1826, 1831, 1881, 1886, 1890, 1894, 2101–2105, 2115, 2120, 2401, 2579, 2665–2667, 2690, 2717, 2740, 2748–2752, 2856, 2926, 2930, 2938, 2942–2944, 3045–3047, 3049–3051, 3054, 3058, 3061, 3066, 3120–3122, 3137, 3153, 3181, 3188
   exceptions.py480100% 
   observability.py60310981%237, 263–265, 267, 269–273, 281, 287–292, 315–317, 319–320, 326, 410, 420, 442, 448, 467–469, 477–479, 502–504, 514–516, 649, 651, 738–742, 745–749, 758–761, 771–774, 776, 863–866, 1041, 1189–1191, 1346, 1353, 1355, 1357, 1359, 1361, 1363, 1365, 1367, 1369, 1371, 1375–1377, 1379, 1389, 1417–1418, 1428, 1431–1434, 1448, 1453–1455, 1457–1460, 1462–1463, 1467, 1470, 1490, 1528, 1544, 1548, 1672, 1674
packages/core/agent_framework/azure
   _responses_client.py28292%100, 123
   _shared.py79791%135–136, 199, 202, 215, 217, 227
packages/core/agent_framework/openai
   _chat_client.py2354481%106–107, 111, 129, 139–140, 142, 153, 160, 164, 166–169, 178, 224, 255, 260–274, 281–283, 360, 363, 365, 367, 390–391, 397, 413, 455
   _responses_client.py4096883%141–142, 145–146, 152–153, 156, 163, 195, 204, 216, 246, 274–275, 298, 390, 467, 472, 476–478, 498, 501, 516–517, 521–523, 571, 591–592, 605–606, 622–623, 661, 663, 707, 711, 713, 722, 724, 733–734, 747, 749, 822–828, 845–850, 869, 887, 897, 899, 917–918, 920–922
TOTAL10308173683% 

Python Unit Test Overview

Tests Skipped Failures Errors Time
1254 98 💤 0 ❌ 0 🔥 30.008s ⏱️

Comment thread python/packages/core/agent_framework/_agents.py
@eavanvalkenburg
eavanvalkenburg added this pull request to the merge queue Oct 7, 2025
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 7, 2025
@eavanvalkenburg
eavanvalkenburg added this pull request to the merge queue Oct 7, 2025
@eavanvalkenburg
eavanvalkenburg removed this pull request from the merge queue due to a manual request Oct 7, 2025
@lokitoth lokitoth added the breaking change Usage: [PRs], Target: all PRs that introduce changes that are not backward compatible label Oct 7, 2025
@eavanvalkenburg
eavanvalkenburg force-pushed the fix_output_format_agent_streaming branch from 919dd5a to 8af38b0 Compare October 7, 2025 19:50
@eavanvalkenburg
eavanvalkenburg added this pull request to the merge queue Oct 7, 2025
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 7, 2025
@eavanvalkenburg
eavanvalkenburg added this pull request to the merge queue Oct 7, 2025
Merged via the queue into microsoft:main with commit 76900f0 Oct 7, 2025
20 checks passed
ReubenBond pushed a commit to ReubenBond/agent-framework that referenced this pull request Oct 28, 2025
* parameter naming and other fixes

* fix test

* fix azure openai responses decorator ordering

* fix test

* fix mypy

* fixes in options handling

* fix tests

* final fixes

* exclude macos tests

* fix model param
arisng pushed a commit to arisng/agent-framework that referenced this pull request Feb 2, 2026
* parameter naming and other fixes

* fix test

* fix azure openai responses decorator ordering

* fix test

* fix mypy

* fixes in options handling

* fix tests

* final fixes

* exclude macos tests

* fix model param
@eavanvalkenburg
eavanvalkenburg deleted the fix_output_format_agent_streaming branch June 30, 2026 09:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking change Usage: [PRs], Target: all PRs that introduce changes that are not backward compatible python Usage: [Issues, PRs], Target: Python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Python: OpenAI ResponsesClient omits additional_properties on model call

6 participants