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.
Continue a conversation session with an Agent, or add the first exchange to a session after creation.
Adds a new exchange to the session with the provided inputs, and generates a response from the Agent.
Returns a stream of the Agent response text (formatted using markdown) for clients to consume as the response is generated.
On completion of the streamed response, clients can load the full details of the exchange that was added to the session by reloading the session content.
Streamed exchanges also support cancellation; see cancel
for details.
Concurrent requests to continue the same session are not supported.
Clients should wait to receive a response, or cancel the in-progress exchange, before sending the next message.
Third-party applications using this endpoint via OAuth2 must request the following operation scope: api:aip-agents-write
.
string
An RID identifying an AIP Agent created in AIP Agent Studio.
string
The Resource Identifier (RID) of the conversation session.
object
object
The user message for the Agent to respond to.
map<ParameterId, ParameterValue>
Any supplied values for application variables to pass to the Agent for the exchange.
list<InputContext>
If set, automatic context retrieval is skipped and the list of specified context is provided to the Agent instead. If omitted, relevant context for the user message is automatically retrieved and included in the prompt, based on data sources configured on the Agent for the session.
string
A client-generated Universally Unique Identifier (UUID) to identify the message, which the client can use to cancel the exchange before the streaming response is complete.
string
The unique identifier to use for this continue session trace. By generating and passing this ID to the
streamingContinue
endpoint, clients can use this trace ID to separately load details of the trace used
to generate a result, while the result is in progress. If omitted, it will be generated automatically.
Clients can check the generated ID by inspecting the sessionTraceId
in the SessionExchangeResult
,
which can be loaded via the getContent
endpoint.
1
2
3
4
5
curl -X POST \
-H "Content-type: application/json" \
-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/streamingContinue?preview=true" \
-d '{"sessionTraceId":"12345678-1234-5678-1234-123456789abc","messageId":"00f8412a-c29d-4063-a417-8052825285a5","userInput":{"text":"What is the status of my order?"},"parameterInputs":{"currentCustomerOrders":{"type":"objectSet","ontology":"example-ontology","objectSet":{"type":"filter","objectSet":{"type":"base","objectType":"customerOrder"},"where":{"type":"eq","field":"customerId","value":"123abc"}}}}}'
Error Name | ||
---|---|---|
Object | Error Code | NOT_FOUND |
Status Code | 404 | |
Description | Some object types are configured for use by the Agent but could not be found. The object types either do not exist or the client token does not have access. Object types can be checked by listing available object types through the API, or searching in [Ontology Manager](/docs/foundry/ontology-manager/overview/). | |
Parameters | agentRid, sessionRid, objectTypeIds | |
Object | Error Code | NOT_FOUND |
Status Code | 404 | |
Description | Some object types are configured for use by the Agent but could not be found. The object types either do not exist or the client token does not have access. Object types can be checked by listing available object types through the API, or searching in [Ontology Manager](/docs/foundry/ontology-manager/overview/). | |
Parameters | agentRid, sessionRid, objectTypeRids | |
Function | Error Code | NOT_FOUND |
Status Code | 404 | |
Description | The specified function locator is configured for use by the Agent but could not be found. The function type or version may not exist or the client token does not have access. | |
Parameters | agentRid, sessionRid, functionRid, functionVersion | |
Invalid | Error Code | INVALID_ARGUMENT |
Status Code | 400 | |
Description | The provided application variable is not valid for the Agent for this session. Check the available application variables for the Agent under the `parameters` property, and version through the API with `getAgent`, or in AIP Agent Studio. The Agent version used for the session can be checked through the API with `getSession`. | |
Parameters | agentRid, sessionRid, parameter | |
Invalid | Error Code | INVALID_ARGUMENT |
Status Code | 400 | |
Description | The provided value does not match the expected type for the application variable configured on the Agent for this session. Check the available application variables for the Agent under the `parameters` property, and version through the API with `getAgent`, or in AIP Agent Studio. The Agent version used for the session can be checked through the API with `getSession`. | |
Parameters | agentRid, sessionRid, parameter, expectedType, receivedType | |
Session | Error Code | INVALID_ARGUMENT |
Status Code | 400 | |
Description | The provided trace ID already exists for the session and cannot be reused. | |
Parameters | agentRid, sessionRid, sessionTraceId | |
Ontology | Error Code | NOT_FOUND |
Status Code | 404 | |
Description | Some ontology types are configured for use by the Agent but could not be found. The types either do not exist or the client token does not have access. Object types and their link types can be checked by listing available object/link types through the API, or searching in [Ontology Manager](/docs/foundry/ontology-manager/overview/). | |
Parameters | agentRid, sessionRid, objectTypeRids, linkTypeRids | |
Streaming | Error Code | PERMISSION_DENIED |
Status Code | 403 | |
Description | Could not streamingContinue the Session. | |
Parameters | agentRid, sessionRid | |
Session | Error Code | NOT_FOUND |
Status Code | 404 | |
Description | The given Session could not be found. | |
Parameters | agentRid, sessionRid | |
Agent | Error Code | NOT_FOUND |
Status Code | 404 | |
Description | The given Agent could not be found. | |
Parameters | agentRid |
See Errors for a general overview of errors in the platform.