mirror of
https://github.com/rowboatlabs/rowboat.git
synced 2026-06-06 19:35:44 +02:00
commit
111c110af8
2 changed files with 16 additions and 15 deletions
21
README.md
21
README.md
|
|
@ -67,7 +67,8 @@ There are 2 ways to integrate with the agents you create in Rowboat
|
|||
"role": "user",
|
||||
"content": "tell me the weather in london in metric units"
|
||||
}
|
||||
]
|
||||
],
|
||||
"state": null
|
||||
}'
|
||||
```
|
||||
|
||||
|
|
@ -76,7 +77,7 @@ There are 2 ways to integrate with the agents you create in Rowboat
|
|||
- You can use the included Python SDK to interact with the Agents
|
||||
- See [SDK Docs](https://docs.rowboatlabs.com/using_the_sdk/) for details
|
||||
```python
|
||||
from rowboat import Client
|
||||
from rowboat import Client, StatefulChat
|
||||
from rowboat.schema import UserMessage, SystemMessage
|
||||
|
||||
# Initialize the client
|
||||
|
|
@ -86,20 +87,20 @@ There are 2 ways to integrate with the agents you create in Rowboat
|
|||
api_key="<API_KEY>"
|
||||
)
|
||||
|
||||
# Create messages
|
||||
# Create a stateful chat session (recommended)
|
||||
chat = StatefulChat(client)
|
||||
response = chat.run("What's the weather in London?")
|
||||
print(response)
|
||||
|
||||
# Or use the low-level client API
|
||||
messages = [
|
||||
SystemMessage(role='system', content="You are a helpful assistant"),
|
||||
UserMessage(role='user', content="Hello, how are you?")
|
||||
]
|
||||
|
||||
# Get response
|
||||
response_messages, state = client.chat(messages=messages)
|
||||
print(response_messages[-1].content)
|
||||
|
||||
# For subsequent messages, include previous messages and state
|
||||
messages.extend(response_messages)
|
||||
messages.append(UserMessage(role='user', content="What's your name?"))
|
||||
response_messages, state = client.chat(messages=messages, state=state)
|
||||
response = client.chat(messages=messages)
|
||||
print(response.messages[-1].content)
|
||||
```
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -11,11 +11,11 @@ services:
|
|||
- OPENAI_API_KEY=${OPENAI_API_KEY}
|
||||
- MONGODB_CONNECTION_STRING=mongodb://mongo:27017/rowboat
|
||||
- USE_AUTH=${USE_AUTH}
|
||||
- AUTH0_SECRET=${AUTH0_SECRET}
|
||||
- AUTH0_BASE_URL=${AUTH0_BASE_URL}
|
||||
- AUTH0_ISSUER_BASE_URL=${AUTH0_ISSUER_BASE_URL}
|
||||
- AUTH0_CLIENT_ID=${AUTH0_CLIENT_ID}
|
||||
- AUTH0_CLIENT_SECRET=${AUTH0_CLIENT_SECRET}
|
||||
- AUTH0_SECRET="test"
|
||||
- AUTH0_BASE_URL="http://localhost:3000"
|
||||
- AUTH0_ISSUER_BASE_URL="http://localhost:3000"
|
||||
- AUTH0_CLIENT_ID="test"
|
||||
- AUTH0_CLIENT_SECRET="test"
|
||||
- AGENTS_API_URL=http://rowboat_agents:3001
|
||||
- AGENTS_API_KEY=${AGENTS_API_KEY}
|
||||
- COPILOT_API_URL=http://copilot:3002
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue