Examples
Examples of using the Agentuity Python SDK
Basic Agent
A simple agent that returns a greeting.
Key-Value Storage
An agent that uses key-value storage to store and retrieve user preferences.
Welcome Function Example
This example demonstrates how to customize the initial appearance of DevMode when it starts interacting with your agents:
Real-World Example
Here's a more comprehensive example inspired by the React Miami 2025 Concierge template:
Vector Storage
An agent that uses vector storage for semantic search.
Agent Communication
An agent that demonstrates communication between agents.
Streaming Responses from OpenAI
This example demonstrates how to stream a response from OpenAI using the Agentuity Python SDK:
This example:
- Imports the necessary libraries from OpenAI and Agentuity
- Creates an OpenAI client
- Defines an async
run
function that:- Creates a chat completion with streaming enabled
- Uses the user's input text or defaults to "Why is the sky blue?"
- Returns a streamed response using Agentuity's
response.stream()
method - Uses a lambda function to extract the content from each chunk of the stream
The response.stream()
method handles the complexity of streaming the response back to the user, making it easy to implement streaming in your agents.
Need Help?
Join our Community for assistance or just to hang with other humans building agents.
Send us an email at hi@agentuity.com if you'd like to get in touch.
Please Follow us on
If you haven't already, please Signup for your free account now and start building your first agent!