Actions44
- Chat Actions
- Chat Completion Actions
- Conversation Actions
- Conversation Config Actions
- Conversation Template Actions
- Document Actions
- Embedding Actions
- FAQ Topic Actions
- Folder Actions
- Group Actions
- Metadata Actions
- Model Actions
- Quick Actions
Chat Completion → Create Chat Completion
AI-generatedSummary
Create an OpenAI-compatible chat completion by sending a series of messages to a specified model, optionally using streaming to receive partial results incrementally.
Inputs
- Model Name or ID (required) — Select the model to generate chat completion from, chosen from a loaded list or specified via an expression.
- Messages (required) — Provide a list of conversation messages formatted for OpenAI, each with a role (system, user, or assistant) and content string. Multiple messages can be added and sorted to form the conversation context.
- Stream Response — Enable to receive the completion as a server-sent events (SSE) stream for incremental partial responses.
- Emit Each Chunk — If streaming is enabled, choose to emit one output item per streamed chunk instead of a single aggregated result.
- Additional Options — Configure advanced parameters such as temperature, max tokens, top_p, presence and frequency penalties, stop sequences, deterministic seed, and whether to include usage info in the stream.
Output shape
a single JSON object representing the chat completion response, or multiple items if 'Emit Each Chunk' is enabled during streaming.
Without streaming, returns the full chat completion result in one item. With streaming enabled and 'Emit Each Chunk' disabled, returns a single item aggregating all chunks. When 'Emit Each Chunk' is enabled, outputs one item per SSE chunk. Usage statistics may be included in the final chunk if requested.
Examples
Example 1: Generate a chat response using the GPT-4 model with a user message.
Model set to 'gpt-4', one user message with content 'Hello, how are you?', no streaming.
Example 2: Stream chat completion from a conversation including system and user messages.
Model set to 'gpt-4', messages include a system role and user role message, streaming enabled with 'Emit Each Chunk' to output partial results incrementally.