Agents
Messaging agents
Interact with agents via messages
Sending messages
You can send message to agents from both the REST API and Python client:
You can also send messages with different roles, such as system
, assistant
, or user
:
The response
object contains the following attributes:
usage
: The usage of the agent after the message was sent (the prompt tokens, completition tokens, and total tokens)message
: A list of eitherMessage
orLettaMessage
objects, generated by the agent
Message Types
LettaMessage
The LettaMessage
object is a simplified version of the Message
object. Since a Message
can include multiple events like an inner monologue and function return, LettaMessage
simplifies messages to have the following types:
inner_monologue
: The inner monologue of the agentfunction_call
: An agent function callfunction_response
: The response to an agent function callsystem_message
: A system messageuser_message
: A user message
Message
The Message
object is the raw MemGPT message representation that is persisted in the database. To have the full Message
data returns, you can set include_full_message=True
:
You can convert a raw Message
object to a list of LettaMessage
objects: