Chat Completions#

Performs a single stateless Chat Completions request and returns the model's response without creating a chat, message, or launch.

InTable

[Data table | array of objects] Prepared OpenAI message history; compatible input and alias property of Messages.

If specified, takes precedence over simple text inputs.

ContentSystem[Text] Optional system prompt; the client creates a message with role=system.
ContentUser[Text] User text; required if InTable does not contain prepared messages. The client creates a message with role=user.
ModelModel provider selection.
CustomModelName[Text] Optional name of the Sherpa AI Server model; if empty, the model selects the server.
Stop[Text | array of texts] One or more stop sequences for generation.
Temperature[Number] Generation temperature; default value is 0.7.
TopP[Number] Threshold for nucleus sampling; empty value is not sent.
MaxLength[Number] Maximum number of tokens in the response; compatible alias of the API property MaxTokens, default value is 1000.
AutoLengthLimitAutomatically limit the response length to the available model context.
Tools[Array of objects] Descriptions of available model tools in OpenAI format.
ToolChoice[Text | object] Tool selection rule: automatic mode, prohibition, or specific tool.
Timeout[Object] Required format for structured response.
StructuredOutput[Number] Timeout for waiting for the model's response in seconds; default value is 300.
ResponseRole[Text] Role of the message from the first response variant.
ResponseContent[Text | object] Content of the message from the first response variant.
TotalTokens[Number] Total number of tokens used from usage.total_tokens.
FinishReason[Text] Reason for the completion of the first variant, such as stop, length, or tool_calls.
ToolCalls[Array of objects] Tool calls from the model's message.
ResponseComplete typed response Chat Completions.
UsageUsage data for input, output, and all tokens.
Error Level

Select error handling level.

Possible values:

  • "Default" - default;
  • "Ignore" - errors are ignored;
  • "Handle" - errors are handled.

If "Default" is selected, the value from the "Start" block of this diagram will be used.

Message Level

Select the level of messages that will be output by the blocks during operation.

Possible values:

  • "Default" - default;
  • "Release" - output is disabled;
  • "Debug" - main information output;
  • "Detailed" - detailed information output.

If "Default" is selected, the value from the "Start" block of this diagram will be used.

Error Text[Text] Returns detailed information about the error in case of incorrect execution of the block's work.