* first work on declarative
* initial version of the declarative support
* fix tests and mypy
* fix parameters of functiontool
* slight logic improvement
* remove path until merge
* updates from comments
* create dispatcher and spec type, json_schema method
* fix mypy, skipping model
* updated lock
* fixed declarative tests and renamed some other test files
* refined loader
* updated lock
* fix mypy
* added readme to samples folder
* fixes from review
* undid test file rename
Eduard van Valkenburg
·
2025-11-19 16:33:02 +00:00
* 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 bug where ChatAgent system instructions were not captured in Langfuse
traces due to incorrect attribute access.
The observability code was attempting to retrieve instructions using
getattr(self, "instructions", None), but ChatAgent stores instructions
in self.chat_options.instructions. This caused system_instructions to
always be None in Langfuse traces.
Changed both _trace_agent_run and _trace_agent_run_stream functions
to correctly retrieve instructions from chat_options.instructions.
Fixes affect:
- Line 1123: _trace_agent_run (non-streaming)
- Line 1192: _trace_agent_run_stream (streaming)
Update XML documentation to clarify exception behavior.
See `ChatClientAgentThreadTests.SetConversationIdThrowsWhenMessageStoreIsSet` which already verifies this is the actual behavior.
Co-authored-by: Chris <66376200+crickman@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
* Move Purview integration logic into middleware
* Improve error handling and user id management
* Rename purview package
* Handle 402s more explicitly; add Middleware generation methods; don't ignore exceptions
* Use DI container; pass scope id to PC
* Add protection scope caching
* Wrap more exceptions in PurviewClient
* Remove block check dedup; add tests
* Refactor PurviewWrapper intialization; Add unit tests
* Use different .Use method and add IDisposable stub
* Add background job processing for Purview
* Misc comment cleanup
* Apply copilot comments
* Fix formatting
* Formatting other files to fix pipeline
* Small updates to settings and exceptions
* Add README
* Move Purview sample
* Address review comments and update XML comments
* Newline after namespace
* Move public Purview classes to single namespace; Clean up csproj and slnx
* Commit the renames
* Remove unused openAI dependency
---------
Co-authored-by: Dmytro Struk <13853051+dmytrostruk@users.noreply.github.com>
* fix devui regression from #2021 where all input is stringified but devui HIL input does not handle stringified json strings correctly.
* update incorrect test
* add devui hil input tests