Search documentation
karat

+

K

User Documentation ↗

Get Content

GET/api/v2/aipAgents/agents/{agentRid}/sessions/{sessionRid}/content
Warning

This endpoint is in preview and may be modified or removed at any time. To use this endpoint, add preview=true to the request query parameters.

Get the conversation content for a session between the calling user and an Agent.

Third-party applications using this endpoint via OAuth2 must request the following operation scope: api:aip-agents-read.

Path parameters

agentRid
string

An RID identifying an AIP Agent created in AIP Agent Studio.

sessionRid
string

The Resource Identifier (RID) of the conversation session.

Query parameters

preview
boolean
optional

Enables the use of preview functionality.

Response body

Content
object
Hide child attributes

Hide child attributes

exchanges
list<SessionExchange>
optional

The conversation history for the session, represented as a list of exchanges. Each exchange represents an initiating message from the user and the Agent's response. Exchanges are returned in chronological order, starting with the first exchange.

Show child attributes

Show child attributes

SessionExchange
object

Represents an individual exchange between a user and an Agent in a conversation session.

Show child attributes

Show child attributes

userInput
object

The user message that initiated the exchange.

Show child attributes

Show child attributes

text
string

The user message text.

contexts
object
optional

Additional retrieved context that was included in the prompt to the Agent. This may include context that was passed by the client with the user input, or relevant context that was automatically retrieved and added based on available data sources configured on the Agent. Empty if no additional context was included in the prompt.

Show child attributes

Show child attributes

objectContexts
list<ObjectContext>
optional

Relevant object context for the user's message that was included in the prompt to the Agent.

Show child attributes

Show child attributes

ObjectContext
object

Details of relevant retrieved object instances for a user's message to include as additional context in the prompt to the Agent.

Show child attributes

Show child attributes

objectRids
list<ObjectRid>
optional

The RIDs of the relevant object instances to include in the prompt.

Show child attributes

Show child attributes

ObjectRid
string

The Resource Identifier (RID) for an ontology object instance.

propertyTypeRids
list<PropertyTypeRid>
optional

The RIDs of the property types for the given objects to include in the prompt.

Show child attributes

Show child attributes

PropertyTypeRid
string

The RID for a property type from an ontology object.

result
object

The final result for the exchange.

Show child attributes

Show child attributes

agentMarkdownResponse
string

The final text response generated by the Agent. Responses are formatted using markdown.

parameterUpdates
map<ParameterId, ParameterValueUpdate>
optional

Any updates to parameters which were generated by the Agent for this exchange. Updates can only be generated for parameter values that were provided as input to the Agent and that are configured with READ_WRITE access on the Agent in AIP Agent Studio.

Show child attributes

Show child attributes

ParameterId
string

The unique identifier for a parameter, as configured in AIP Agent Studio.

ParameterValueUpdate
union

A value update for a parameter which was generated by the Agent. For StringParameter parameter types, this will be the updated string value. For ObjectSetParameter parameter types, this will be a Resource Identifier (RID) for the updated object set.

Show child attributes

Show child attributes

string
object
optional

A value passed for StringParameter parameter types.

Show child attributes

Show child attributes

value
string
objectSet
object
optional
Show child attributes

Show child attributes

value
string

The Resource Identifier (RID) for an object set.

totalTokensUsed
integer
optional

Total tokens used to compute the result. Omitted if token usage information is not supported by the model used for the session.

interruptedOutput
boolean

True if the exchange was canceled. In that case, the response (if any) was provided by the client as part of the cancellation request rather than by the Agent.

Examples

Request

Copied!
1 2 3 curl \ -H "Authorization: Bearer $TOKEN" \ "https://$HOSTNAME/api/v2/aipAgents/agents/ri.aip-agents..agent.732cd5b4-7ca7-4219-aabb-6e976faf63b1/sessions/ri.aip-agents..session.292db3b2-b653-4de6-971c-7e97a7b881d6/content?preview=true"

Response

Copied!
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 { "exchanges": [ { "result": { "totalTokensUsed": 6448, "agentMarkdownResponse": "The status of your order is **In Transit**.", "interruptedOutput": false }, "userInput": { "text": "What is the status of my order?" }, "contexts": { "objectContexts": [ { "objectRids": [ "ri.phonograph2-objects.main.object.48668bf6-8878-48d2-b8f8-f0017593feb5" ], "propertyTypeRids": [ "ri.ontology.main.property.7899aeb4-a389-4f2e-a0fd-e7193a4f6cb1" ] } ] } } ] }