Agents
This page assumes you are already familiar with how get hold of an api_key and org_id and how to install the Engage Smarter Python library. If not, turn to the Getting Started tutorial.
The Engage Smarter AI Platform makes different AI financial guidance experts - or Agents - available via its API. Any agent can be selected and used with either the Conversations or Runs API endpoints.
Here we explore the Agents API, discussing:
- How to view which agents are currently available
- How agents are versioned in the API
Pre-requisites
First, we initialise the Engage Smarter Python Client.
import os
from engagesmarter import Client
api_key = os.getenv("ENGAGE_SMARTER_API_KEY")
org_id = os.getenv("ENGAGE_SMARTER_ORG_ID")
client = Client(
api_key=api_key,
org_id=org_id,
)
Viewing available agents
Once the Client is initialised, we can use it to make API requests. To list the agents currently available, use the list method on the Agents (agents) API resource, as follows:
agents = client.agents.list()
Each entry contains:
- the
nameof the agent, which is the parameter to use for thenameargument in both conversations and runs. - the
titleof the agent, which is a more human-readable version of the name. - the
descriptionof the agent, which is a short description of the agent's capabilities. - a
welcome_message, which is an optional greeting to use when integrating the agent into larger systems.
For instance, we can see the first agent in the list returned below.
print(agents[0])
Agent versioning
All agents are versioned using a date-based versioning scheme. For a given type of agent - for instance, the pensions-questions-* agent - there are at least two versions available:
- Latest version. This uses the suffix
latestto signal that it is the most up-to-date version of the agent. - Date-stamped version. This is the agent as of a particular date. The date is encoded in the suffix, using the format
YYMMDD. For instance,pensions-questions-240214would be the agent as of 14 February 2024.