Creating ASI1 LLM Compatible uAgent
This guide demonstrates how to make your agents accessible via ASI1 LLM by integrating the chat protocol. We'll use a Football Team Agent example to show how the chat protocol enables seamless communication between agents and the LLM.
Overview
In this example, you'll learn how to build a uAgent compatible with Fetch.ai's ASI1 Large Language Model (LLM). Using a Football Team Agent as an example, the guide shows how you can enable your agent to understand and respond to natural language queries.
Message Flow
The communication flow between ASI1 LLM, the Football Team Agent, and OpenAI Agent follows this sequence:
-
Query Initiation (1.1)
- ASI1 LLM sends a natural language query (e.g., "Give me the list of players in Manchester United Football Team") as a
ChatMessageto the Football Team Agent on theChatMessage handler.
- ASI1 LLM sends a natural language query (e.g., "Give me the list of players in Manchester United Football Team") as a
-
Parameter Extraction (2, 3)
- The Football Team Agent forwards the query to OpenAI Agent for parameter extraction
- OpenAI Agent processes the natural language and extracts structured parameters (e.g., team_name="Manchester United")
- The parameters are returned in a Pydantic Model format as
StructuredOutputResponseon theStructuredOutputResponse handler.
-
Team Data Processing (4, 5)
- The Football Team Agent calls the
get_team_infofunction with the extracted parameters - The function returns the team details.
- The Football Team Agent calls the
-
Football Team Agent Response (6.1)
- The Football Team Agent sends the formatted response back as a
ChatMessageto ASI1 LLM.
- The Football Team Agent sends the formatted response back as a
-
Message Acknowledgements (1.2, 6.2)
- Each message exchanged using the chat protocol is automatically acknowledged by the receiving agent using
ChatAcknowledgement.
- Each message exchanged using the chat protocol is automatically acknowledged by the receiving agent using
Here's a visual representation of the flow:

Implementation
In this example we will create an agent and its associated files on Agentverse that communicate using the chat protocol with the ASI1 LLM. Refer to the Hosted Agents section to understand the detailed steps for agent creation on Agentverse.
Create a new agent named "FootballTeamAgent" on Agentverse and create the following files:
agent.py # Main agent file
football_team.py # Football team service implementation and API integration
chat_proto.py # Chat protocol implementation for enabling text based communication
To create a new file on Agentverse:
- Click on the New File icon

- Assign a name to the File

- Directory Structure
