Generate replies with Chat Completions¶
Send messages to a model that supports Chat Completions and read a complete reply or receive generated content incrementally.
Prerequisites¶
Prepare a personal access token or service account API Key with Genesis permissions. See Access credentials. Find and select a model that supports Chat Completions, and prepare the messages to send.
Call sequence¶
Create a Chat Completion using the selected model and messages.
Read the reply and finish reason. For incremental display, receive and assemble the result according to the streaming instructions on the same action page.
Review the token usage for this call and check whether the reply meets your needs.
API operations¶
Task |
API operation |
When to use it or what to check |
|---|---|---|
Generate a reply |
Send messages and select a complete or streamed response. |
Confirm the result¶
Check the reply and finish reason. For streaming, confirm normal completion as described on the action page. Do not mark partial content as a complete reply if the connection closes early.
Limitations and notes¶
This task covers text conversation. Image input and tool calls require the corresponding model capabilities and request configuration.