Installation
Add the SDK to yourCargo.toml
:
Quick Start
Basic Usage
With Specific Address
Authentication
The SDK automatically uses configuration from the environment or database:Response Handling
Standard Response
Streaming Response
Error Handling
The SDK provides comprehensive error handling:Common Error Types
Error | Description |
---|---|
Authentication | Invalid or missing API key |
Validation | Invalid input data |
Connection | Network-related errors |
Server | Server-side errors |
Database | Local database errors |
Configuration Options
Framework Examples
LangChain Integration
AutoGen Integration
CrewAI Integration
Best Practices
- Reuse client instances for multiple requests
- Handle errors appropriately for production use
- Use streaming for long responses
- Configure timeouts based on agent complexity
- Use structured logging for debugging