Skip to main content

objectiveai_sdk/vector/completions/request/
vector_completion_create_params.rs

1//! Vector completion request parameters.
2
3use crate::agent;
4use serde::{Deserialize, Serialize};
5use schemars::JsonSchema;
6
7/// Parameters for creating a vector completion.
8///
9/// Vector completions run multiple agent completions (one per LLM in the
10/// swarm), force each to vote for one of the predefined responses, and
11/// combine votes using the provided profile weights to produce final scores.
12#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema)]
13#[schemars(rename = "vector.completions.request.VectorCompletionCreateParams")]
14pub struct VectorCompletionCreateParams {
15    // --- Caching and retry options ---
16    /// If present, reuses votes from a previous request with this ID.
17    #[serde(skip_serializing_if = "Option::is_none")]
18    #[schemars(extend("omitempty" = true))]
19    pub retry: Option<String>,
20    /// If true, uses cached votes when available.
21    #[serde(skip_serializing_if = "Option::is_none")]
22    #[schemars(extend("omitempty" = true))]
23    pub from_cache: Option<bool>,
24
25    // --- Core configuration ---
26    /// The conversation messages (the prompt).
27    pub messages: Vec<agent::completions::message::Message>,
28    /// Provider routing preferences.
29    #[serde(skip_serializing_if = "Option::is_none")]
30    #[schemars(extend("omitempty" = true))]
31    pub provider: Option<agent::completions::request::Provider>,
32    /// The Swarm of agents to use.
33    pub swarm: crate::swarm::InlineSwarmBaseOrRemoteCommitOptional,
34    /// Random seed for deterministic results.
35    #[serde(skip_serializing_if = "Option::is_none")]
36    #[schemars(extend("omitempty" = true))]
37    pub seed: Option<i64>,
38    /// Whether to stream the response.
39    #[serde(skip_serializing_if = "Option::is_none")]
40    #[schemars(extend("omitempty" = true))]
41    pub stream: Option<bool>,
42    /// The possible responses the LLMs can vote for.
43    pub responses: Vec<agent::completions::message::RichContent>,
44    /// Continuation from a previous completion, as a base64-encoded string.
45    #[serde(skip_serializing_if = "Option::is_none")]
46    #[schemars(extend("omitempty" = true))]
47    pub continuation: Option<String>,
48}