Client
The main interface for interacting with the Rowboat API.Constructor
Create a new client instance:Parameters
string
required
The Rowboat API host URL (e.g.,
https://api.rowboat.dev)string
required
Your Rowboat project ID from the dashboard
string
required
Your Rowboat API key for authentication
Methods
run_turn()
Execute a single conversation turn with the agent.Parameters
List[ApiMessage]
required
List of messages to send to the agent. Must include at least one message.Supported message types:
UserMessageSystemMessageAssistantMessageAssistantMessageWithToolCallsToolMessage
string
The conversation ID from a previous turn. Omit to start a new conversation.Used to maintain context across multiple turns in a conversation.
Dict[str, str]
Dictionary mapping tool names to mock responses.Use this to test agent behavior without executing real tools:
Returns
object
The API response containing the conversation ID and turn output.
string
The conversation ID. Use this for subsequent turns to maintain context.
Raises
ValueError: Raised when the API returns a non-200 status code
Example
Message Types
All message types are imported fromrowboat.schema.
UserMessage
Represents a message from the end user.Fields
Literal['user']
required
Must be
'user'string
required
The message content from the user
SystemMessage
Provides system instructions or context to the agent.Fields
Literal['system']
required
Must be
'system'string
required
The system instruction or context
AssistantMessage
Represents a response from the agent.Fields
Literal['assistant']
required
Must be
'assistant'string
required
The assistant’s response message
Literal['internal', 'external']
required
The type of response:
'internal': Internal agent reasoning (not shown to user)'external': User-facing response
string
Optional name identifier for the agent
AssistantMessageWithToolCalls
Represents an assistant message that includes tool calls.Fields
Literal['assistant']
required
Must be
'assistant'string
Optional message content
List[ToolCall]
required
List of tool calls made by the assistant
string
Optional name identifier for the agent
ToolMessage
Represents the result of a tool execution.Fields
Literal['tool']
required
Must be
'tool'string
required
The tool execution result (typically JSON string)
string
required
The ID of the tool call this message responds to
string
required
The name of the tool that was executed
Type Definitions
ToolCall
Represents a request to execute a tool.Fields
string
required
Unique identifier for this tool call
Literal['function']
required
Must be
'function'FunctionCall
required
The function call details
FunctionCall
Contains details about a function to be called.Fields
string
required
The name of the function to call
string
required
JSON string containing the function arguments
Turn
Represents a single conversation turn.Fields
string
required
Unique identifier for this turn
List[ApiMessage]
required
List of messages generated during this turn
ApiRequest
The request payload sent to the API.Fields
string
Optional conversation ID to continue an existing conversation
List[ApiMessage]
required
List of messages to send
Dict[str, str]
Optional mock tool responses for testing
ApiResponse
The response received from the API.Fields
string
required
The conversation ID (use for subsequent turns)
Turn
required
The turn data containing the agent’s response
Complete Example
Here’s a comprehensive example using the full API:Error Handling
The SDK raisesValueError when the API returns an error:
- 401 Unauthorized: Invalid API key
- 404 Not Found: Invalid project ID or endpoint
- 429 Too Many Requests: Rate limit exceeded
- 500 Internal Server Error: Server-side error