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.2.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.2.0-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: rowboat-0.2.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.2.0.tar.gz
Algorithm Hash digest
SHA256 40e140157f263ea1a50fc2552b5fa80d94f55518fb6d89c46d092d335950a3dc
MD5 61f5fe15dc324bca69da5040bcc6227e
BLAKE2b-256 26e8154936ce677c2f3fe8d390337c03a79b3e713050f4f247f97ff354208532

See more details on using hashes here.

File details

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

File metadata

  • Download URL: rowboat-0.2.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.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 92c1143c9bcf2a409a87fe210752544add2f6b68a974c447a3ec4f79fb62a26c
MD5 b11dd850e6f6202f036e7b4f6f693ddf
BLAKE2b-256 e5f85fac0f766d2cb51c6c711b9f970db4d7a6cf24867394295177c5310b825b

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