Metadata-Version: 2.4
Name: rowboat
Version: 5.0.1
Summary: Python sdk for the Rowboat API
Project-URL: Homepage, https://github.com/rowboatlabs/rowboat/tree/main/apps/python-sdk
Project-URL: Bug Tracker, https://github.com/rowboatlabs/rowboat/issues
Author-email: Ramnique Singh <ramnique@rowboatlabs.com>
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.7
Requires-Dist: pydantic>=2.0.0
Requires-Dist: requests>=2.25.0
Description-Content-Type: text/markdown

# 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

### Basic Usage

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.

```python
from rowboat.client import Client
from rowboat.schema import UserMessage

# Initialize the client
client = Client(
    host="<HOST>",
    projectId="<PROJECT_ID>",
    apiKey="<API_KEY>"
)

# Start a new conversation
result = client.run_turn(
    messages=[
        UserMessage(role='user', content="list my github repos")
    ]
)
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
)
print(result.turn.output[-1].content)
```

### Using Tool Overrides (Mock Tools)

You can provide tool override instructions to test a specific configuration using the `mockTools` argument:

```python
result = client.run_turn(
    messages=[
        UserMessage(role='user', content="What's the weather?")
    ],
    mockTools={
        "weather_lookup": "The weather in any city is sunny and 25°C.",
        "calculator": "The result of any calculation is 42."
    }
)
print(result.turn.output[-1].content)
```

### Message Types

You can use different message types as defined in `rowboat.schema`, such as `UserMessage`, `SystemMessage`, etc. See `schema.py` for all available message types.

### Error Handling

If the API returns a non-200 status code, a `ValueError` will be raised with the error details.

---

For more advanced usage, see the docstrings in `client.py` and the message schemas in `schema.py`.
