pub struct CloudAiRequest {Show 16 fields
pub model: String,
pub prompt: String,
pub max_tokens: Option<u32>,
pub temperature: Option<f32>,
pub api_key: String,
pub system: Option<String>,
pub base_url: Option<String>,
pub top_p: Option<f32>,
pub top_k: Option<u32>,
pub stop: Option<Vec<String>>,
pub stream: bool,
pub call_id: Option<String>,
pub reasoning: Option<bool>,
pub images: Vec<String>,
pub tools: Vec<ToolSpec>,
pub response_schema: Option<Value>,
}Fields§
§model: String§prompt: String§max_tokens: Option<u32>§temperature: Option<f32>§api_key: String§system: Option<String>Optional system-role text. Each provider maps it to its native shape:
- Claude: top-level
systemfield on the request payload. - OpenAI: prepended
{role:"system"}message. - Gemini: top-level
system_instruction.
None sends a single user-role message with no system text - the
cloud-AI node path, which has no per-task system prompt.
base_url: Option<String>Override endpoint for the OpenAI-compatible local provider
(e.g. http://localhost:11434/v1/chat/completions). Cloud
providers ignore this and use their fixed ENDPOINT const; the
local provider requires it.
top_p: Option<f32>Nucleus sampling cutoff (0..=1). Forwarded by the OpenAI-compatible
body builder (top_p); cloud providers with their own builders
(Claude, Gemini) ignore it. None means “let the server decide”.
top_k: Option<u32>Top-K sampling cutoff. Non-standard in OpenAI’s API but accepted by llama.cpp / Ollama / LM Studio; the OpenAI-compatible body builder forwards it verbatim when set.
stop: Option<Vec<String>>Stop sequences (any element halts generation). Forwarded as the
OpenAI stop field. Empty None means no caller-supplied stops.
stream: boolWhen true the caller is invoking the provider’s invoke_stream
path and expects per-chunk events. Providers always set
stream: true in the HTTP payload when this is set.
call_id: Option<String>Caller-supplied correlation id stamped onto every emitted
LlmStreamEvent. Required when stream = true; harmless
otherwise.
reasoning: Option<bool>Per-request reasoning/thinking toggle for models that support it.
Some(true) asks the provider to enable extended thinking, Some(false)
disables it, None leaves the server/model default. Each provider maps
it to its native shape (OpenAI-compat chat_template_kwargs, Claude
thinking, Gemini thinkingConfig).
images: Vec<String>Image references for vision models - http(s) URLs or data: URLs (the
executor resolves local paths to base64 data: URLs before building the
request). Empty for text-only calls.
tools: Vec<ToolSpec>Tool/function specs the model may call. Empty disables tool use; the
actual call loop runs in CloudAiProvider::invoke_tools.
response_schema: Option<Value>Optional JSON Schema for structured output. When set, the
OpenAI-compatible body builder adds a response_format: json_schema so
the model is constrained to matching JSON (providers with their own body
builders - Claude / Gemini - ignore it and rely on the prompt). The
"structured" task sets this from the node’s outputSchema.
Trait Implementations§
Source§impl Clone for CloudAiRequest
impl Clone for CloudAiRequest
Source§fn clone(&self) -> CloudAiRequest
fn clone(&self) -> CloudAiRequest
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more