Skip to main content

Python sdk for the Rowboat API

Project description

Rowboat Python SDK

A Python SDK for interacting with the Rowboat API.

Installation

You can install the package using pip:

pip install rowboat

Usage

Basic Usage

Initialize a client and create a chat session:

from rowboat import Client, StatefulChat

# Initialize the client
client = Client(
    host="<HOST>",
    project_id="<PROJECT_ID>",
    project_secret="<PROJECT_SECRET>"
)

# Create a chat session
chat = StatefulChat(client)

# Send a message and get a response
response = chat.run("Hello, how are you?")
print(response)

Using Tools

The SDK supports function calling through tools. Here's how to use them:

def weather_lookup(city_name: str) -> str:
    # Implement your weather lookup logic here
    return f"The weather in {city_name} is 22°C."

# Create a tools dictionary
tools = {
    'weather_lookup': weather_lookup
}

# Initialize chat with tools
chat = StatefulChat(client, tools=tools)

# The AI can now use the weather tool
response = chat.run("What's the weather in London?")
print(response)

System Prompts

You can initialize the chat with a system prompt to guide the AI's behavior:

chat = StatefulChat(
    client,
    tools=tools,
    system_prompt="You are a helpful assistant who specializes in weather information."
)

API Reference

Client

The Client class handles communication with the Rowboat API.

Client(host: str, project_id: str, project_secret: str)

StatefulChat

The StatefulChat class maintains conversation state across multiple turns.

StatefulChat(
    client: Client,
    tools: Optional[Dict[str, Callable[..., str]]] = None,
    system_prompt: Optional[str] = None
)

License

[Add your license information here]

Contributing

[Add contribution guidelines here]

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rowboat-0.1.0.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rowboat-0.1.0-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

Details for the file rowboat-0.1.0.tar.gz.

File metadata

  • Download URL: rowboat-0.1.0.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.2

File hashes

Hashes for rowboat-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c1298aa46aeafeae3b5d807b2ddaa7c33957602128c5731504b3bbe6f6b580e9
MD5 85c89e4fea8227c11bcba681a66415d7
BLAKE2b-256 0717b2b501ac5b66ffd499823e291a68883d0481723724c199a07ce1f73eefd2

See more details on using hashes here.

File details

Details for the file rowboat-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: rowboat-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.2

File hashes

Hashes for rowboat-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1c4fb5caa213793ab59ab2cce9c78d98a2664b9e8a266ed34fb0486046568097
MD5 39f04ddd7d0e207ff3c218919a5ceeac
BLAKE2b-256 1acd38495ad7b0c676cdfb1df0541b4a6647bbcb7443cdc1b26bbd23ff21cc88

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page