Documentation
Client
Overview
The client module provides a thin ACP client that can be integrated into any application that needs to communicate with ACP agents. It provides the following advantages over raw HTTP client:
- Strong typing
- Error handling
- Stream decoding
- Session management
- Instrumentation
Location within the sdk: client
Usage
The client is based on the httpx.AsyncClient. The usage is very similar as demonstrated below.
Setting up a client
To set up a simple client, simply provide an URL:
To use advanced HTTP configuration, provide httpx
async client:
Performing discovery
To discover available agents:
Running an agent
Agent run can be invoked in three modes:
Using sessions
Sessions are a mechanism to have multi-turn conversations with agents.
To enter a session, create one from the client: