Initialize the Client
Start by creating aClient instance with your credentials:
Basic Conversation
Starting a New Conversation
Create a new conversation by callingrun_turn() with a list of messages:
Continuing a Conversation
To continue a conversation, pass theconversationId from the previous turn:
The SDK is stateless - you must manage conversation IDs to maintain context across turns.
Message Types
Rowboat supports multiple message types for different conversation participants:User Messages
Messages from end users:System Messages
Provide system instructions or context:Assistant Messages
Agent responses with optional metadata:Tool Messages
Results from tool executions:Using Mock Tools
Test your agent’s behavior without executing real tools by providing mock responses:Multi-Turn Conversations
Here’s a complete example of a multi-turn conversation:Conversation Management
Storing Conversation IDs
Store conversation IDs in your database to enable persistent conversations:Creating New Conversations
Create a new conversation by omitting theconversationId:
Error Handling
Handle API errors gracefully:Complete Example
Here’s a complete example bringing it all together:Best Practices
Manage Conversation State
Manage Conversation State
Store conversation IDs in a database or cache to enable persistent conversations across sessions.
Handle Errors Gracefully
Handle Errors Gracefully
Always wrap API calls in try-except blocks to handle network errors and API failures.
Secure Your API Keys
Secure Your API Keys
Never hardcode API keys. Use environment variables or secure key management systems.
Use Mock Tools for Testing
Use Mock Tools for Testing
Test your agent logic using mock tools before deploying with real tool integrations.
Implement Rate Limiting
Implement Rate Limiting
Add rate limiting to prevent excessive API calls and protect your quota.