Overview

In this example, we will observe how to easily complete a Task that requires the use of tools with Upsonic agents.

Tools are truly the best method for connecting agents to the real world.

Agent with tools

This agent will read and fetch the latest OpenAI developments from the internet.

agent_with_tools.py
from upsonic import Agent, Task
from upsonic.client.tools import Search # Importing Search Tool

task = Task(
  "Find the latest OpenAI developments on the internet.", 
  tools=[Search] # Adding Search tool to the Task
)

agent = Agent("Reporter")

agent.print_do(task)

To run the agent, install dependencies and export your OPENAI_API_KEY.

1

Setup your virtual environment

2

Install dependencies

3

Put your OpenAI key

4

Run the agent to do the task

python agent_with_tools.py