* Remove Foundry toolbox helpers; standardize on MCP for toolbox consumption
- Remove RawFoundryChatClient.get_toolbox() and its fetch_toolbox import
- Remove fetch_toolbox, select_toolbox_tools, get_toolbox_tool_name,
get_toolbox_tool_type, FoundryHostedToolType, ToolboxToolSelectionInput
from agent_framework_foundry._tools
- Remove ExperimentalFeature.TOOLBOXES from _feature_stage.py (no consumers)
- Drop toolbox re-exports from agent_framework_foundry/__init__.py and
agent_framework.foundry namespace
- Update _sanitize_foundry_response_tool docstring to remove toolbox framing;
sanitization logic itself is unchanged
- Update _agent.py docstring: 'toolbox-fetched MCP' → 'hosted MCP'
- Delete tests/test_toolbox.py (all tests covered removed helpers)
- Update test_foundry_chat_client.py: rename/redoc tests that mentioned
toolbox but test sanitization that remains
- Delete foundry_chat_client_with_toolbox.py (bespoke toolbox API sample)
- Delete foundry_toolbox_context_provider.py (relied on select_toolbox_tools)
- Rename foundry_chat_client_with_toolbox_mcp.py →
foundry_chat_client_with_toolbox.py (canonical MCP pattern)
- Rewrite 04_foundry_toolbox/main.py to use MCPStreamableHTTPTool
- Update provider/README, context_providers/README, 04_foundry_toolbox/README
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fix(samples): update 06_files sample to consume toolbox via MCP (#5670)
Replace removed get_toolbox/select_toolbox_tools APIs with
MCPStreamableHTTPTool, using allowed_tools=["code_interpreter"] to
select only the code interpreter from the toolbox endpoint.
Update .env.example and README to use FOUNDRY_TOOLBOX_ENDPOINT
instead of TOOLBOX_NAME.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fix(foundry): remove non-existent toolbox helper APIs from README (#5670)
Remove the 'fetch, optionally filter, and pass tools directly' pattern
from the FoundryChatClient toolbox documentation, as select_toolbox_tools
and get_toolbox were removed. Only the MCP endpoint pattern is documented.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fix(foundry): remove residual toolbox docstring references and reproduction report
Remove REPRODUCTION_REPORT.md (workflow artifact that should not be committed),
and update two remaining docstring references that still said 'toolbox reads'
/'toolbox definition' after the toolbox helpers were removed.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Python: Remove bespoke Foundry toolbox helpers; standardize on MCP for toolbox consumption
Fixes#5670
* fix(#5670): resolve toolbox endpoint from TOOLBOX_NAME fallback; add namespace regression tests
- Add _resolve_toolbox_endpoint() helper in 04_foundry_toolbox/main.py and
06_files/main.py that prefers FOUNDRY_TOOLBOX_ENDPOINT but falls back to
deriving the MCP URL from FOUNDRY_PROJECT_ENDPOINT + TOOLBOX_NAME — fixing
the startup KeyError when agents are deployed via azd provision (which injects
TOOLBOX_NAME, not FOUNDRY_TOOLBOX_ENDPOINT).
- Update 04_foundry_toolbox/.env.example to use FOUNDRY_TOOLBOX_ENDPOINT
(consistent with 06_files).
- Add TOOLBOX_NAME env var to 06_files/agent.yaml so deployed agents have it
available for the fallback derivation.
- Update both READMEs to document the two ways to supply the toolbox endpoint.
- Add test_foundry_namespace_no_longer_exposes_toolbox_helpers() with negative
assertions for FoundryHostedToolType, get_toolbox_tool_name,
get_toolbox_tool_type, and select_toolbox_tools — guarding against accidental
re-introduction of removed symbols.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fix(samples): fail fast on empty FOUNDRY_TOOLBOX_ENDPOINT; add unit tests
Addresses review feedback for #5670:
- In _resolve_toolbox_endpoint() (04_foundry_toolbox/main.py and
06_files/main.py) change the walrus-operator check from a truthy
test to an explicit 'is not None' guard. An explicitly set empty
string now raises ValueError immediately with a clear message
instead of silently falling through to the fallback URL
construction.
- Add tests/samples/hosting/test_toolbox_endpoint.py covering both
sample modules:
(a) FOUNDRY_TOOLBOX_ENDPOINT set → returned as-is
(b) FOUNDRY_TOOLBOX_ENDPOINT set to empty string → ValueError
(c) fallback constructs URL from FOUNDRY_PROJECT_ENDPOINT + TOOLBOX_NAME,
stripping trailing slashes
(d) neither variable group set → KeyError
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Address review feedback: remove extraneous test and docstring content
- Remove test_foundry_namespace_no_longer_exposes_toolbox_helpers (no longer warranted)
- Remove docstring from _agent.py _prepare_tools_for_openai (extraneous)
- Trim _chat_client.py _prepare_tools_for_openai docstring to one-liner (toolbox references no longer relevant)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fix: remove remaining extraneous docstring from RawFoundryChatClient._prepare_tools_for_openai
Address review comment on PR #5671: reviewer noted the description
isn't warranted now that toolbox helpers have been removed. Matches
the pattern in RawFoundryAgentChatClient which has no docstring.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Python: improve .env precedence and observability samples
- Switch load_settings to explicit precedence: overrides -> explicit .env -> environment -> defaults\n- Raise when env_file_path is provided but missing\n- Update settings docs and tests for new behavior\n- Refresh observability samples and README guidance for env loading options\n\nCloses #3864\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fixed some imports
* Fix load_settings CI regressions
Allow explicit env_file_path values that exist but are not regular files (for example /dev/null) by checking path existence before dotenv parsing, and restore a dict accumulator with typed return cast to satisfy mypy.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Avoid implicit dotenv in observability
Only load dotenv in observability helpers when env_file_path is explicitly provided, and remove test os.devnull workarounds that are no longer necessary.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Eduard van Valkenburg
·
2026-02-18 11:18:52 +00:00
* Replace Role and FinishReason classes with NewType + Literal
- Remove EnumLike metaclass from _types.py
- Replace Role class with NewType('Role', str) + RoleLiteral
- Replace FinishReason class with NewType('FinishReason', str) + FinishReasonLiteral
- Update all usages across codebase to use string literals
- Remove .value access patterns (direct string comparison now works)
- Add backward compatibility for legacy dict serialization format
- Update tests to reflect new string-based types
Addresses #3591, #3615
* Simplify ChatResponse and AgentResponse type hints (#3592)
- Remove overloads from ChatResponse.__init__
- Remove text parameter from ChatResponse.__init__
- Remove | dict[str, Any] from finish_reason and usage_details params
- Remove **kwargs from AgentResponse.__init__
- Both now accept ChatMessage | Sequence[ChatMessage] | None for messages
- Update docstrings and examples to reflect changes
- Fix tests that were using removed kwargs
- Fix Role type hint usage in ag-ui utils
* Remove text parameter from ChatResponseUpdate and AgentResponseUpdate (#3597)
- Remove text parameter from ChatResponseUpdate.__init__
- Remove text parameter from AgentResponseUpdate.__init__
- Remove **kwargs from both update classes
- Simplify contents parameter type to Sequence[Content] | None
- Update all usages to use contents=[Content.from_text(...)] pattern
- Fix imports in test files
- Update docstrings and examples
* Rename from_chat_response_updates to from_updates (#3593)
- ChatResponse.from_chat_response_updates → ChatResponse.from_updates
- ChatResponse.from_chat_response_generator → ChatResponse.from_update_generator
- AgentResponse.from_agent_run_response_updates → AgentResponse.from_updates
* Remove try_parse_value method from ChatResponse and AgentResponse (#3595)
- Remove try_parse_value method from ChatResponse
- Remove try_parse_value method from AgentResponse
- Remove try_parse_value calls from from_updates and from_update_generator methods
- Update samples to use try/except with response.value instead
- Update tests to use response.value pattern
- Users should now use response.value with try/except for safe parsing
* Add agent_id to AgentResponse and clarify author_name documentation (#3596)
- Add agent_id parameter to AgentResponse class
- Document that author_name is on ChatMessage objects, not responses
- Update ChatResponse docstring with author_name note
- Update AgentResponse docstring with author_name note
* Simplify ChatMessage.__init__ signature (#3618)
- Make contents a positional argument accepting Sequence[Content | str]
- Auto-convert strings in contents to TextContent
- Remove overloads, keep text kwarg for backward compatibility with serialization
- Update _parse_content_list to handle string items
- Update all usages across codebase to use new format: ChatMessage("role", ["text"])
* Allow Content as input on run and get_response
- Update prepare_messages and normalize_messages to accept Content
- Update type signatures in _agents.py and _clients.py
- Add tests for Content input handling
* Fix ChatMessage usage across packages and samples
Update all remaining ChatMessage(role=..., text=...) to use new
ChatMessage('role', ['text']) signature.
* Fix Role string usage and response format parsing
- Fix redis provider: remove .value access on string literals
- Fix durabletask ensure_response_format: set _response_format before accessing .value
* Fix ollama .value and ai_model_id issues, handle None in content list
- Fix ollama _chat_client: remove .value on string literals
- Fix ollama _chat_client: rename ai_model_id to model_id
- Fix _parse_content_list: skip None values gracefully
* Fix A2AAgent type signature to include Content
* Fix Role/FinishReason NewType dict annotations and improve test coverage to 95%
* Fix mypy errors for Role/FinishReason NewType usage
* Fix Role.TOOL and Role.ASSISTANT usage in _orchestrator_helpers.py
* Fix Role NewType usage in durabletask _models.py
Eduard van Valkenburg
·
2026-02-04 10:13:23 +00:00
* initial work on User Approval (and hosted mcp to validate)
* small update to the comments in the sample
* enable local MCP tools in chatClient get methods
* working streaming and improved setup
* fix for pyright
* updated create_approval -> create_response method
* added tests
* updated HostedMcpTool and addressed feedback
* update type name
* naming updates
* small docstring update
* mypy fix
* fixes and updates
* fixes for responses
* fix int tests
* removed broken tests
* updated test running
* removed specific content check on websearch
* increased timeout
* split slow foundry test
* don't parallel run samples
* add dist load to unit tests
---------
Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com>
Eduard van Valkenburg
·
2025-09-10 13:37:34 +00:00
* added ChatClientBase with function calling
* streaming update
* fixed typing
* test setup
* small update
* src setup
* removed src, updated test naming
* fixed test command
* alolow args
* updated test run
* added unit test folder to azure
* added init and unit test to azure
* added other cross tests
* restructured
* reset test run
* fix name
* removed always
* updated test
* extend pytest.xml locations
* run surface always
* added decorators for FC and marked tests
* fixed mypy settings and added tests
* fix override import
* removed import
Eduard van Valkenburg
·
2025-07-10 09:18:15 +00:00
* Added Agent and AgentThread classes
* Addressed PR feedback
* Converted Agent to protocol
* Removed thread deletion logic
* Small update
* Small updates to the Agent protocol
* feat: ModelClient and content types
* refactor: Pythonify ChatResponseFormat and ChatRole
* feat: Add guardrail interfaces
* refactor: Remove CancellationToken
* feat: Solidify the Usage APIs
* Adds well-known keys for additional_counts, and guidance for how to avoid collisions between providers
* Implement sum-aggregation for usage
* refactor: Move AITool out of model_client
* refactor: Copy editing
* fix: CI checks (pyupgrade, ruff, etc.)
* ci: Fix pre-commit to use pyright in uv venv
The existing pyright precommit hook inside of python-pyright is no longer being maintained by the owner (see https://github.com/RobertCraigie/pyright-python/issues/265)
The fix is to define the hook ourselves, relying on `uv run` to drive it. In order for that to work right we need to use the "system" language to break out of the sandbox.
* fix: Pyright error fixes
* docs: Update models and types design docs
* Python: Refinement of content types and model client (#112)
* refinement of structure and buildup
with ports from semantigen
* refined the data and uri contents
* refined chat response and updates
* moved things and added tests
* moved out of src folder
* fixed imports and tests
* small tweaks
* missing build system
* upgrade
* add mypy
* fixed typing for types
* fix tests
* fixed tool
* disable json checks on vscode
* remove print
---------
Co-authored-by: Eduard van Valkenburg <eavanvalkenburg@users.noreply.github.com>
Co-authored-by: eavanvalkenburg <github@vanvalkenburg.eu>