* refactoring and unifying naming schemes of internal methods of chat clients
* set tool_choice to auto
* fix for mypy
* added note on naming and fix#2951
* fix responses
* fixes in azure ai agents client
Eduard van Valkenburg
·
2025-12-18 12:02:23 +00:00
* Correction of MCP image type conversion in _mcp.py
* Added a new overload to the init function of the DataContent() type of the Agent Framework, edited the test case to correctly test the usage of the data and uri fields while using DataContent()
* Fixed tests related to the changes of the DataContent type, added testing for both string and byte representations
* Added an example of using kwargs in ai_function
* Added thread object to ai_function kwargs
* Updated docs
* Small fix
* Added thread parameter filtering
* added more complete parsing for mcp tool arguments
* fixed mypy
* added nonlocal model counter, and some fixes
* fixes in naming logic
* extracted json parsing function, added parametrized test and checked coverage
Eduard van Valkenburg
·
2025-12-11 17:24:08 +00:00
* Add factory pattern to sequential orchestration builder
* Use temp list to avoid override
* Add sample and some other fixes
* Fix comments
* Small fix
* Update readme
* Support HITL for orchestration patterns
* Cleanup around naming
* Fix typing issues
* Clean up
* Naming clean up
* Updates to HITL to make it cleaner
* Rename human input hook to orchestration request info
* Clean up per PR feedback
* Provide way for HITL with magentic
* support tool call approvals and hitl stall replan
* human plan intervention sample
* Clean up
* Improve loging
* updates
* Add type annotations for AgentRunEvent and AgentRunUpdateEvent data attributes
* Fix unnecessary cast after typing improvement
* Mcp pkg update introduced type change. Fix it.
* update opentelemetry deps to 1.39.0 and use LogRecordExporter for type compatibility
* Standardize orchestration outputs as list of chatmessage. Add chat options to group chat prompt manager
* refactor group chat
* Improve group chat manager
* README Update
* Cleanup
* Add comment
* More cleanup
* Standardize termination condition for group chat
* Improvements on termination logic
* Fix tests
* Fix new line
* PR feedback
* Update ChatKit based on OpenAI type change
* Raise error if response format is not expected type
* Only one starting executor required. Add tests.
* Add magentic start executor test
* feat(mcp): add full _meta field support for CallToolResult objects
- Extract and preserve complete _meta field from MCP CallToolResult responses
- Merge metadata into additional_properties of converted content items
- Handle isError field for proper error state integration
- Support arbitrary metadata like token usage, costs, and performance metrics
- Maintain backward compatibility with existing tool execution workflows
- Add comprehensive test coverage for all metadata scenarios including edge cases
- Update documentation with metadata handling examples and patterns
Fixes protocol compliance violation where _meta fields were being dropped,
enables proper monitoring and cost tracking of MCP tool usage.
* Update python/packages/core/agent_framework/_mcp.py
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Clarify MCP _meta field test to use generic example metadata
- Updated test_mcp_call_tool_result_with_meta_arbitrary_data to use arbitrary metadata fields
- Added comments to emphasize that _meta structure is server-specific and not standardized
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Fixes#2219
Adds default=str to json.dumps() calls to handle non-JSON-serializable
types like datetime objects in tool function results.
Co-authored-by: kishikawa-hayato <84244732+HerBest-max@users.noreply.github.com>
* fix: resolve string annotations in FunctionExecutor
Enhance type hint validation in FunctionExecutor by importing `typing` and
using `get_type_hints` to correctly resolve annotations.
This fixes validation failures when `from __future__ import annotations`
is enabled, which stores annotations as strings.
Fixes#1808
* Update python/packages/core/tests/workflow/test_function_executor_future.py
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* ran pre commit
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Fix: Prevent duplicate MCP tools and prompts (#1876)
- Added deduplication logic in MCPTool.load_tools() method
- Added deduplication logic in MCPTool.load_prompts() method
- Track existing function names before loading from MCP server
- Skip tools/prompts that are already registered in _functions list
- Prevents 400 error from Azure AI Foundry caused by duplicate tool names
The issue occurred because load_tools() was being called multiple times
(during connect() and by notification handlers), causing tools to be
appended without duplicate checking.
Changes made:
1. In load_tools(): Added existing_names set to track registered functions
2. In load_tools(): Added check to skip tools already in existing_names
3. In load_prompts(): Applied same deduplication pattern
Testing:
- Created unit test verifying deduplication logic
- Confirmed duplicates are skipped correctly
- Confirmed new functions are added correctly
- Prevents duplicate tool names being sent to LLM
Fixes#1876
* Address review feedback: Prevent multiple calls to load_tools and load_prompts
- Added _tools_loaded and _prompts_loaded flags to MCPTool class
- Modified load_tools() to check if already loaded and return early
- Modified load_prompts() to check if already loaded and return early
- Moved test cases from test_mcp_fix.py to test_mcp.py
- Added tests for multiple call prevention
- Deleted separate test_mcp_fix.py file
Addresses review feedback from @eavanvalkenburg:
- Prevents accidental multiple calls to load_tools()
- Prevents accidental multiple calls to load_prompts()
- Test file now in proper location (test_mcp.py)
* Address review feedback: Move flag checks to connect() and remove comments
- Removed verbose comments from code
- Moved _tools_loaded and _prompts_loaded checks to connect() method
- Allows manual calls to load_tools() and load_prompts() for updates
- Updated tests to reflect new behavior
- connect() now prevents duplicate loading during connection
- Users can still manually call load_tools()/load_prompts() to refresh
Addresses feedback from @eavanvalkenburg
* Fix: Code quality and formatting issues
- Applied black formatting
- Fixed ruff linting issues
- All tests passing locally
* chore: Re-run uv lock per review request
* Apply pre-commit formatting: consolidate type annotations
- Consolidate multi-line type annotations to single line
- Remove unnecessary parentheses
- Apply ruff format and security checks