Giles Odigwe and GitHub
e8b32ca337
Python: Prefer runtime kwargs for conversation_id in OpenAI Responses client ( #3312 )
...
* prefer kwargs conversation_id over options
* addressed comments
2026-01-23 06:05:00 +00:00
Giles Odigwe and GitHub
e229dfa7e5
Python: Added tests for OpenAI content types + Unit test improvement ( #3259 )
...
* added tests for content types+ unit test improvement
* small fixes
* small fix
2026-01-23 06:04:36 +00:00
Evan Mattson and GitHub
50c2539f3a
Python: fix(core): filter out internal args when passing kwargs to MCP tools ( #3292 )
...
* fix(core): filter conversation_id when passing kwargs to MCP tools
* Filter out options too
* Fix uv.lock conflict
2026-01-23 06:03:10 +00:00
Evan Mattson and GitHub
5436354a83
Python: [BREAKING] simplify ag-ui run logic, fix mcp bugs, fix anthropic client issues in ag-ui ( #3322 )
...
* Refactor ag-ui to simplify flow
* Refactoring
* Fix backend tool
* Update tests
* Improvements
* Fix mypy
* Fixes
* Fix json serialize errors
2026-01-23 05:10:46 +00:00
87c9d74bd7
Python: Fix: Verify types during checkpoint deserialization to prevent marker spoofing ( #3243 )
...
* Initial plan
* Add validation for reserved keywords in checkpoint encoding/decoding
Co-authored-by: TaoChenOSU <12570346+TaoChenOSU@users.noreply.github.com >
* Refactor to eliminate duplicate code in model protocol detection
Co-authored-by: TaoChenOSU <12570346+TaoChenOSU@users.noreply.github.com >
* Fix pyright type narrowing issue for dataclass check
Co-authored-by: TaoChenOSU <12570346+TaoChenOSU@users.noreply.github.com >
* Add comprehensive unit tests for checkpoint encoding
Co-authored-by: TaoChenOSU <12570346+TaoChenOSU@users.noreply.github.com >
* Remove serialization-time reserved keyword validation to fix failing tests
The serialization-time validation was too aggressive and blocked legitimate use cases
where encoded data was being re-encoded. Security is now enforced only at deserialization
time by validating that classes marked with DATACLASS_MARKER are actual dataclasses and
classes marked with MODEL_MARKER actually support the model protocol.
Co-authored-by: TaoChenOSU <12570346+TaoChenOSU@users.noreply.github.com >
* Apply ruff formatting to checkpoint encoding file
Co-authored-by: TaoChenOSU <12570346+TaoChenOSU@users.noreply.github.com >
* Changes before error encountered
Co-authored-by: TaoChenOSU <12570346+TaoChenOSU@users.noreply.github.com >
* Revert "Changes before error encountered"
This reverts commit f515b880dc .
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com >
Co-authored-by: TaoChenOSU <12570346+TaoChenOSU@users.noreply.github.com >
Co-authored-by: Tao Chen <taochen@microsoft.com >
2026-01-22 19:07:39 +00:00
Evan Mattson and GitHub
6b5437e4ec
Python: fix(core): handle anyio cancel scope errors during MCP connection cleanup ( #3277 )
...
* fix(core): handle anyio cancel scope errors during MCP connection cleanup
* Address Copilot feedback
2026-01-21 01:49:07 +00:00
Eduard van Valkenburg and GitHub
83e6229c11
Python: [Breaking] Simplified Content types to a single class with classmethod constructors. ( #3252 )
...
* ported Content to a new model
* fixed linting
* fixes
* fixed data format handling
* fix for 3.10 mypy
* fix
* fix int test
2026-01-20 22:09:39 +00:00
f8c84d4ee6
Python: Fix: Add system_instructions to ChatClient LLM span tracing ( #3164 )
...
* Fix: Add system_instructions to ChatClient LLM span tracing
- Add system_instructions parameter to _capture_messages() calls in
_trace_get_response() and _trace_get_streaming_response()
- Extract instructions from chat_options in kwargs
- Add unit tests to verify system_instructions are captured correctly
When using ChatClient with ChatOptions.instructions, the OpenTelemetry
LLM span was missing system messages in gen_ai.input.messages and the
gen_ai.system_instructions attribute was not being set.
This fix aligns the ChatClient-level tracing with the Agent-level
tracing which already correctly passes system_instructions.
Fixes #3163
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com >
* Add edge case tests for system_instructions
- Add test for empty string instructions (should not set attribute)
- Add test for list-type instructions (verify multiple items captured)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com >
* Simplify: use options.get('instructions') directly instead of kwargs.get('chat_options')
Addresses reviewer feedback:
- Removed unnecessary chat_options variable from kwargs
- Directly access instructions from the options parameter
- Updated tests to use dict syntax for options (TypedDict convention)
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com >
2026-01-20 14:04:31 +00:00
Dmytro Struk and GitHub
83e8965c8e
Python: [BREAKING] Make response_format validation errors visible to users ( #3274 )
...
* Make response_format validation errors visible to users
* Small fix
* Addressed comments
2026-01-19 17:20:46 +00:00
3243652df6
Python: Filter conversation_id when passing kwargs to agent as tool ( #3266 )
...
* Filter conversation_id when passing kwargs to agent as tool
* Small fix
* Update python/samples/getting_started/agents/azure_ai/README.md
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com >
* Update python/samples/getting_started/agents/openai/openai_responses_client_with_agent_as_tool.py
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com >
* Update python/samples/getting_started/agents/azure_ai/azure_ai_with_agent_as_tool.py
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com >
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com >
2026-01-19 12:54:06 +00:00
Dmytro Struk and GitHub
915df3b404
Python: Added rai_config to Azure AI agent creation ( #3265 )
...
* Add kwargs to create_agent method
* Added test for kwargs
* Addressed comment
* Added doc string
2026-01-19 12:51:27 +00:00
Dmytro Struk and GitHub
f87e55ba33
Python: Fixed use_agent_middleware calling private _normalize_messages ( #3264 )
...
* Fix use_agent_middleware calling private _normalize_messages
* Fixed A2A and Copilot Studio agent
2026-01-19 12:50:14 +00:00
Dmytro Struk and GitHub
9bfa1a913c
Python: Fixed Azure chat client for asynchronous filtering ( #3260 )
...
* Fixed Azure chat client for asynchronous filtering
* Updated test
2026-01-19 12:49:23 +00:00
Giles Odigwe and GitHub
9e3b2fa09a
Python: Update package version ( #3258 )
...
* package version 260116
* removed name tags
2026-01-16 21:06:30 +00:00
Dmytro Struk and GitHub
5687e13221
Python: [BREAKING] Renamed create_agent to as_agent ( #3249 )
...
* Renamed create_agent to as_agent
* Override for as_agent
* Added override
2026-01-16 19:21:52 +00:00
Dmytro Struk and GitHub
b773830e4b
Create/Get Agent API - fixes and example improvements ( #3246 )
2026-01-16 04:36:34 +00:00
Dmytro Struk and GitHub
b5ca0c8eda
Python: Create/Get Agent API for OpenAI Assistants ( #3208 )
...
* Added provider implementation
* Added example with response format
* Small improvements
2026-01-15 22:52:32 +00:00
Dmytro Struk and GitHub
48d124efbe
Python: Create/Get Agent API for Azure V1 ( #3192 )
...
* Added provider implementation for Azure AI V1
* Small fixes
* Fixed OpenAPI example
* Fixed local MCP example
* Fixed hosted MCP example
* Fixed file search sample
* Small fixes
* Resolved comments
* Doc updates
2026-01-15 22:19:03 +00:00
Dmytro Struk and GitHub
6e9420f614
Updated DurableAIAgent and fixed integration tests ( #3241 )
2026-01-15 21:43:26 +00:00
Evan Mattson and GitHub
15d0c34d9f
Python: Properly configure structured outputs based on new options dict ( #3213 )
...
* Properly configure structured outputs based on new options dict
* Fix mypy
2026-01-15 11:41:46 +09:00
Evan Mattson and GitHub
620da7a829
Python: fix(ag-ui): add MCP tool support for AG-UI approval flows ( #3212 )
...
* add MCP tool support for AG-UI approval flows
* use attribute in place of property
2026-01-15 02:34:11 +00:00
Evan Mattson and GitHub
80b25a782b
fix(workflows): rename WorkflowOutputEvent.source_executor_id to executor_id for API consistency ( #3166 )
2026-01-15 02:11:25 +00:00
Evan Mattson and GitHub
ffe2e787ba
Python: fix(core): correct FunctionResultContent ordering in WorkflowAgent.merge_updates ( #3168 )
...
* fix(core): simplify FunctionResultContent ordering in WorkflowAgent.merge_updates
* improve comment
* Fix name
2026-01-15 01:54:44 +00:00
cb2862d4c3
update package versions ( #3223 )
...
Co-authored-by: Dmytro Struk <13853051+dmytrostruk@users.noreply.github.com >
2026-01-14 23:26:50 +00:00
Tao Chen and GitHub
6c956ec596
Python: Add more specific exceptions to Workflow ( #3188 )
...
* Add more specifc workflow exceptions
* Fix tests
* AI comments
* Misc
2026-01-14 20:10:52 +00:00
99c5718696
Python: Create/Get Agent API for Azure V2 ( #3059 )
...
* Added get_agent method to Azure AI V2
* Small fixes
* Small fix
* Removed AzureAIAgentProvider
* Added create_agent method
* Small fixes
* Fixed code interpreter tool mapping
* Added agent provider for V2 client
* Updated response format handling
* Added provider example
* Fixed errors
* Update python/samples/getting_started/agents/azure_ai/README.md
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com >
* Small fix
* Updates from merge
* Resolved comments
* Resolved comments
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com >
2026-01-14 19:35:01 +00:00
Eduard van Valkenburg and GitHub
d8cf8361bd
renamed all ( #3207 )
2026-01-14 05:54:07 +00:00
Tao Chen and GitHub
0b152418b6
[BREAKING] Python: Refactor orchestrations ( #3023 )
...
* Group chat refactoring Part 1; Next: HIL and handoff
* Add agent approval flow; next samples
* WIP: samples
* WIP: HIL samples
* Group chat HIL working; next: handoff
* Fix group chat tool approval sample
* WIP: refactor handoff; next handoff handling
* Handoff done; next handoff samples and concurrent and sequential
* Handoff samples, concurrent, and sequential done; next Magentic
* WIP: magentic; next test with samples + HIL
* Magentic Working; next fix all samples and tests
* Fix handoff samples; next tests
* WIP: fixing tests; some orchestration as agent samples are failing
* Group chat unit tests done
* Handoff unit tests done
* Remove old orchestration_request_info and fix related tests
* Magentic unit tests done
* Fix samples
* Fix test
* Fix test 2
* mypy
* Address comments
* Update readme
* Address comments
* Address comments 2
* Replace display name
2026-01-13 18:40:26 +00:00
Eduard van Valkenburg and GitHub
3e97425245
Python: [BREAKING]: Introducing Options as TypedDict and Generic ( #3140 )
...
* WIP typeddict for options
* updated all clients and ChatAgents
* updated everything
* added ADR
* fix mypy
* proper typevar imports
* fixed import
* fixed other imports
* slight update in the sample
* updated from feedback
* fixes
* fixed missing covariants and test fixes
* fixed typing
* updated anthropic thinking config
* ruff fixes
* fixed int tests
* fix tests and mypy
* updated integration tests
* updated docstring and test fix
* improved options handling in obser
* mypy fix
* updated a host of integration tests
* fix tests
* bedrock fix
2026-01-13 16:41:05 +00:00
Evan Mattson and GitHub
9c094573e8
Python: Add declarative workflow runtime ( #2815 )
...
* Further support for declarative python workflows
* Add tests. Clean up for typing and formatting
* Improvements and cleanup
* Typing cleanup. Improve docstrings
* Proper code in docstrings
* Fix malformed code-block directive in docstring
* Remove dead links
* PR feedback
* Address PR feedback
* Address PR feedback
* Remove sl
* Update devui frontend
* More cleanup
* Fix uv lock
* Skip Py 3.14 tests as powerfx doesn't support it
* Fix mypy error
* Fix for tool calls
* Removed stale docstring
* Fix lint
* Standardize on .NET namespaces. Revert DevUI changes (bring in later)
* Implement remaining items for Python declarative support to match dotnet
2026-01-13 07:11:21 +00:00
Eduard van Valkenburg and GitHub
b2893fbc00
Python: MCP Improvements: improved connection loss behavior, pagination for loading and a param to control representation ( #3154 )
...
* pagination support (#2848 ) added a parse_tool_result param and connection loss (#2884 )
* fix #3153
* improved connection handling
* improved logic
2026-01-13 04:09:33 +00:00
Eduard van Valkenburg and GitHub
203fb7b1c4
Python: [BREAKING]: removed display_name, renamed context_providers, middleware and AggregateContextProvider ( #3139 )
...
* removed display_name, renamed context_providers, middleware and AggregateContextProvider
* fixes
* fixed test
* testfix
* removed mistakenly put back test
* updated new test
* rename middlewares to middleware
* middleware fixes
2026-01-13 02:24:07 +00:00
e63c148fc7
Python: Fix MCPStreamableHTTPTool to use new streamable_http_client API ( #3088 )
...
* Fix MCPStreamableHTTPTool to use new streamable_http_client API with proper httpx client cleanup
Co-authored-by: eavanvalkenburg <13749212+eavanvalkenburg@users.noreply.github.com >
* Update docstring to reflect new streamable_http_client API usage
Co-authored-by: eavanvalkenburg <13749212+eavanvalkenburg@users.noreply.github.com >
* Refactor MCPStreamableHTTPTool to accept optional http_client parameter and delegate client creation to streamable_http_client
Co-authored-by: eavanvalkenburg <13749212+eavanvalkenburg@users.noreply.github.com >
* Update mcp package minimum version to 1.24.0 for streamable_http_client API support
Co-authored-by: eavanvalkenburg <13749212+eavanvalkenburg@users.noreply.github.com >
* Fix critical bugs: apply headers/timeout/sse_read_timeout when creating httpx client, add version constraint <2, and properly manage client lifecycle
Co-authored-by: eavanvalkenburg <13749212+eavanvalkenburg@users.noreply.github.com >
* Simplify implementation: remove headers/timeout/sse_read_timeout params, remove kwargs, remove close() override per feedback
Co-authored-by: eavanvalkenburg <13749212+eavanvalkenburg@users.noreply.github.com >
* Add back **kwargs parameter for backward compatibility (accepted but not used)
Co-authored-by: eavanvalkenburg <13749212+eavanvalkenburg@users.noreply.github.com >
* Remove unused httpx import from test file
Note: The uv.lock file needs to be updated with 'uv sync' to reflect the mcp version constraint change (>=1.24.0,<2)
Co-authored-by: eavanvalkenburg <13749212+eavanvalkenburg@users.noreply.github.com >
* cicd fixes
* udpated samples with headers examples
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com >
Co-authored-by: eavanvalkenburg <13749212+eavanvalkenburg@users.noreply.github.com >
Co-authored-by: eavanvalkenburg <github@vanvalkenburg.eu >
2026-01-12 17:26:53 +00:00
Eduard van Valkenburg and GitHub
551c2c3abe
Python: multiple bug fixes ( #3150 )
...
* fix Python: kwargs are not passed to _prepare_thread_and_messages in ChatAgent.run
Fixes #3118
* fix Python: [Bug]: model_id versus model_deployment_name is confusing in Azure AI Agents
Fixes #3147
* add types
* fixed type and docstring
2026-01-12 01:01:41 +00:00
Evan Mattson and GitHub
6445b6b3a6
Python: Fix AzureAIClient tool call bug for AG-UI use ( #3148 )
...
* Fiz AzureAIClient tool call bug
* Address copilot feedback
2026-01-09 18:53:15 +00:00
Evan Mattson and GitHub
d28ad2d7df
Track agent name with updates for workflow agent ( #3146 )
2026-01-09 08:23:32 +00:00
3f7ea350dc
Python: Add tool call/result content types and update connectors and samples ( #2971 )
...
* Add new AI content types and image tool support
Co-authored-by: eavanvalkenburg <13749212+eavanvalkenburg@users.noreply.github.com >
* Add Python content types for tool calls/results and image generation tool support
Co-authored-by: eavanvalkenburg <13749212+eavanvalkenburg@users.noreply.github.com >
* Address review feedback for tool content and samples
Co-authored-by: eavanvalkenburg <13749212+eavanvalkenburg@users.noreply.github.com >
* Tighten image generation typing and sample tools list
Co-authored-by: eavanvalkenburg <13749212+eavanvalkenburg@users.noreply.github.com >
* Align image generation output typing
Co-authored-by: eavanvalkenburg <13749212+eavanvalkenburg@users.noreply.github.com >
* Handle MCP naming, image options mapping, and connector tool content
Co-authored-by: eavanvalkenburg <13749212+eavanvalkenburg@users.noreply.github.com >
* Allow MCP call in function approval request
Co-authored-by: eavanvalkenburg <13749212+eavanvalkenburg@users.noreply.github.com >
* Remove raw image_generation tool remapping
Co-authored-by: eavanvalkenburg <13749212+eavanvalkenburg@users.noreply.github.com >
* Restore Anthropic tool_use to function calls unless code execution
Co-authored-by: eavanvalkenburg <13749212+eavanvalkenburg@users.noreply.github.com >
* Fix lint issues for hosted file docstring and MCP parsing
Co-authored-by: eavanvalkenburg <13749212+eavanvalkenburg@users.noreply.github.com >
* Import ChatResponse types in Anthropic client
Co-authored-by: eavanvalkenburg <13749212+eavanvalkenburg@users.noreply.github.com >
* Fix Anthropics citation type imports and MCP typing for handoff/tools
Co-authored-by: eavanvalkenburg <13749212+eavanvalkenburg@users.noreply.github.com >
* Skip lightning tests without agentlightning and fix function call import
Co-authored-by: eavanvalkenburg <13749212+eavanvalkenburg@users.noreply.github.com >
* fix lint on lab package
* rebuilt anthropic parsing
* redid anthropic parsing
* typo
* updated parsing and added missing docstrings
* fix tests
* mypy fixes
* second mypy fix
* add new class to other samples
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com >
Co-authored-by: eavanvalkenburg <13749212+eavanvalkenburg@users.noreply.github.com >
Co-authored-by: eavanvalkenburg <github@vanvalkenburg.eu >
2026-01-08 19:46:32 +00:00
Evan Mattson and GitHub
f508f1d6da
Python: Bump python version to 1.0.0b260107 for a release ( #3128 )
...
* Bump python version to 1.0.0b260107 for a release
* Update changelog
2026-01-08 08:49:28 +09:00
Evan Mattson and GitHub
e9d97ce6b7
Python: fix(azure-ai): Fix response_format handling for structured outputs ( #3114 )
...
* fix(azure-ai): read response_format from chat_options instead of run_options
* refactor: use explicit None checks for response_format
* Fix mypy error
* Mypy fix
2026-01-07 23:11:28 +00:00
claude89757 and GitHub
db283cd396
Python: Fix MCP tool result serialization for list[TextContent] ( #2523 )
...
* Fix MCP tool result serialization for list[TextContent]
When MCP tools return results containing list[TextContent], they were
incorrectly serialized to object repr strings like:
'[<agent_framework._types.TextContent object at 0x...>]'
This fix properly extracts text content from list items by:
1. Checking if items have a 'text' attribute (TextContent)
2. Using model_dump() for items that support it
3. Falling back to str() for other types
4. Joining single items as plain text, multiple items as JSON array
Fixes #2509
* Address PR review feedback for MCP tool result serialization
- Extract serialize_content_result() to shared _utils.py
- Fix logic: use texts[0] instead of join for single item
- Add type annotation: texts: list[str] = []
- Return empty string for empty list instead of '[]'
- Move import json to file top level
- Add comprehensive unit tests for serialization
* Address PR review feedback: fix type checking and double serialization
- Add isinstance(item.text, str) check to ensure text attribute is a string
- Fix double-serialization issue by keeping model_dump results as dicts
until final json.dumps (removes escaped JSON strings in arrays)
- Improve docstring with detailed return value documentation
- Add test for non-string text attribute handling
- Add tests for list type tool results in _events.py path
* Simplify PR: minimal changes to fix MCP tool result serialization
Addresses reviewer feedback about excessive refactoring:
- Reset _events.py to original structure
- Only add import and use serialize_content_result in one location
- All review comments addressed in serialize_content_result():
- Added isinstance(item.text, str) check
- Use model_dump(mode="json") to avoid double-serialization
- Improved docstring with explicit return value documentation
- Empty list returns "" instead of "[]"
* Refactor: Move MCP TextContent serialization to core prepare_function_call_results
Per reviewer feedback, moved the TextContent serialization logic from
ag-ui's serialize_content_result to the core package's
prepare_function_call_results function.
Changes:
- Added handling for objects with 'text' attribute (like MCP TextContent)
in _prepare_function_call_results_as_dumpable
- Removed serialize_content_result from ag-ui/_utils.py
- Updated _events.py and _message_adapters.py to use
prepare_function_call_results from core package
- Updated tests to match the core function's behavior
* Fix failing tests for prepare_function_call_results behavior
- test_tool_result_with_none: Update expected value to 'null' (JSON serialization of None)
- test_tool_result_with_model_dump_objects: Use Pydantic BaseModel instead of plain class
* Fix B903 linter error: Convert MockTextContent to dataclass
The ruff linter was reporting B903 (class could be dataclass or namedtuple)
for the MockTextContent test helper classes. This commit converts them to
dataclasses to satisfy the linter check.
2026-01-07 00:47:26 +00:00
Evan Mattson and GitHub
202f557c71
Bump versions to 1.0.0b260106 for a release. Update CHANGELOG.md ( #3109 )
2026-01-07 00:09:49 +00:00
Evan Mattson and GitHub
24c822590f
fix: tool_choice parameter not being honored when passed to agent.run() ( #3095 )
2026-01-06 22:51:20 +00:00
Evan Mattson and GitHub
844d345106
Python: Fix ExecutorInvokedEvent and ExecutorCompletedEvent observability data ( #3090 )
...
* Fix ExecutorInvokedEvent.data mutation bug
* Fix bug related to not yielding output type
2026-01-06 09:12:26 +00:00
takanori-terai and GitHub
ed5278c41d
Fix: Update OTLP exporter protocol conditions ( #3070 )
2026-01-06 04:45:29 +00:00
Eduard van Valkenburg and GitHub
deea844bc7
fix and extra int test ( #3037 )
2026-01-05 04:35:10 +00:00
Dmytro Struk and GitHub
5ab47596ff
Python: Updated package versions ( #3024 )
...
* Updated package versions
* Updated changelog
2025-12-23 16:04:53 +00:00
Eduard van Valkenburg and GitHub
a32702cf38
Python: latency improvements ( #3014 )
...
* latency improvements
* fixed mypy, added coding standards and instructions
* slight logic improvement
2025-12-23 16:04:34 +00:00
Hao Luo and GitHub
defe0f1a89
Python: Added response.created and response.in_progress event process to OpenAIBaseResponseClient ( #2975 )
...
* added response.created and response.in_progress to include response.id
* better doc string
* added tests for the new streaming event types
2025-12-19 17:50:15 +00:00
SuperKenVery and GitHub
85d70f01f6
Python: Preserve reasoning blocks with OpenRouter ( #2950 )
...
* Preserve reasoning blocks with OpenRouter
* Put encrypted reasoning in TextReasoningContent
* Remove unneccessary change
* Fix docs
* Support streaming
* Fix handling None in TextReasoningContent.text
2025-12-19 17:03:19 +00:00
Evan Mattson and GitHub
e15eab7da6
Python: Bump Py version to 1.0.0b251218 for a release. Update CHANGELOG ( #2968 )
...
* Bump Py version to 1.0.0b251218 for a release. Update CHANGELOG
* update lock
* Fix formatting
* Fix ChatKit typing
2025-12-19 01:31:57 +00:00