Skip to main content

systemprompt_models/wire/canonical/request/
options.rs

1//! Tool, thinking, response-format and search options of a canonical request.
2//!
3//! Copyright (c) systemprompt.io — Business Source License 1.1.
4//! See <https://systemprompt.io> for licensing details.
5
6use serde_json::Value;
7
8#[derive(Debug, Clone)]
9pub struct CanonicalTool {
10    pub name: String,
11    pub description: Option<String>,
12    pub input_schema: Value,
13}
14
15#[derive(Debug, Clone)]
16pub enum CanonicalToolChoice {
17    Auto,
18    Any,
19    None,
20    Required,
21    Tool(String),
22}
23
24#[derive(Debug, Clone, Copy, Default)]
25pub struct ThinkingConfig {
26    pub enabled: bool,
27    pub budget_tokens: Option<u32>,
28}
29
30#[derive(Debug, Clone)]
31pub enum ResponseFormat {
32    JsonObject,
33    JsonSchema {
34        name: String,
35        // JSON: JSON Schema document for structured output (OpenAI / Gemini / Anthropic).
36        schema: Value,
37        strict: bool,
38    },
39}
40
41#[derive(
42    Debug,
43    Clone,
44    Copy,
45    PartialEq,
46    Eq,
47    PartialOrd,
48    Ord,
49    serde::Serialize,
50    serde::Deserialize,
51    schemars::JsonSchema,
52)]
53#[serde(rename_all = "snake_case")]
54pub enum ReasoningEffort {
55    Low,
56    Medium,
57    High,
58}
59
60impl ReasoningEffort {
61    pub const fn as_str(self) -> &'static str {
62        match self {
63            Self::Low => "low",
64            Self::Medium => "medium",
65            Self::High => "high",
66        }
67    }
68}
69
70#[derive(Debug, Clone, Default)]
71pub struct SearchConfig {
72    pub max_uses: Option<u32>,
73    pub context_size: Option<String>,
74    pub urls: Vec<String>,
75}