Skip to content

Create Agents

Create agent

To create an agent using Blipper, you can use the create_agent() method provided by the Blipper client instance. This method allows you to register a new agent with the Blipper service.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
from blipper import Blipper

# Create an instance of the Blipper client using blipper api key which allows us to authenticate our requests to the Blipper service
blip_obj = Blipper(blipper_api_key="lqqRYOOnSerIOP973hjskR", model="galileo", verbose=False)

# Create an agent using the create_agent() method
# We provide a name and a description to identify it
# Store the ID of the newly created agent in the agent_id variable
agent_id: str = blip_obj.create_agent(
    name="My Agent",
    description="A helpful agent",
    task="Answer user's questions."
)

In the above code, "my_blipper_api_key" should be replaced with your actual Blipper API Key. Additionally, within the create_agent() method call, we provide a name and a description to uniquely identify the agent we are creating. These details are crucial for managing and understanding the role of the agent within Blipper.

Upon successfully executing this code, we will obtain the ID of the newly created agent stored in the agent_id variable. This ID allows us to perform further actions and configurations regarding this particular agent within Blipper.

Example

If you're looking to create an agent related for your business needs, you can follow the example below. In this instance, we'll demonstrate how to create a Food Agent using Blipper.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
from blipper import Blipper

blip_obj = Blipper(blipper_api_key="lqqRYOOnSerIOP973hjskR", model="galileo", verbose=False)

agent_id = blip_obj.create_agent(
    name="Food Agent",
    description="An agent specialized in food-related queries, \
        perfect for restaurants, cafes, and food businesses.",
    task="Answer user's questions related to your food business."    
)

print("Food Agent created successfully!")
print("Agent ID:", agent_id)

Note

You can enhance the capabilities of your Food Agent by adding relevant documents later on. These documents will enable the agent to respond to user queries more accurately, providing tailored assistance that aligns with the nature of your business. You can see more detailes in: Please see the Add file to agent section.