Generate LLM completion
Generates a completion based on the input messages and retrieval chunks. If the 'stream' parameter is set to true, the response is streamed. By default the stream is plain text (text/plain). Send the request header 'Accept: text/event-stream' to instead receive a Server-Sent Events (SSE) stream of ag-ui protocol events (delta text as TEXT_MESSAGE_CONTENT, grounding and citations as CUSTOM events, history ids and completion as RUN_STARTED / RUN_FINISHED).
Required scope: `inference:run`
Request body
Example request
{
"authz_policy": "external-chatbot",
"principal_id": "user-123",
"conversation_id": "550e8400-e29b-41d4-a716-446655440000",
"parent_message_id": "f47ac10b-58cc-4372-a567-0e02b2c3d479"
}Response
Successful completion. If the 'stream' parameter is false, the response is returned as application/json. If the 'stream' parameter is true, the response is returned as a stream of plain text (text/plain) by default, or as an ag-ui Server-Sent Events stream (text/event-stream) when the request sends 'Accept: text/event-stream'.
Example response
{
"created": 1677649420,
"conversation_id": "550e8400-e29b-41d4-a716-446655440000",
"user_message_id": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"assistant_message_id": "9b2e6f1a-3c4d-4e5f-8a9b-0c1d2e3f4a5b",
"choices": [
{
"message": {
"role": "assistant",
"content": "Hello! How can I help you today?"
},
"finish_reason": "stop"
}
]
}Changes
Changed in 19 of the 71 revisions of this API.103068
- ○
added the new optional request property
new-optional-request-property
- ○
- ○
added the new optional request property
new-optional-request-property
- ○
added the new optional request property
new-optional-request-property
- ○
added the new optional request property
new-optional-request-property
- ○
added the new optional request property
new-optional-request-property
- ○
added the optional property
to the response with the statusresponse-optional-property-added
- ○
added the optional property
to the response with the statusresponse-optional-property-added
- ○
added the optional property
to the response with the statusresponse-optional-property-added
- ○
- ○
added the optional property
////to the response with the statusresponse-optional-property-added
- ○
- ○
added the new optional request property
new-optional-request-property
- ○
added the optional property
//to the response with the statusresponse-optional-property-added
- ○
added the optional property
//to the response with the statusresponse-optional-property-added
- ○
added the optional property
//to the response with the statusresponse-optional-property-added
- ○
- ○
added the new optional request property
new-optional-request-property
- ○
added the new optional request property
new-optional-request-property
- ○
- ○
added the new optional request property
new-optional-request-property
- ○
- ○
added the new optional request property
new-optional-request-property
- ○
- ○
added the new optional request property
new-optional-request-property
- ○
- ○
added the new
datetimeenum value to the request property///request-property-enum-value-added
- ○
added the new
datetimeenum value to the request property///request-property-enum-value-added
- ○
- ○
added the new optional request property
new-optional-request-property
- ○
Of the 71 revisions, 18 have no diff computed.