Skip to main content
This code integrates an asynchronous OpenAI client with a LiteralAI client to create a conversational agent. It utilizes LiteralAI’s step decorators for structured logging and tool orchestration within a conversational flow. The agent can process user messages, make decisions on tool usage, and generate responses based on a predefined set of tools and a maximum iteration limit to prevent infinite loops. This example demonstrates thread-based monitoring, allowing for detailed tracking and analysis of conversational threads.
.env
Then, you can send requests from a client:
client.py