Overview
TheLLMClient lets you connect to the ATP Agent Server, retrieve toolkit context, and execute tools or workflows using JSON payloads—perfect for LLM-based agents.
It supports:
- OpenAI (GPT-4, GPT-3.5, etc.)
- Anthropic (Claude 3 Opus, Sonnet, Haiku)
- Mistral AI (Mistral Large, Medium, Small)
Constructor
Parameters
string
required
Your ATP API key. Get it from the ChatATP Developer Platform.
string
default:"ws"
Protocol to use (“ws” for WebSocket or “http” for HTTP).
string
default:"https://api.chat-atp.com/ws/v1/atp/llm-client/"
ATP server URL. Use the default unless you’re running a custom ATP server.
Methods
get_toolkit_context
Retrieves the toolkit context and system instructions for a given toolkit and user prompt.Parameters
string
required
Unique ID of the toolkit you want to use.
string
required
The LLM provider:
"openai", "anthropic", or "mistralai".string
required
The user’s prompt or task description.
Returns
A dictionary containing the toolkit context, including provider-specific tool schemas. Example response:call_tool
Executes a tool or workflow on the ATP server.Parameters
string
required
Unique ID of the toolkit.
string | dict
required
JSON payload from an LLM containing the tool call. Can be a string or dict.Example:
string
required
The LLM provider:
"openai", "anthropic", or "mistralai".string
required
Additional user input to include in the execution.
Returns
The result of the tool execution. Example response:OAuth2 Methods
initiate_oauth_connection
Starts the OAuth flow and returns an authorization URL for the user.Parameters
string
required
The platform ID (e.g., “hubspot”, “google”, “salesforce”).
string
required
Your user’s unique identifier (e.g., email address).
string
required
The URL to redirect the user to after OAuth authorization.
Returns
wait_for_connection
Polls for OAuth connection completion and retrieves the integration ID.Parameters
string
required
The platform ID (e.g., “hubspot”, “google”, “salesforce”).
string
required
Your user’s unique identifier (e.g., email address).
Returns
get_user_tokens
Fetches the user’s access and refresh tokens for use in tool calls.Parameters
string
required
The platform ID (e.g., “hubspot”, “google”, “salesforce”).
string
required
Your user’s unique identifier (e.g., email address).
Returns
Integration Examples
OpenAI
Anthropic
Mistral AI
OAuth2 Flow Example
The ATP SDK will automatically inject tokens into tool calls as needed. You only need to handle OAuth and fetch tokens once.
Next Steps
ToolKitClient
Learn how to register and serve tools
OAuth2 Guide
Set up OAuth2 authentication
Examples
Explore more examples
Framework Integration
Use ATP with Django, FastAPI, or Flask