2025-01-15 17:44:32 +05:30
# Rowboat Python SDK
A Python SDK for interacting with the Rowboat API.
## Installation
You can install the package using pip:
```bash
pip install rowboat
```
## Usage
2025-08-19 13:35:05 +05:30
### Basic Usage
2025-01-15 17:44:32 +05:30
2025-08-19 13:35:05 +05:30
The main way to interact with Rowboat is using the `Client` class, which provides a stateless chat API. You can manage conversation state using the `conversationId` returned in each response.
2025-01-15 17:44:32 +05:30
```python
2025-08-19 13:35:05 +05:30
from rowboat.client import Client
from rowboat.schema import UserMessage
2025-01-15 17:44:32 +05:30
# Initialize the client
client = Client(
host="< HOST > ",
2025-08-19 13:35:05 +05:30
projectId="< PROJECT_ID > ",
apiKey="< API_KEY > "
2025-01-15 17:44:32 +05:30
)
2025-08-19 13:35:05 +05:30
# Start a new conversation
result = client.run_turn(
messages=[
UserMessage(role='user', content="list my github repos")
]
2025-02-14 23:30:02 +05:30
)
2025-08-19 13:35:05 +05:30
print(result.turn.output[-1].content)
print("Conversation ID:", result.conversationId)
# Continue the conversation by passing the conversationId
result = client.run_turn(
messages=[
UserMessage(role='user', content="how many did you find?")
],
conversationId=result.conversationId
2025-02-28 17:45:54 +05:30
)
2025-08-19 13:35:05 +05:30
print(result.turn.output[-1].content)
2025-02-28 17:45:54 +05:30
```
2025-08-19 13:35:05 +05:30
### Using Tool Overrides (Mock Tools)
2025-07-16 16:35:03 +05:30
2025-08-19 13:35:05 +05:30
You can provide tool override instructions to test a specific configuration using the `mockTools` argument:
2025-07-16 16:35:03 +05:30
```python
2025-08-19 13:35:05 +05:30
result = client.run_turn(
messages=[
UserMessage(role='user', content="What's the weather?")
],
mockTools={
2025-07-16 16:35:03 +05:30
"weather_lookup": "The weather in any city is sunny and 25°C.",
2025-08-19 13:35:05 +05:30
"calculator": "The result of any calculation is 42."
2025-07-16 16:35:03 +05:30
}
)
2025-08-19 13:35:05 +05:30
print(result.turn.output[-1].content)
2025-07-16 16:35:03 +05:30
```
2025-08-19 13:35:05 +05:30
### Message Types
2025-04-10 00:24:47 +05:30
2025-08-19 13:35:05 +05:30
You can use different message types as defined in `rowboat.schema` , such as `UserMessage` , `SystemMessage` , etc. See `schema.py` for all available message types.
2025-02-14 23:30:02 +05:30
2025-08-19 13:35:05 +05:30
### Error Handling
2025-04-10 00:24:47 +05:30
2025-08-19 13:35:05 +05:30
If the API returns a non-200 status code, a `ValueError` will be raised with the error details.
2025-02-14 23:30:02 +05:30
2025-08-19 13:35:05 +05:30
---
2025-04-10 00:24:47 +05:30
2025-08-19 13:35:05 +05:30
For more advanced usage, see the docstrings in `client.py` and the message schemas in `schema.py` .