Initiates a streaming conversation with an AI agent.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
stream:ChatAiAgent |
none |
*All Resource
|
None | None |
Request syntax
POST /advisor/v2/namespaces/{namespace}/ai-agent/stream/agent/v2/chat HTTP/1.1
Path Parameters
|
Parameter |
Type |
Required |
Description |
Example |
| namespace |
string |
Yes |
The project name. |
test-flink-bigdata-default |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| workspace |
string |
Yes |
The workspace ID. |
710d6a64d8**** |
| body |
object |
No |
The resource specification. |
|
| userMessage |
string |
No |
The natural language input from the user (1 to 64000 characters). |
“” |
| sessionId |
string |
No |
The session ID. If not provided, it is generated by the server. The same value must be passed for multi-turn conversations. |
019F8CC7-EAD3-5E06-B0BF-3A2A0638B3DD-deliverData-20260723102220-VM8X0A5VZQ |
| refs |
object |
No |
The resource references, including the job and skill lists. |
|
| jobs |
array<object> |
No |
The list of job references. |
|
|
object |
No |
The task ID. |
||
| deploymentId |
string |
No |
Deployment ID |
2a63abb7-7ae7-4902-9970-fe5cff4bd7c1 |
| jobId |
string |
No |
Job ID |
ccb853c3-1d5a-438d-bf98-346815ad875a |
| skills |
array |
No |
The list of skills to inject. |
|
|
string |
No |
The skill. |
[] |
|
| hitlDecisions |
array<object> |
No |
The list of human-in-the-loop (HITL) approval decisions, used to resume sessions interrupted by hitlPending. |
|
|
object |
No |
|||
| hitlId |
string |
No |
The ID of the approval item corresponding to the hitlPending event. |
- |
| decision |
string |
No |
The approval decision: approve or deny. Valid values:
|
approve |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| event |
string |
The event type. |
- |
| sessionId |
string |
The ID of the current session. |
462E2707-590E-51B6-9940-0AB33044828B-deliverData-202603020950-WCSN4MEC8T |
| text |
string |
The text output from the assistant. |
- |
| completed |
boolean |
Indicates whether the text segment is completed (the last segment of its message). |
true |
| toolName |
string |
The name of the tool function. |
"get_job_events" |
| toolCallId |
string |
The tool calling ID, used to pair the invoke and result. |
"c1" |
| displayName |
string |
The localized display name of the tool. |
"" |
| input |
any |
The key-value pairs of the tool input parameters. The structure varies based on toolName. |
{ "namespace": "vvp-dev-team", "jobId": "aa91ec66-...", "deploymentId": "b78aae4c-..." } |
| success |
string |
Indicates whether the tool calling invoke is successful. |
true |
| errorType |
string |
The error type on failure (only when success is false). |
TIMEOUT |
| errorMessage |
string |
The error message on failure (only when success is false). |
TIMEOUT |
| items |
array<object> |
The list of pending approval items. |
|
|
object |
-- |
||
| hitlId |
string |
The ID of the approval item, used when passing back hitlDecisions. |
"" |
| toolName |
string |
The name of the intercepted tool. |
“” |
| args |
any |
The original key-value pairs of the tool parameters. |
[] |
| displayName |
string |
The display name of the tool. |
“” |
| usage |
object |
The token usage. |
|
| inputTokens |
integer |
The number of input tokens. |
10 |
| outputTokens |
integer |
The number of output tokens. |
5 |
| totalTokens |
integer |
The total number of tokens. |
15 |
| message |
string |
The error message for error events. |
“” |
Examples
Success response
JSON format
{
"event": "-",
"sessionId": "462E2707-590E-51B6-9940-0AB33044828B-deliverData-202603020950-WCSN4MEC8T",
"text": "-",
"completed": true,
"toolName": "\"get_job_events\"",
"toolCallId": "\"c1\"",
"displayName": "\"\"",
"input": "{ \"namespace\": \"vvp-dev-team\", \"jobId\": \"aa91ec66-...\", \"deploymentId\": \"b78aae4c-...\" }",
"success": "true",
"errorType": "TIMEOUT",
"errorMessage": "TIMEOUT",
"items": [
{
"hitlId": "\"\"",
"toolName": "“”",
"args": "[]",
"displayName": "“”"
}
],
"usage": {
"inputTokens": 10,
"outputTokens": 5,
"totalTokens": 15
},
"message": "“”"
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.