An Agent Framework agent with locally-defined Python tools hosted using the Responses protocol. It shows how to define custom tools with the @tool decorator and register them with the agent so the model can call them during a conversation.
The agent uses FoundryChatClient from the Agent Framework to create a Responses client from the project endpoint and model deployment. The agent supports both streaming (SSE events) and non-streaming (JSON) response modes.
See main.py for the full implementation.
The agent is hosted using the Agent Framework with the ResponsesHostServer, which provisions a REST API endpoint compatible with the OpenAI Responses protocol.
Follow the instructions in the Running the Agent Host Locally section of the README in the parent directory to run the agent host.
Depending on how you run the agent host, you can invoke the agent using
curl(Invoke-WebRequestin PowerShell) orazd. Please refer to the parent README for more details. Use this README for sample queries you can send to the agent.
Send a POST request to the server with a JSON body containing an "input" field to interact with the agent. For example:
curl -X POST http://localhost:8088/responses -H "Content-Type: application/json" -d '{"input": "What is the weather in Seattle?"}'To host the agent on Foundry, follow the instructions in the Deploying the Agent to Foundry section of the README in the parent directory.