OptionalautoOptionalfrequency_Optionalmax_OptionalmaxMaximum number of tool calling rounds when autoExecuteTools is enabled.
Prevents infinite loops. Default: 5.
OptionalonHandler for non-Sogni tool calls when autoExecuteTools is enabled.
Called for any tool call whose name does NOT start with sogni_.
Must return a string (the tool result content).
OptionalonProgress callback for Sogni tool execution when autoExecuteTools is enabled.
Fires as each tool call progresses through creation, queuing, processing, and completion.
Optionalpresence_OptionalstopOptionalstreamOptionaltemperatureOptionalthinkControl thinking/reasoning mode. When false, appends /no_think to the system
message so the model skips its internal reasoning step. When true or omitted,
thinking is enabled (default behavior for supported models like Qwen3).
OptionaltokenToken type to use for billing. Defaults to 'sogni'.
Optionaltool_Controls which (if any) tool is called by the model.
OptionaltoolsTool definitions for function calling.
Optionaltop_
Automatically execute Sogni tool calls (image/video/music generation) when the model requests them. The SDK handles the full multi-round tool calling loop: send completion → execute tools → feed results back → repeat until done.
Only supported with
stream: false. For streaming, usechat.tools.executeAll()manually in your own loop.