- API-Referenz
- AIssistant
- Run the AIssistant on a chat and stream its answer
Run the AIssistant on a chat and stream its answer
The response streams one AG-UI event per SSE data: frame, each a de.mittwald.v1.aissistant.RunEvent. A run ends with RUN_FINISHED, or with RUN_ERROR when it fails. A client tool call ends the run without an answer, and the client executes the call and starts a new run whose resume answers the interrupt. The chat does not need to be saved before it is run.
Request
- chatIdstring (uuid)required
The AG-UI threadId of the chat, created by the client. The request body's threadId must equal it.
Beispiel:"7f0c6a52-3a8e-4b8f-9d1e-2c4b5a6d7e8f"
- contextArray von object
- Array[
- *object
- descriptionstringrequired
- valuestringrequired
- *
]
- forwardedPropsobjectrequired
- contextobjectrequired
- appInstallationIdstring (≤ 128 Zeichen)
- customerIdstring (≤ 128 Zeichen)
- projectIdstring (≤ 128 Zeichen)
- routestring (≤ 2048 Zeichen)required
- contractVersionnumber (einer von: 1)
- model"default"required
- messagesArray von eine von 4 Alternativenrequired
- Array[
- *eine von 4 Alternativen
- Alternativeobject
- contentrequired
- encryptedValuestring
- idstringrequired
- metadata
- namestring
- role"user"required
- subagentRunIdstring
- *
- Alternativeobject
- contentstring
- encryptedValuestring
- idstringrequired
- metadata
- namestring
- role"assistant"required
- subagentRunIdstring
- toolCallsArray von object
- Array[
- *object
- encryptedValuestring
- functionobjectrequired
- argumentsstringrequired
- namestringrequired
- *
- idstringrequired
- metadata
- type"function"required
- *
]
- *
- Alternativeobject
- contentrequired
- encryptedValuestring
- errorstring
- idstringrequired
- metadata
- role"tool"required
- subagentRunIdstring
- toolCallIdstringrequired
- *
- Alternativeobject
- contentstringrequired
- encryptedValuestring
- idstringrequired
- metadata
- role"reasoning"required
- subagentRunIdstring
- *
]
- parentRunIdstring
- protocolVersionstring
- resumeArray von object
- Array[
- *object
- interruptIdstringrequired
- metadata
- payload
- statusstring (einer von: resolved, cancelled)required
- *
]
- runIdstring (≥ 1 Zeichen, ≤ 128 Zeichen)required
- state
- threadIdstring (≥ 1 Zeichen, ≤ 128 Zeichen)required
- toolsArray von object
- Array[
- *object
- descriptionstringrequired
- metadata
- namestringrequired
- parameters
- *
]
Content-Type: application/json
{
"context": [],
"forwardedProps": {
"context": {
"projectId": "p-XXXXXX",
"route": "/projects/p-XXXXXX/storage"
},
"contractVersion": 1,
"model": "default"
},
"messages": [
{
"content": "How much storage is left in my project?",
"id": "2b9e7c14-8f3a-4d61-b5c2-7a1f0e3d9b48",
"role": "user"
},
{
"content": "Your project has 4.2 GB of storage left.",
"id": "5c3d8e21-6b47-4f90-a1d2-8e7f5c9b0a34",
"role": "assistant"
},
{
"content": "And how many databases do I have?",
"id": "e1a7b940-2c68-4d13-9f5e-3b8a6d2c7f05",
"role": "user"
}
],
"parentRunId": "9d2b1c40-5e6f-4a71-8b93-0f1e2d3c4b5a",
"runId": "c4a6f1d8-3b27-4e95-8a10-6d5c2e9f7b31",
"state": {},
"threadId": "7f0c6a52-3a8e-4b8f-9d1e-2c4b5a6d7e8f",
"tools": []
}
Content-Type: application/json
{
"context": [],
"forwardedProps": {
"context": {
"projectId": "p-XXXXXX",
"route": "/projects/p-XXXXXX/storage"
},
"contractVersion": 1,
"model": "default"
},
"messages": [
{
"content": "How much storage is left in my project?",
"id": "2b9e7c14-8f3a-4d61-b5c2-7a1f0e3d9b48",
"role": "user"
}
],
"runId": "9d2b1c40-5e6f-4a71-8b93-0f1e2d3c4b5a",
"state": {},
"threadId": "7f0c6a52-3a8e-4b8f-9d1e-2c4b5a6d7e8f",
"tools": []
}
Content-Type: application/json
{
"context": [],
"forwardedProps": {
"context": {
"projectId": "p-XXXXXX",
"route": "/projects/p-XXXXXX/storage"
},
"contractVersion": 1,
"model": "default"
},
"messages": [
{
"content": "Open the databases page of my project.",
"id": "2b9e7c14-8f3a-4d61-b5c2-7a1f0e3d9b48",
"role": "user"
},
{
"id": "a6b3c0d9-5e28-4f17-8c90-2d7e1b4a6f53",
"role": "assistant",
"toolCalls": [
{
"function": {
"arguments": "{\"target\":\"project_databases\",\"params\":{\"projectId\":\"p-XXXXXX\"}}",
"name": "navigate_to"
},
"id": "call-navigate-01",
"type": "function"
}
]
},
{
"content": "{\"path\":\"/projects/p-XXXXXX/databases\",\"target\":\"project_databases\"}",
"id": "d4e1f7a2-9c35-4b68-a0e9-7f2c5b8d1a46",
"role": "tool",
"toolCallId": "call-navigate-01"
}
],
"parentRunId": "9d2b1c40-5e6f-4a71-8b93-0f1e2d3c4b5a",
"resume": [
{
"interruptId": "client_tool_call-navigate-01",
"payload": {
"path": "/projects/p-XXXXXX/databases",
"target": "project_databases"
},
"status": "resolved"
}
],
"runId": "f8d2a05c-7e19-4b3a-96c8-1d4e7f0a2b63",
"state": {},
"threadId": "7f0c6a52-3a8e-4b8f-9d1e-2c4b5a6d7e8f",
"tools": []
}
Content-Type: application/json
{
"context": [],
"forwardedProps": {
"context": {
"projectId": "p-XXXXXX",
"route": "/projects/p-XXXXXX/storage"
},
"contractVersion": 1,
"model": "default"
},
"messages": [
{
"content": [
{
"text": "The storage bar on this page looks wrong. Why?",
"type": "text"
},
{
"source": {
"mimeType": "image/png",
"type": "data",
"value": "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8BQDwAEhQGAhKmMIQAAAABJRU5ErkJggg=="
},
"type": "image"
}
],
"id": "7f0a2d61-4b83-4c95-8e17-5a9d0f3b6c28",
"role": "user"
}
],
"runId": "0b7c4e83-1a59-4d26-b7f0-9e3c8a5d2b17",
"state": {},
"threadId": "7f0c6a52-3a8e-4b8f-9d1e-2c4b5a6d7e8f",
"tools": []
}
{
"additionalProperties": false,
"properties": {
"context": {
"default": [],
"items": {
"additionalProperties": {},
"properties": {
"description": {
"type": "string"
},
"value": {
"type": "string"
}
},
"required": [
"description",
"value"
],
"type": "object"
},
"type": "array"
},
"forwardedProps": {
"additionalProperties": false,
"properties": {
"context": {
"additionalProperties": false,
"properties": {
"appInstallationId": {
"maxLength": 128,
"type": "string"
},
"customerId": {
"maxLength": 128,
"type": "string"
},
"projectId": {
"maxLength": 128,
"type": "string"
},
"route": {
"maxLength": 2048,
"type": "string"
}
},
"required": [
"route"
],
"type": "object"
},
"contractVersion": {
"enum": [
1
],
"type": "number"
},
"model": {
"enum": [
"default"
],
"type": "string"
}
},
"required": [
"context",
"model"
],
"type": "object"
},
"messages": {
"items": {
"oneOf": [
{
"additionalProperties": {},
"properties": {
"content": {
"anyOf": [
{
"type": "string"
},
{
"items": {
"oneOf": [
{
"additionalProperties": {},
"properties": {
"id": {
"type": "string"
},
"metadata": {},
"text": {
"type": "string"
},
"type": {
"enum": [
"text"
],
"type": "string"
}
},
"required": [
"type",
"text"
],
"type": "object"
},
{
"additionalProperties": {},
"properties": {
"id": {
"type": "string"
},
"metadata": {},
"source": {
"oneOf": [
{
"additionalProperties": {},
"properties": {
"mimeType": {
"type": "string"
},
"type": {
"enum": [
"data"
],
"type": "string"
},
"value": {
"type": "string"
}
},
"required": [
"type",
"value",
"mimeType"
],
"type": "object"
},
{
"additionalProperties": {},
"properties": {
"mimeType": {
"type": "string"
},
"type": {
"enum": [
"url"
],
"type": "string"
},
"value": {
"type": "string"
}
},
"required": [
"type",
"value"
],
"type": "object"
},
{
"additionalProperties": {},
"properties": {
"mimeType": {
"type": "string"
},
"provider": {
"type": "string"
},
"type": {
"enum": [
"file"
],
"type": "string"
},
"value": {
"type": "string"
}
},
"required": [
"type",
"value"
],
"type": "object"
}
]
},
"type": {
"enum": [
"image"
],
"type": "string"
}
},
"required": [
"type",
"source"
],
"type": "object"
},
{
"additionalProperties": {},
"properties": {
"id": {
"type": "string"
},
"metadata": {},
"source": {
"oneOf": [
{
"additionalProperties": {},
"properties": {
"mimeType": {
"type": "string"
},
"type": {
"enum": [
"data"
],
"type": "string"
},
"value": {
"type": "string"
}
},
"required": [
"type",
"value",
"mimeType"
],
"type": "object"
},
{
"additionalProperties": {},
"properties": {
"mimeType": {
"type": "string"
},
"type": {
"enum": [
"url"
],
"type": "string"
},
"value": {
"type": "string"
}
},
"required": [
"type",
"value"
],
"type": "object"
},
{
"additionalProperties": {},
"properties": {
"mimeType": {
"type": "string"
},
"provider": {
"type": "string"
},
"type": {
"enum": [
"file"
],
"type": "string"
},
"value": {
"type": "string"
}
},
"required": [
"type",
"value"
],
"type": "object"
}
]
},
"type": {
"enum": [
"audio"
],
"type": "string"
}
},
"required": [
"type",
"source"
],
"type": "object"
},
{
"additionalProperties": {},
"properties": {
"id": {
"type": "string"
},
"metadata": {},
"source": {
"oneOf": [
{
"additionalProperties": {},
"properties": {
"mimeType": {
"type": "string"
},
"type": {
"enum": [
"data"
],
"type": "string"
},
"value": {
"type": "string"
}
},
"required": [
"type",
"value",
"mimeType"
],
"type": "object"
},
{
"additionalProperties": {},
"properties": {
"mimeType": {
"type": "string"
},
"type": {
"enum": [
"url"
],
"type": "string"
},
"value": {
"type": "string"
}
},
"required": [
"type",
"value"
],
"type": "object"
},
{
"additionalProperties": {},
"properties": {
"mimeType": {
"type": "string"
},
"provider": {
"type": "string"
},
"type": {
"enum": [
"file"
],
"type": "string"
},
"value": {
"type": "string"
}
},
"required": [
"type",
"value"
],
"type": "object"
}
]
},
"type": {
"enum": [
"video"
],
"type": "string"
}
},
"required": [
"type",
"source"
],
"type": "object"
},
{
"additionalProperties": {},
"properties": {
"id": {
"type": "string"
},
"metadata": {},
"source": {
"oneOf": [
{
"additionalProperties": {},
"properties": {
"mimeType": {
"type": "string"
},
"type": {
"enum": [
"data"
],
"type": "string"
},
"value": {
"type": "string"
}
},
"required": [
"type",
"value",
"mimeType"
],
"type": "object"
},
{
"additionalProperties": {},
"properties": {
"mimeType": {
"type": "string"
},
"type": {
"enum": [
"url"
],
"type": "string"
},
"value": {
"type": "string"
}
},
"required": [
"type",
"value"
],
"type": "object"
},
{
"additionalProperties": {},
"properties": {
"mimeType": {
"type": "string"
},
"provider": {
"type": "string"
},
"type": {
"enum": [
"file"
],
"type": "string"
},
"value": {
"type": "string"
}
},
"required": [
"type",
"value"
],
"type": "object"
}
]
},
"type": {
"enum": [
"document"
],
"type": "string"
}
},
"required": [
"type",
"source"
],
"type": "object"
}
]
},
"type": "array"
}
]
},
"encryptedValue": {
"type": "string"
},
"id": {
"type": "string"
},
"metadata": {},
"name": {
"type": "string"
},
"role": {
"enum": [
"user"
],
"type": "string"
},
"subagentRunId": {
"type": "string"
}
},
"required": [
"id",
"role",
"content"
],
"type": "object"
},
{
"additionalProperties": {},
"properties": {
"content": {
"type": "string"
},
"encryptedValue": {
"type": "string"
},
"id": {
"type": "string"
},
"metadata": {},
"name": {
"type": "string"
},
"role": {
"enum": [
"assistant"
],
"type": "string"
},
"subagentRunId": {
"type": "string"
},
"toolCalls": {
"items": {
"additionalProperties": {},
"properties": {
"encryptedValue": {
"type": "string"
},
"function": {
"additionalProperties": {},
"properties": {
"arguments": {
"type": "string"
},
"name": {
"type": "string"
}
},
"required": [
"name",
"arguments"
],
"type": "object"
},
"id": {
"type": "string"
},
"metadata": {},
"type": {
"enum": [
"function"
],
"type": "string"
}
},
"required": [
"id",
"type",
"function"
],
"type": "object"
},
"type": "array"
}
},
"required": [
"id",
"role"
],
"type": "object"
},
{
"additionalProperties": {},
"properties": {
"content": {
"anyOf": [
{
"type": "string"
},
{
"items": {
"oneOf": [
{
"additionalProperties": {},
"properties": {
"id": {
"type": "string"
},
"metadata": {},
"text": {
"type": "string"
},
"type": {
"enum": [
"text"
],
"type": "string"
}
},
"required": [
"type",
"text"
],
"type": "object"
},
{
"additionalProperties": {},
"properties": {
"id": {
"type": "string"
},
"metadata": {},
"source": {
"oneOf": [
{
"additionalProperties": {},
"properties": {
"mimeType": {
"type": "string"
},
"type": {
"enum": [
"data"
],
"type": "string"
},
"value": {
"type": "string"
}
},
"required": [
"type",
"value",
"mimeType"
],
"type": "object"
},
{
"additionalProperties": {},
"properties": {
"mimeType": {
"type": "string"
},
"type": {
"enum": [
"url"
],
"type": "string"
},
"value": {
"type": "string"
}
},
"required": [
"type",
"value"
],
"type": "object"
},
{
"additionalProperties": {},
"properties": {
"mimeType": {
"type": "string"
},
"provider": {
"type": "string"
},
"type": {
"enum": [
"file"
],
"type": "string"
},
"value": {
"type": "string"
}
},
"required": [
"type",
"value"
],
"type": "object"
}
]
},
"type": {
"enum": [
"image"
],
"type": "string"
}
},
"required": [
"type",
"source"
],
"type": "object"
},
{
"additionalProperties": {},
"properties": {
"id": {
"type": "string"
},
"metadata": {},
"source": {
"oneOf": [
{
"additionalProperties": {},
"properties": {
"mimeType": {
"type": "string"
},
"type": {
"enum": [
"data"
],
"type": "string"
},
"value": {
"type": "string"
}
},
"required": [
"type",
"value",
"mimeType"
],
"type": "object"
},
{
"additionalProperties": {},
"properties": {
"mimeType": {
"type": "string"
},
"type": {
"enum": [
"url"
],
"type": "string"
},
"value": {
"type": "string"
}
},
"required": [
"type",
"value"
],
"type": "object"
},
{
"additionalProperties": {},
"properties": {
"mimeType": {
"type": "string"
},
"provider": {
"type": "string"
},
"type": {
"enum": [
"file"
],
"type": "string"
},
"value": {
"type": "string"
}
},
"required": [
"type",
"value"
],
"type": "object"
}
]
},
"type": {
"enum": [
"audio"
],
"type": "string"
}
},
"required": [
"type",
"source"
],
"type": "object"
},
{
"additionalProperties": {},
"properties": {
"id": {
"type": "string"
},
"metadata": {},
"source": {
"oneOf": [
{
"additionalProperties": {},
"properties": {
"mimeType": {
"type": "string"
},
"type": {
"enum": [
"data"
],
"type": "string"
},
"value": {
"type": "string"
}
},
"required": [
"type",
"value",
"mimeType"
],
"type": "object"
},
{
"additionalProperties": {},
"properties": {
"mimeType": {
"type": "string"
},
"type": {
"enum": [
"url"
],
"type": "string"
},
"value": {
"type": "string"
}
},
"required": [
"type",
"value"
],
"type": "object"
},
{
"additionalProperties": {},
"properties": {
"mimeType": {
"type": "string"
},
"provider": {
"type": "string"
},
"type": {
"enum": [
"file"
],
"type": "string"
},
"value": {
"type": "string"
}
},
"required": [
"type",
"value"
],
"type": "object"
}
]
},
"type": {
"enum": [
"video"
],
"type": "string"
}
},
"required": [
"type",
"source"
],
"type": "object"
},
{
"additionalProperties": {},
"properties": {
"id": {
"type": "string"
},
"metadata": {},
"source": {
"oneOf": [
{
"additionalProperties": {},
"properties": {
"mimeType": {
"type": "string"
},
"type": {
"enum": [
"data"
],
"type": "string"
},
"value": {
"type": "string"
}
},
"required": [
"type",
"value",
"mimeType"
],
"type": "object"
},
{
"additionalProperties": {},
"properties": {
"mimeType": {
"type": "string"
},
"type": {
"enum": [
"url"
],
"type": "string"
},
"value": {
"type": "string"
}
},
"required": [
"type",
"value"
],
"type": "object"
},
{
"additionalProperties": {},
"properties": {
"mimeType": {
"type": "string"
},
"provider": {
"type": "string"
},
"type": {
"enum": [
"file"
],
"type": "string"
},
"value": {
"type": "string"
}
},
"required": [
"type",
"value"
],
"type": "object"
}
]
},
"type": {
"enum": [
"document"
],
"type": "string"
}
},
"required": [
"type",
"source"
],
"type": "object"
}
]
},
"type": "array"
}
]
},
"encryptedValue": {
"type": "string"
},
"error": {
"type": "string"
},
"id": {
"type": "string"
},
"metadata": {},
"role": {
"enum": [
"tool"
],
"type": "string"
},
"subagentRunId": {
"type": "string"
},
"toolCallId": {
"type": "string"
}
},
"required": [
"id",
"role",
"content",
"toolCallId"
],
"type": "object"
},
{
"additionalProperties": {},
"properties": {
"content": {
"type": "string"
},
"encryptedValue": {
"type": "string"
},
"id": {
"type": "string"
},
"metadata": {},
"role": {
"enum": [
"reasoning"
],
"type": "string"
},
"subagentRunId": {
"type": "string"
}
},
"required": [
"id",
"role",
"content"
],
"type": "object"
}
]
},
"type": "array"
},
"parentRunId": {
"type": "string"
},
"protocolVersion": {
"type": "string"
},
"resume": {
"items": {
"additionalProperties": {},
"properties": {
"interruptId": {
"type": "string"
},
"metadata": {},
"payload": {},
"status": {
"enum": [
"resolved",
"cancelled"
],
"type": "string"
}
},
"required": [
"interruptId",
"status"
],
"type": "object"
},
"type": "array"
},
"runId": {
"maxLength": 128,
"minLength": 1,
"pattern": "^[A-Za-z0-9._:-]+$",
"type": "string"
},
"state": {},
"threadId": {
"maxLength": 128,
"minLength": 1,
"pattern": "^[A-Za-z0-9._:-]+$",
"type": "string"
},
"tools": {
"default": [],
"items": {
"additionalProperties": {},
"properties": {
"description": {
"type": "string"
},
"metadata": {},
"name": {
"type": "string"
},
"parameters": {}
},
"required": [
"name",
"description"
],
"type": "object"
},
"type": "array"
}
},
"required": [
"threadId",
"runId",
"messages",
"forwardedProps"
],
"type": "object"
}
Responses
An unexpected Error that occurred while handling the request
- messagestringrequired
- typestringrequired
Content-Type: application/json
{
"message": "Something went wrong",
"type": "InternalServerError"
}
{
"type": "object",
"required": [
"type",
"message"
],
"properties": {
"message": {
"type": "string",
"example": "Something went wrong"
},
"type": {
"type": "string",
"example": "InternalServerError"
}
}
}
An unexpected Error that occurred while handling the request
- messagestringrequired
- typestringrequired
Content-Type: application/json
{
"message": "Something went wrong",
"type": "InternalServerError"
}
{
"type": "object",
"required": [
"type",
"message"
],
"properties": {
"message": {
"type": "string",
"example": "Something went wrong"
},
"type": {
"type": "string",
"example": "InternalServerError"
}
}
}
An unexpected Error that occurred while handling the request
- messagestringrequired
- typestringrequired
Content-Type: application/json
{
"message": "Something went wrong",
"type": "InternalServerError"
}
{
"type": "object",
"required": [
"type",
"message"
],
"properties": {
"message": {
"type": "string",
"example": "Something went wrong"
},
"type": {
"type": "string",
"example": "InternalServerError"
}
}
}
An unexpected Error that occurred while handling the request
- messagestringrequired
- typestringrequired
Content-Type: application/json
{
"message": "Something went wrong",
"type": "InternalServerError"
}
{
"type": "object",
"required": [
"type",
"message"
],
"properties": {
"message": {
"type": "string",
"example": "Something went wrong"
},
"type": {
"type": "string",
"example": "InternalServerError"
}
}
}
Too many runs are open at the same time; the limit applies before streaming starts.
- messagestringrequired
- typestringrequired
Content-Type: application/json
{
"message": "run capacity reached",
"type": "ResourceExhausted"
}
{
"type": "object",
"required": [
"type",
"message"
],
"properties": {
"message": {
"type": "string",
"example": "Something went wrong"
},
"type": {
"type": "string",
"example": "InternalServerError"
}
}
}
An unexpected Error that occurred while handling the request
- messagestringrequired
- typestringrequired
Content-Type: application/json
{
"message": "Something went wrong",
"type": "InternalServerError"
}
{
"type": "object",
"required": [
"type",
"message"
],
"properties": {
"message": {
"type": "string",
"example": "Something went wrong"
},
"type": {
"type": "string",
"example": "InternalServerError"
}
}
}
An unexpected Error that occurred while handling the request
- messagestringrequired
- typestringrequired
Content-Type: application/json
{
"message": "Something went wrong",
"type": "InternalServerError"
}
{
"type": "object",
"required": [
"type",
"message"
],
"properties": {
"message": {
"type": "string",
"example": "Something went wrong"
},
"type": {
"type": "string",
"example": "InternalServerError"
}
}
}
An unexpected Error that occurred while handling the request
- messagestringrequired
- typestringrequired
Content-Type: application/json
{
"message": "Something went wrong",
"type": "InternalServerError"
}
{
"type": "object",
"required": [
"type",
"message"
],
"properties": {
"message": {
"type": "string",
"example": "Something went wrong"
},
"type": {
"type": "string",
"example": "InternalServerError"
}
}
}
An unexpected Error that occurred while handling the request
- messagestringrequired
- typestringrequired
Content-Type: application/json
{
"message": "Something went wrong",
"type": "InternalServerError"
}
{
"type": "object",
"required": [
"type",
"message"
],
"properties": {
"message": {
"type": "string",
"example": "Something went wrong"
},
"type": {
"type": "string",
"example": "InternalServerError"
}
}
}
Nutzungsbeispiele
$ curl \
--fail \
--location \
-X POST \
-d '{"context":[{"description":"string","value":"string","string":null}],"forwardedProps":{"context":{"appInstallationId":"string","customerId":"string","projectId":"string","route":"string"},"contractVersion":123,"model":"default"},"messages":[{"content":null,"encryptedValue":"string","id":"string","metadata":null,"name":"string","role":"user","subagentRunId":"string","string":null}],"parentRunId":"string","protocolVersion":"string","resume":[{"interruptId":"string","metadata":null,"payload":null,"status":"resolved","string":null}],"runId":"string","state":null,"threadId":"string","tools":[{"description":"string","metadata":null,"name":"string","parameters":null,"string":null}]}' \
-H "Authorization: Bearer $MITTWALD_API_TOKEN" \
-H 'Content-Type: application/json' \
https://api.mittwald.de/v2/aissistant-chats/f0f86186-0a5a-45b2-aa33-502777496347/actions/run
import { MittwaldAPIV2Client } from "@mittwald/api-client";
import { assertStatus } from "@mittwald/api-client-commons";
const client = MittwaldAPIClient.newWithToken(process.env.MITTWALD_API_TOKEN);
const response = await client.aissistant.runChat({
"chatId": "f0f86186-0a5a-45b2-aa33-502777496347",
"data": {
"context": [
{
"description": "string",
"value": "string",
"string": null
}
],
"forwardedProps": {
"context": {
"appInstallationId": "string",
"customerId": "string",
"projectId": "string",
"route": "string"
},
"contractVersion": 123,
"model": "default"
},
"messages": [
{
"content": null,
"encryptedValue": "string",
"id": "string",
"metadata": null,
"name": "string",
"role": "user",
"subagentRunId": "string",
"string": null
}
],
"parentRunId": "string",
"protocolVersion": "string",
"resume": [
{
"interruptId": "string",
"metadata": null,
"payload": null,
"status": "resolved",
"string": null
}
],
"runId": "string",
"state": null,
"threadId": "string",
"tools": [
{
"description": "string",
"metadata": null,
"name": "string",
"parameters": null,
"string": null
}
]
}
});
assertStatus(response, 200);
use \Mittwald\ApiClient\Generated\V2\Clients\AIssistant\RunChat\RunChatRequest;
use \Mittwald\ApiClient\Generated\V2\Clients\AIssistant\RunChat\RunChatRequestBody;
$client = MittwaldAPIClient::newWithToken(getenv('MITTWALD_API_TOKEN'));
// TODO: Please consult the properties and constructor signature of
// RunChatRequestBody to learn how to construct a valid instance
$body = new RunChatRequestBody(/* TODO: ... */);
$request = (new RunChatRequest(
chatId: "f0f86186-0a5a-45b2-aa33-502777496347",
body: $body
));
$response = $client->aissistant()->runChat($request);
var_dump($response->getBody();