Python: Introducing UserInputRequest and Response types and HostedMcpTool (#405)

* 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>
This commit is contained in:
Eduard van Valkenburg
2025-09-10 15:37:34 +02:00
committed by GitHub
Unverified
parent 947f2bf642
commit 6aa746d891
21 changed files with 1186 additions and 447 deletions
@@ -66,7 +66,13 @@ from samples.getting_started.agents.foundry.foundry_with_explicit_settings impor
main as foundry_with_explicit_settings,
)
from samples.getting_started.agents.foundry.foundry_with_function_tools import (
main as foundry_with_function_tools,
mixed_tools_example as foundry_with_function_tools_mixed,
)
from samples.getting_started.agents.foundry.foundry_with_function_tools import (
tools_on_agent_level as foundry_with_function_tools_agent,
)
from samples.getting_started.agents.foundry.foundry_with_function_tools import (
tools_on_run_level as foundry_with_function_tools_run,
)
from samples.getting_started.agents.foundry.foundry_with_local_mcp import (
main as foundry_with_local_mcp,
@@ -323,7 +329,25 @@ agent_samples = [
],
),
param(
foundry_with_function_tools,
foundry_with_function_tools_agent,
[], # Non-interactive sample
id="foundry_with_function_tools",
marks=[
pytest.mark.foundry,
pytest.mark.skipif(os.getenv(RUN_SAMPLES_TESTS, None) is None, reason="Not running sample tests."),
],
),
param(
foundry_with_function_tools_run,
[], # Non-interactive sample
id="foundry_with_function_tools",
marks=[
pytest.mark.foundry,
pytest.mark.skipif(os.getenv(RUN_SAMPLES_TESTS, None) is None, reason="Not running sample tests."),
],
),
param(
foundry_with_function_tools_mixed,
[], # Non-interactive sample
id="foundry_with_function_tools",
marks=[