From 96c371286b01c6d23b1926b06ab6e54576e3309b Mon Sep 17 00:00:00 2001 From: Darren Cohen <39422044+dargilco@users.noreply.github.com> Date: Fri, 2 Oct 2026 11:12:41 -0700 Subject: [PATCH 01/11] First --- python/samples/02-agents/response_stream.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/python/samples/02-agents/response_stream.py b/python/samples/02-agents/response_stream.py index 917a4490233..12f055fe9d9 100644 --- a/python/samples/02-agents/response_stream.py +++ b/python/samples/02-agents/response_stream.py @@ -118,18 +118,16 @@ - You get the complete response without ever seeing individual updates ** Pattern 3: Combined Usage ** - -When you first iterate the stream and then call `get_final_response()`, the following occurs: -- Iteration yields updates with transform hooks applied -- Cleanup hooks run after iteration completes -- Calling `get_final_response()` uses the already collected updates to produce the final response -- Note that it does not re-iterate the stream since it's already been consumed - ```python async for update in response_stream: print(update.text) # See each update final = await response_stream.get_final_response() # Get the aggregated result ``` +When you first iterate the stream and then call `get_final_response()`, the following occurs: +- Iteration yields updates with transform hooks applied +- Cleanup hooks run after iteration completes +- Calling `get_final_response()` uses the already collected updates to produce the final response +- Note that it does not re-iterate the stream since it's already been consumed === Chaining with .map(), .flat_map(), and .with_finalizer() === From 143e3cfb9f8068e6e9812d9376e37e8eb50f6c52 Mon Sep 17 00:00:00 2001 From: Darren Cohen <39422044+dargilco@users.noreply.github.com> Date: Fri, 2 Oct 2026 11:21:23 -0700 Subject: [PATCH 02/11] Correct `a Agent` to `an Agent` --- .../packages/ag-ui/tests/ag_ui/test_tooling.py | 2 +- .../packages/core/agent_framework/_agents.py | 4 ++-- .../_workflows/_typing_utils.py | 4 ++-- .../agent_framework_declarative/_loader.py | 18 +++++++++--------- .../_workflows/_factory.py | 2 +- .../_magentic.py | 2 +- .../observability/workflow_observability.py | 2 +- python/samples/02-agents/response_stream.py | 2 +- .../agents/custom_agent_executors.py | 2 +- 9 files changed, 19 insertions(+), 19 deletions(-) diff --git a/python/packages/ag-ui/tests/ag_ui/test_tooling.py b/python/packages/ag-ui/tests/ag_ui/test_tooling.py index f62c55c7df9..92462663a82 100644 --- a/python/packages/ag-ui/tests/ag_ui/test_tooling.py +++ b/python/packages/ag-ui/tests/ag_ui/test_tooling.py @@ -34,7 +34,7 @@ def regular_tool() -> str: def _create_chat_agent_with_tool(tool_name: str = "regular_tool") -> Agent: - """Create a Agent with a mocked chat client and a simple tool. + """Create an Agent with a mocked chat client and a simple tool. Note: tool_name parameter is kept for API compatibility but the tool will always be named 'regular_tool' since tool uses the function name. diff --git a/python/packages/core/agent_framework/_agents.py b/python/packages/core/agent_framework/_agents.py index c37156a779b..69f7c6d1ec1 100644 --- a/python/packages/core/agent_framework/_agents.py +++ b/python/packages/core/agent_framework/_agents.py @@ -959,7 +959,7 @@ def __init__( tokenizer: TokenizerProtocol | None = None, additional_properties: MutableMapping[str, Any] | None = None, ) -> None: - """Initialize a Agent instance. + """Initialize an Agent instance. Args: client: The chat client to use for the agent. @@ -2061,7 +2061,7 @@ def __init__( tokenizer: TokenizerProtocol | None = None, additional_properties: MutableMapping[str, Any] | None = None, ) -> None: - """Initialize a Agent instance.""" + """Initialize an Agent instance.""" super().__init__( client=client, instructions=instructions, diff --git a/python/packages/core/agent_framework/_workflows/_typing_utils.py b/python/packages/core/agent_framework/_workflows/_typing_utils.py index 6496716f1ec..e4ee10224de 100644 --- a/python/packages/core/agent_framework/_workflows/_typing_utils.py +++ b/python/packages/core/agent_framework/_workflows/_typing_utils.py @@ -71,13 +71,13 @@ def _resolve_function_annotations( # pyright: ignore[reportUnusedFunction] def is_chat_agent(agent: Any) -> TypeGuard[Agent]: - """Check if the given agent is a Agent. + """Check if the given agent is an Agent. Args: agent (Any): The agent to check. Returns: - TypeGuard[Agent]: True if the agent is a Agent, False otherwise. + TypeGuard[Agent]: True if the agent is an Agent, False otherwise. """ return isinstance(agent, Agent) diff --git a/python/packages/declarative/agent_framework_declarative/_loader.py b/python/packages/declarative/agent_framework_declarative/_loader.py index 5e7e0b8cf27..85ea77c474c 100644 --- a/python/packages/declarative/agent_framework_declarative/_loader.py +++ b/python/packages/declarative/agent_framework_declarative/_loader.py @@ -290,7 +290,7 @@ def __init__( load_dotenv(dotenv_path=env_file_path, encoding=env_file_encoding) def create_agent_from_yaml_path(self, yaml_path: str | Path) -> Agent: - """Create a Agent from a YAML file path. + """Create an Agent from a YAML file path. This method does the following things: @@ -298,7 +298,7 @@ def create_agent_from_yaml_path(self, yaml_path: str | Path) -> Agent: 2. Validates that the loaded object is a PromptAgent. 3. Creates the appropriate ChatClient based on the model provider and apiType. 4. Parses the tools, options, and response format from the PromptAgent. - 5. Creates and returns a Agent instance with the configured properties. + 5. Creates and returns an Agent instance with the configured properties. Args: yaml_path: Path to the YAML file representation of a PromptAgent. @@ -344,7 +344,7 @@ def create_agent_from_yaml_path(self, yaml_path: str | Path) -> Agent: return self.create_agent_from_yaml(yaml_str) def create_agent_from_yaml(self, yaml_str: str) -> Agent: - """Create a Agent from a YAML string. + """Create an Agent from a YAML string. This method does the following things: @@ -352,7 +352,7 @@ def create_agent_from_yaml(self, yaml_str: str) -> Agent: 2. Validates that the loaded object is a PromptAgent. 3. Creates the appropriate ChatClient based on the model provider and apiType. 4. Parses the tools, options, and response format from the PromptAgent. - 5. Creates and returns a Agent instance with the configured properties. + 5. Creates and returns an Agent instance with the configured properties. Args: yaml_str: YAML string representation of a PromptAgent. @@ -417,7 +417,7 @@ def create_agent_from_yaml(self, yaml_str: str) -> Agent: return self.create_agent_from_dict(yaml.safe_load(yaml_str)) def create_agent_from_dict(self, agent_def: dict[str, Any]) -> Agent: - """Create a Agent from a dictionary definition. + """Create an Agent from a dictionary definition. This method does the following things: @@ -425,7 +425,7 @@ def create_agent_from_dict(self, agent_def: dict[str, Any]) -> Agent: 2. Validates that the loaded object is a PromptAgent. 3. Creates the appropriate ChatClient based on the model provider and apiType. 4. Parses the tools, options, and response format from the PromptAgent. - 5. Creates and returns a Agent instance with the configured properties. + 5. Creates and returns an Agent instance with the configured properties. Args: agent_def: Dictionary representation of a PromptAgent. @@ -485,7 +485,7 @@ def create_agent_from_dict(self, agent_def: dict[str, Any]) -> Agent: return agent async def create_agent_from_yaml_path_async(self, yaml_path: str | Path) -> Agent: - """Async version: Create a Agent from a YAML file path. + """Async version: Create an Agent from a YAML file path. This is the async counterpart to ``create_agent_from_dict`` and is useful when the rest of your setup is already async. @@ -516,7 +516,7 @@ async def create_agent_from_yaml_path_async(self, yaml_path: str | Path) -> Agen return await self.create_agent_from_yaml_async(yaml_str) async def create_agent_from_yaml_async(self, yaml_str: str) -> Agent: - """Async version: Create a Agent from a YAML string. + """Async version: Create an Agent from a YAML string. Use this method when the surrounding call site is already async and you want to build an agent directly from YAML text. @@ -547,7 +547,7 @@ async def create_agent_from_yaml_async(self, yaml_str: str) -> Agent: return await self.create_agent_from_dict_async(yaml.safe_load(yaml_str)) async def create_agent_from_dict_async(self, agent_def: dict[str, Any]) -> Agent: - """Async version: Create a Agent from a dictionary definition. + """Async version: Create an Agent from a dictionary definition. This is the async counterpart to ``create_agent_from_dict`` and is useful when the rest of your setup is already async. diff --git a/python/packages/declarative/agent_framework_declarative/_workflows/_factory.py b/python/packages/declarative/agent_framework_declarative/_workflows/_factory.py index 0b3be5de94f..a8329a59734 100644 --- a/python/packages/declarative/agent_framework_declarative/_workflows/_factory.py +++ b/python/packages/declarative/agent_framework_declarative/_workflows/_factory.py @@ -596,7 +596,7 @@ def register_agent(self, name: str, agent: SupportsAgentRun | AgentExecutor) -> Args: name: The name to register the agent under. Must match the agent name referenced in InvokeAzureAgent actions. - agent: The agent instance (typically a Agent or similar). + agent: The agent instance (typically an Agent or similar). Returns: Self for method chaining. diff --git a/python/packages/orchestrations/agent_framework_orchestrations/_magentic.py b/python/packages/orchestrations/agent_framework_orchestrations/_magentic.py index 6206022f043..d409c081efb 100644 --- a/python/packages/orchestrations/agent_framework_orchestrations/_magentic.py +++ b/python/packages/orchestrations/agent_framework_orchestrations/_magentic.py @@ -517,7 +517,7 @@ def on_checkpoint_restore(self, state: dict[str, Any]) -> None: class StandardMagenticManager(MagenticManagerBase): - """Standard Magentic manager that performs real LLM calls via a Agent. + """Standard Magentic manager that performs real LLM calls via an Agent. The manager constructs prompts that mirror the original Magentic One orchestration: - Facts gathering diff --git a/python/samples/02-agents/observability/workflow_observability.py b/python/samples/02-agents/observability/workflow_observability.py index f7893b2c986..43a38025663 100644 --- a/python/samples/02-agents/observability/workflow_observability.py +++ b/python/samples/02-agents/observability/workflow_observability.py @@ -14,7 +14,7 @@ from typing_extensions import Never """ -This sample shows the telemetry collected when running a Agent Framework workflow. +This sample shows the telemetry collected when running an Agent Framework workflow. This simple workflow consists of two executors arranged sequentially: 1. An executor that converts input text to uppercase. diff --git a/python/samples/02-agents/response_stream.py b/python/samples/02-agents/response_stream.py index 12f055fe9d9..135cf9e0ce0 100644 --- a/python/samples/02-agents/response_stream.py +++ b/python/samples/02-agents/response_stream.py @@ -131,7 +131,7 @@ === Chaining with .map(), .flat_map(), and .with_finalizer() === -When building a Agent on top of a ChatClient, we face a challenge: +When building an Agent on top of a ChatClient, we face a challenge: - The ChatClient returns a ResponseStream[ChatResponseUpdate, ChatResponse] - The Agent needs to return a ResponseStream[AgentResponseUpdate, AgentResponse] - We can't iterate the ChatClient's stream twice! diff --git a/python/samples/03-workflows/agents/custom_agent_executors.py b/python/samples/03-workflows/agents/custom_agent_executors.py index 56943b558f2..e832bbb7d68 100644 --- a/python/samples/03-workflows/agents/custom_agent_executors.py +++ b/python/samples/03-workflows/agents/custom_agent_executors.py @@ -43,7 +43,7 @@ class Writer(Executor): """Custom executor that owns a domain specific agent responsible for generating content. This class demonstrates: - - Attaching a Agent to an Executor so it participates as a node in a workflow. + - Attaching an Agent to an Executor so it participates as a node in a workflow. - Using a @handler method to accept a typed input and forward a typed output via ctx.send_message. """ From 8befc3b50c1520c43a4048aac30bbe6980c385e2 Mon Sep 17 00:00:00 2001 From: Darren Cohen <39422044+dargilco@users.noreply.github.com> Date: Fri, 2 Oct 2026 11:22:37 -0700 Subject: [PATCH 03/11] Correct `a agent` to `an agent` --- .../samples/02-agents/providers/anthropic/anthropic_skills.py | 2 +- .../samples/03-workflows/agents/group_chat_workflow_as_agent.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/python/samples/02-agents/providers/anthropic/anthropic_skills.py b/python/samples/02-agents/providers/anthropic/anthropic_skills.py index f5945474bad..c8d74a86ada 100644 --- a/python/samples/02-agents/providers/anthropic/anthropic_skills.py +++ b/python/samples/02-agents/providers/anthropic/anthropic_skills.py @@ -37,7 +37,7 @@ async def main() -> None: for skill in skills.data: print(f"{skill.source}: {skill.id} (version: {skill.latest_version})") - # Create a agent with the pptx skill enabled + # Create an agent with the pptx skill enabled # Skills also need the code interpreter tool to function agent = Agent( client=client, diff --git a/python/samples/03-workflows/agents/group_chat_workflow_as_agent.py b/python/samples/03-workflows/agents/group_chat_workflow_as_agent.py index a93155917db..68ba852dee4 100644 --- a/python/samples/03-workflows/agents/group_chat_workflow_as_agent.py +++ b/python/samples/03-workflows/agents/group_chat_workflow_as_agent.py @@ -16,7 +16,7 @@ Sample: Group Chat Orchestration What it does: -- Demonstrates the generic GroupChatBuilder with a agent orchestrator directing two agents. +- Demonstrates the generic GroupChatBuilder with an agent orchestrator directing two agents. - The orchestrator coordinates a researcher (chat completions) and a writer (responses API) to solve a task. Prerequisites: From 63060570359e28e84ac66d301b2030d5cbc815a9 Mon Sep 17 00:00:00 2001 From: Darren Cohen <39422044+dargilco@users.noreply.github.com> Date: Fri, 2 Oct 2026 12:20:02 -0700 Subject: [PATCH 04/11] Example 3 of response_stream.py, make sure we copy all properties --- python/samples/02-agents/response_stream.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/python/samples/02-agents/response_stream.py b/python/samples/02-agents/response_stream.py index 135cf9e0ce0..dd5ce43689b 100644 --- a/python/samples/02-agents/response_stream.py +++ b/python/samples/02-agents/response_stream.py @@ -2,6 +2,7 @@ import asyncio from collections.abc import AsyncIterable, Sequence +from copy import copy from agent_framework import ChatResponse, ChatResponseUpdate, Content, Message, ResponseStream @@ -234,11 +235,12 @@ def counting_transform(update: ChatResponseUpdate) -> ChatResponseUpdate: def uppercase_transform(update: ChatResponseUpdate) -> ChatResponseUpdate: """Transform that converts text to uppercase.""" - if update.text: - return ChatResponseUpdate( - contents=[Content.from_text(update.text.upper())], role=None, response_id=update.response_id - ) - return update + transformed = copy(update) + transformed.contents = [copy(content) for content in update.contents] + for content in transformed.contents: + if content.type == "text" and content.text is not None: + content.text = content.text.upper() + return transformed # Pass update transforms directly to the constructor. stream3: ResponseStream[ChatResponseUpdate, ChatResponse] = ResponseStream( From 13237a61476ac4ead971b6b5e634a12dde40ad9f Mon Sep 17 00:00:00 2001 From: Darren Cohen <39422044+dargilco@users.noreply.github.com> Date: Fri, 2 Oct 2026 12:29:06 -0700 Subject: [PATCH 05/11] Show that cleanup happens at the end --- python/samples/02-agents/response_stream.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/samples/02-agents/response_stream.py b/python/samples/02-agents/response_stream.py index dd5ce43689b..ba4af439838 100644 --- a/python/samples/02-agents/response_stream.py +++ b/python/samples/02-agents/response_stream.py @@ -275,8 +275,8 @@ async def cleanup_hook() -> None: ) print("Starting iteration (cleanup happens after):") - async for _update in stream4: - pass # Just consume the stream + async for update in stream4: + print(f" Received: '{update.text}'") print(f"Cleanup was performed: {cleanup_performed['value']}") # ========================================================================= From 79f5bc2ca91f68529ac8a98e6227f97de13a9775 Mon Sep 17 00:00:00 2001 From: Darren Cohen <39422044+dargilco@users.noreply.github.com> Date: Fri, 2 Oct 2026 12:39:24 -0700 Subject: [PATCH 06/11] Also use copy() in example 5 --- python/samples/02-agents/response_stream.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/python/samples/02-agents/response_stream.py b/python/samples/02-agents/response_stream.py index ba4af439838..64c1612ebfa 100644 --- a/python/samples/02-agents/response_stream.py +++ b/python/samples/02-agents/response_stream.py @@ -293,10 +293,9 @@ def add_metadata_transform(response: ChatResponse) -> ChatResponse: def wrap_in_quotes_transform(response: ChatResponse) -> ChatResponse: """Result transform that wraps the response text in quotes.""" if response.text: - return ChatResponse( - messages=[Message(contents=[f'"{response.text}"'], role="assistant")], - additional_properties=response.additional_properties, - ) + transformed = copy(response) + transformed.messages = [Message(contents=[f'"{response.text}"'], role="assistant")] + return transformed return response # The finalizer creates a response, then result transforms run in order. From dd29bafb39ace41f30a525e93cf6565eaf48598e Mon Sep 17 00:00:00 2001 From: Darren Cohen <39422044+dargilco@users.noreply.github.com> Date: Fri, 2 Oct 2026 12:55:56 -0700 Subject: [PATCH 07/11] Revert response stream copy examples Reverts 79f5bc2ca91f68529ac8a98e6227f97de13a9775 and 63060570359e28e84ac66d301b2030d5cbc815a9. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- python/samples/02-agents/response_stream.py | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/python/samples/02-agents/response_stream.py b/python/samples/02-agents/response_stream.py index 64c1612ebfa..fa75a7fbe30 100644 --- a/python/samples/02-agents/response_stream.py +++ b/python/samples/02-agents/response_stream.py @@ -2,7 +2,6 @@ import asyncio from collections.abc import AsyncIterable, Sequence -from copy import copy from agent_framework import ChatResponse, ChatResponseUpdate, Content, Message, ResponseStream @@ -235,12 +234,11 @@ def counting_transform(update: ChatResponseUpdate) -> ChatResponseUpdate: def uppercase_transform(update: ChatResponseUpdate) -> ChatResponseUpdate: """Transform that converts text to uppercase.""" - transformed = copy(update) - transformed.contents = [copy(content) for content in update.contents] - for content in transformed.contents: - if content.type == "text" and content.text is not None: - content.text = content.text.upper() - return transformed + if update.text: + return ChatResponseUpdate( + contents=[Content.from_text(update.text.upper())], role=None, response_id=update.response_id + ) + return update # Pass update transforms directly to the constructor. stream3: ResponseStream[ChatResponseUpdate, ChatResponse] = ResponseStream( @@ -293,9 +291,10 @@ def add_metadata_transform(response: ChatResponse) -> ChatResponse: def wrap_in_quotes_transform(response: ChatResponse) -> ChatResponse: """Result transform that wraps the response text in quotes.""" if response.text: - transformed = copy(response) - transformed.messages = [Message(contents=[f'"{response.text}"'], role="assistant")] - return transformed + return ChatResponse( + messages=[Message(contents=[f'"{response.text}"'], role="assistant")], + additional_properties=response.additional_properties, + ) return response # The finalizer creates a response, then result transforms run in order. From 40088fec8e7027189f206ce88ae9f25983376f1c Mon Sep 17 00:00:00 2001 From: Darren Cohen <39422044+dargilco@users.noreply.github.com> Date: Fri, 2 Oct 2026 13:13:05 -0700 Subject: [PATCH 08/11] Update expected output at the end of response_stream.py --- python/samples/02-agents/response_stream.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/python/samples/02-agents/response_stream.py b/python/samples/02-agents/response_stream.py index fa75a7fbe30..abf08c1ede1 100644 --- a/python/samples/02-agents/response_stream.py +++ b/python/samples/02-agents/response_stream.py @@ -486,6 +486,7 @@ def add_stats_to_response(response: ChatResponse) -> ChatResponse: # Expected output includes: # === Example 6: Gates Around Transforms === +# Released updates: # [Before gate] Saw: 'Public content. ' # -> 'Public content. ' # [Before gate] Saw: 'Internal secret.' @@ -493,6 +494,7 @@ def add_stats_to_response(response: ChatResponse) -> ChatResponse: # Final result: 'Public content. [redacted].' # # === Example 7: Buffered Final Replacement === +# The source is fully consumed and the replacement is approved before the first update is released: # [Before result gate] Original: 'Public content. Internal secret.' # -> 'Approved replacement response.' # Final replacement: 'Approved replacement response.' From 0021b1cf82a75f1c58c0acf3f21d34634b9857b5 Mon Sep 17 00:00:00 2001 From: Darren Cohen <39422044+dargilco@users.noreply.github.com> Date: Thu, 8 Oct 2026 13:11:35 -0700 Subject: [PATCH 09/11] Add spaces between Python block and text in sample --- python/samples/02-agents/response_stream.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/python/samples/02-agents/response_stream.py b/python/samples/02-agents/response_stream.py index abf08c1ede1..41eed06a7c6 100644 --- a/python/samples/02-agents/response_stream.py +++ b/python/samples/02-agents/response_stream.py @@ -98,31 +98,37 @@ === Two Consumption Patterns === **Pattern 1: Async Iteration** + ```python async for update in response_stream: print(update.text) # Process each update # Stream is now consumed; updates are stored internally ``` + - Transform hooks are called for each yielded item - Cleanup hooks are called after the last item - The stream collects all updates internally for later finalization - The stream finalizes automatically when iteration reaches the end **Pattern 2: Direct Finalization** + ```python final = await response_stream.get_final_response() ``` + - If the stream hasn't been iterated, it auto-iterates (consuming all updates) - The finalizer converts collected updates to a final response - Update and result pipelines run normally - You get the complete response without ever seeing individual updates ** Pattern 3: Combined Usage ** + ```python async for update in response_stream: print(update.text) # See each update final = await response_stream.get_final_response() # Get the aggregated result ``` + When you first iterate the stream and then call `get_final_response()`, the following occurs: - Iteration yields updates with transform hooks applied - Cleanup hooks run after iteration completes From 558c16616d4c3d3eaba8bbf71f91228350f0e7ac Mon Sep 17 00:00:00 2001 From: Darren Cohen <39422044+dargilco@users.noreply.github.com> Date: Thu, 8 Oct 2026 13:34:12 -0700 Subject: [PATCH 10/11] move comment up: --- python/samples/04-hosting/foundry-hosted-agents/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/samples/04-hosting/foundry-hosted-agents/README.md b/python/samples/04-hosting/foundry-hosted-agents/README.md index 381b0064d56..e5e14809847 100644 --- a/python/samples/04-hosting/foundry-hosted-agents/README.md +++ b/python/samples/04-hosting/foundry-hosted-agents/README.md @@ -55,11 +55,11 @@ Agent Framework `AgentSession`, but they are not interchangeable. During a hosted-agent conversation, one `AgentSession` can therefore contain both remote values: ```python -session.service_session_id # Response or conversation continuation handle +session.service_session_id -session.state[FOUNDRY_HOSTED_AGENT_SESSION_ID_KEY] # Foundry hosted-agent session ID +session.state[FOUNDRY_HOSTED_AGENT_SESSION_ID_KEY] ``` Keep the same `AgentSession` across turns so Agent Framework can forward both values correctly. When cleaning up, From 9838f9966fdd54a444f59cdc87d9297697194014 Mon Sep 17 00:00:00 2001 From: Darren Cohen <39422044+dargilco@users.noreply.github.com> Date: Thu, 8 Oct 2026 16:52:57 -0700 Subject: [PATCH 11/11] Updates to Foundry hosted agents README.md --- .../samples/04-hosting/foundry-hosted-agents/README.md | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/python/samples/04-hosting/foundry-hosted-agents/README.md b/python/samples/04-hosting/foundry-hosted-agents/README.md index e5e14809847..1c91b59bfea 100644 --- a/python/samples/04-hosting/foundry-hosted-agents/README.md +++ b/python/samples/04-hosting/foundry-hosted-agents/README.md @@ -191,11 +191,11 @@ Or in PowerShell: #### Running the Agent Host with Python -Clone the repository containing the sample code: +Clone the repository containing the sample code and change directory to the selected sample (here we use `/responses/basic`): ```bash git clone https://github.com/microsoft/agent-framework.git -cd agent-framework/python/samples/04-hosting/foundry-hosted-agents/responses +cd agent-framework/python/samples/04-hosting/foundry-hosted-agents/responses/basic ``` #### Environment setup @@ -225,7 +225,7 @@ cd agent-framework/python/samples/04-hosting/foundry-hosted-agents/responses uv pip install -r requirements.txt ``` -3. Create a `.env` file with your Foundry configuration following the `env.example` file in the sample. +3. Create a `.env` file with your Foundry configuration following the `.env.example` file in the sample. 4. Make sure you are logged in with the Azure CLI: @@ -246,6 +246,10 @@ Right now, the agent host should be running on `http://localhost:8088` On another terminal, run the following command to invoke the agent: ```bash +# Windows Command Prompt +curl.exe -X POST http://localhost:8088/responses -H "Content-Type: application/json" -d "{\"input\":\"Hello!\"}" + +# macOS/Linux curl -X POST http://localhost:8088/responses -H "Content-Type: application/json" -d '{"input": "Hello!"}' ```