Anthropic Integration
from reacter_openapitools import AnthropicAdapter
from anthropic import Anthropic
# Initialize the AI client
client = Anthropic(api_key="your-anthropic-api-key")
# Initialize the adapter
adapter = AnthropicAdapter(api_key="your OpenAPI Tools Apikey - https://openapitools.com/dashboard/settings")
# Create a chatbot with tools
chatbot = adapter.create_anthropic_chatbot(
anthropic_client=client,
llm_config={
"model": "claude-3-7-sonnet-20250219",
"temperature": 0.7,
"system": "You are a helpful assistant with access to tools."
},
options={ # Optional
"tool_names": ["generate-otp", {"name": "get-orders", "version": "prod"}],
}
)
# Use the chatbot
response = chatbot["invoke"]("Can you generate an OTP for my number?")
print(response["text"])
Note
The llm_config
parameters correspond to the underlying LLM API you’re using. For detailed parameter information, check:
- Anthropic: Messages API Reference
🚫
Important
Streaming responses are not currently supported in agents. Check tool_usage to implement streaming.
Last updated on