Basic example
Creating your first assistant is straightforward. You start by configuring the Language Model (LLM) you want to use, then you create your agent and connect the language model to that agent.
Step by step guide
- Start by configuring a Language Model, in the example below we will configure
OpenAI
.
Note that you usually only need to create the llm
object once and re-use it for subsequent agents you create.
- Create an Assistant.
- Attach the LLM to the Assistant and invoke it.
By seperating the creation of each object you can reuse, LLMs, Agents or any other object such as Tools and Datasources multiple times without having to re-create them.
Full code
In just a couple of lines of code we have created a production-ready chat Assistant using one of the GPT models. Check out the other examples on how to add datasources and tools to your Assistants.
Replit template
We’ve created a Replit template for this which you can run here.