Skip to main content

Initialize the Client

Start by creating a Client instance with your credentials:

Basic Conversation

Starting a New Conversation

Create a new conversation by calling run_turn() with a list of messages:

Continuing a Conversation

To continue a conversation, pass the conversationId 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:
Mock tools are perfect for:
  • Testing agent logic without external dependencies
  • Simulating specific tool responses
  • Development and debugging

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 the conversationId:

Error Handling

Handle API errors gracefully:

Complete Example

Here’s a complete example bringing it all together:

Best Practices

Store conversation IDs in a database or cache to enable persistent conversations across sessions.
Always wrap API calls in try-except blocks to handle network errors and API failures.
Never hardcode API keys. Use environment variables or secure key management systems.
Test your agent logic using mock tools before deploying with real tool integrations.
Add rate limiting to prevent excessive API calls and protect your quota.

Next Steps

API Reference

Explore the complete API documentation