Documentation Index
Fetch the complete documentation index at: https://docs.conversimple.com/llms.txt
Use this file to discover all available pages before exploring further.
Installation
Install the Conversimple SDK using pip:
pip install conversimple-sdk
Basic Usage
Here is a basic example of a Conversimple agent that can get the current weather:
import asyncio
from conversimple import ConversimpleAgent, tool
class MyAgent(ConversimpleAgent):
@tool("Get current weather for a location")
def get_weather(self, location: str) -> dict:
return {"location": location, "temperature": 72, "condition": "sunny"}
def on_conversation_started(self, conversation_id: str):
print(f"Conversation started: {conversation_id}")
async def main():
agent = MyAgent(
api_key="your-api-key",
customer_id="your-customer-id"
)
await agent.start()
# Keep running
while True:
await asyncio.sleep(1)
if __name__ == "__main__":
asyncio.run(main())
Running the Agent
-
Save the code above as
my_agent.py.
-
Set your API key and customer ID as environment variables:
export CONVERSIMPLE_API_KEY="your-api-key"
export CONVERSIMPLE_CUSTOMER_ID="your-customer-id"
-
Run the agent:
Your agent is now running and connected to the Conversimple platform. You can now start a conversation and test your get_weather tool.