Upstage Solar Chat
AI-generatedSummary
Execute Upstage Solar chat completion with specified model, messages, and options.
Inputs
- model — Solar model to use for chat completion; defaults to solar-mini if omitted. Options: solar-mini (fast, basic tasks), solar-pro (complex tasks), solar-pro2 (extended capabilities, JSON mode/schema), solar-pro3 (128K context, parallel tool calls).
- messages (required) — Chat messages as a fixed collection with multiple values allowed. Each message must have a role (system, user, or assistant) and non-empty content. At least one message is required; messages with empty or whitespace-only content throw an error.
- response_format — Output format; defaults to 'default'. 'json_object' enables JSON mode (generates JSON object without schema, requires 'JSON' in prompt, only compatible with solar-pro-2). 'json_schema' enables structured outputs with custom schema (only compatible with solar-pro-2). When 'json_schema' is selected, the 'json_schema' parameter becomes required.
- json_schema — JSON schema object for structured outputs. Required when response_format is 'json_schema'. Sent as response_format: {type: 'json_schema', json_schema: {...your schema...}}.
- options — Collection of additional generation parameters. Includes temperature (0-2, default 0.7), max_tokens (1-128000, default 1000, limit depends on model: solar-mini 32K, solar-pro2 65K, solar-pro3 128K), top_p (0-1, default 0.9), stream (boolean, default false; streaming not fully supported, processed as non-streaming), reasoning_effort (low/medium/high, default low; solar-pro3 defaults to medium, solar-pro2 requires high for reasoning), frequency_penalty (-2 to 2, default 0), presence_penalty (-2 to 2, default 0).
- function_calling — Fixed collection to configure tools/functions the model can call. Contains sub-options: tools (fixed collection of tools, each requiring name, description, and JSON Schema parameters), tool_choice (options: auto, none, required, specific; default auto), function_name (string, required when tool_choice is 'specific'), parallel_tool_calls (boolean, default false; supported by solar-pro3).
Output shape
json
Returned per input item as an array. Contains: content (string, assistant's message), usage (object, token usage statistics), model (string, model name from API response), created (number, timestamp), full_response (object, complete API response). If tool calls are present, also includes has_tool_calls (boolean) and tool_calls (array of {id, type, function: {name, arguments}} with parsed arguments).
Examples
Example 1: Basic chat completion with solar-mini
model: solar-mini; messages: [{role: user, content: 'Hello'}]; options: default. Returns assistant response content and usage metadata.
Example 2: JSON mode with solar-pro-2
model: solar-pro2; response_format: json_object; messages: [{role: user, content: 'Extract JSON from this text: {...}'}]. Returns JSON object in content field.
Example 3: Structured outputs with tool calling
model: solar-pro3; function_calling.tools: [{name: 'search', description: 'Search the web', parameters: {type: object, properties: {query: {type: string}}}; tool_choice: specific; function_name: 'search'}]. Model is forced to call the specified function.