pub struct GenerateTextOptions {Show 22 fields
pub max_output_tokens: Option<u32>,
pub temperature: Option<f64>,
pub stop_sequences: Option<Vec<String>>,
pub top_p: Option<f64>,
pub top_k: Option<f64>,
pub presence_penalty: Option<f64>,
pub frequency_penalty: Option<f64>,
pub response_format: Option<ResponseFormat>,
pub seed: Option<u64>,
pub tools: Option<Vec<Tool>>,
pub tool_choice: Option<ToolChoice>,
pub headers: Option<HashMap<String, String>>,
pub provider_options: Option<HashMap<String, Value>>,
pub reasoning: Option<ReasoningEffort>,
pub instructions: Option<String>,
pub body_overrides: Option<Value>,
pub max_retries: Option<u32>,
pub timeout: Option<TimeoutConfiguration>,
pub session_id: Option<String>,
pub abort_signal: Option<AbortSignal>,
pub include_raw_chunks: Option<bool>,
pub repair_tool_call: Option<ToolCallRepair>,
}Expand description
User-facing options for generate_text and stream_text.
Unlike CallOptions (provider-facing), this does not include prompt
(passed separately) and defaults are more ergonomic.
Fields§
§max_output_tokens: Option<u32>§temperature: Option<f64>§stop_sequences: Option<Vec<String>>§top_p: Option<f64>§top_k: Option<f64>§presence_penalty: Option<f64>§frequency_penalty: Option<f64>§response_format: Option<ResponseFormat>§seed: Option<u64>§tools: Option<Vec<Tool>>§tool_choice: Option<ToolChoice>§headers: Option<HashMap<String, String>>§provider_options: Option<HashMap<String, Value>>§reasoning: Option<ReasoningEffort>Top-level reasoning effort.
instructions: Option<String>System instructions prepended to the prompt.
body_overrides: Option<Value>Per-call request body overrides (deep-merged). See RFC-0017.
max_retries: Option<u32>Per-call retry count override. None = provider default, Some(0) = disable.
timeout: Option<TimeoutConfiguration>Per-call timeout configuration (total / first-chunk / chunk idle).
session_id: Option<String>Session identifier, for grouping consecutive calls into a session
(observability, see RFC-0024). Orthogonal to RFC-0019 session-affinity
headers. When None and the optional session inferer is enabled, one
may be inferred from prompt-prefix continuation.
abort_signal: Option<AbortSignal>Abort signal for cancelling the call.
Runtime handle — never crosses the JSON boundary. Rust callers set it
directly; the Node binding bridges a JS AbortSignal natively.
include_raw_chunks: Option<bool>Emit raw provider stream chunks as StreamPart::Raw (debugging aid).
repair_tool_call: Option<ToolCallRepair>Optional one-shot repair callback for unknown, malformed, or schema-invalid tool calls.
Implementations§
Source§impl GenerateTextOptions
impl GenerateTextOptions
Sourcepub fn into_call_options(self, prompt: LanguageModelPrompt) -> CallOptions
pub fn into_call_options(self, prompt: LanguageModelPrompt) -> CallOptions
Build the provider-facing CallOptions from user-facing options.
Trait Implementations§
Source§impl Clone for GenerateTextOptions
impl Clone for GenerateTextOptions
Source§impl Debug for GenerateTextOptions
impl Debug for GenerateTextOptions
Source§impl Default for GenerateTextOptions
impl Default for GenerateTextOptions
Source§impl<'de> Deserialize<'de> for GenerateTextOptions
impl<'de> Deserialize<'de> for GenerateTextOptions
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Serialize for GenerateTextOptions
impl Serialize for GenerateTextOptions
Source§impl TS for GenerateTextOptions
impl TS for GenerateTextOptions
Source§type WithoutGenerics = GenerateTextOptions
type WithoutGenerics = GenerateTextOptions
WithoutGenerics should just be Self.
If the type does have generic parameters, then all generic parameters must be replaced with
a dummy type, e.g ts_rs::Dummy or (). The only requirement for these dummy types is that
EXPORT_TO must be None. Read moreSource§type OptionInnerType = GenerateTextOptions
type OptionInnerType = GenerateTextOptions
std::option::Option<T>, then this associated type is set to T.
All other implementations of TS should set this type to Self instead.Source§fn docs() -> Option<String>
fn docs() -> Option<String>
TS is derived, docs are
automatically read from your doc comments or #[doc = ".."] attributesSource§fn decl_concrete(cfg: &Config) -> String
fn decl_concrete(cfg: &Config) -> String
TS::decl().
If this type is not generic, then this function is equivalent to TS::decl().Source§fn decl(cfg: &Config) -> String
fn decl(cfg: &Config) -> String
type User = { user_id: number, ... }.
This function will panic if the type has no declaration. Read moreSource§fn inline(cfg: &Config) -> String
fn inline(cfg: &Config) -> String
{ user_id: number }.
This function will panic if the type cannot be inlined.Source§fn inline_flattened(cfg: &Config) -> String
fn inline_flattened(cfg: &Config) -> String
Source§fn visit_generics(v: &mut impl TypeVisitor)where
Self: 'static,
fn visit_generics(v: &mut impl TypeVisitor)where
Self: 'static,
Source§fn output_path() -> Option<PathBuf>
fn output_path() -> Option<PathBuf>
T should be exported, relative to the output directory.
The returned path does not include any base directory. Read moreSource§fn visit_dependencies(v: &mut impl TypeVisitor)where
Self: 'static,
fn visit_dependencies(v: &mut impl TypeVisitor)where
Self: 'static,
Source§fn dependencies(cfg: &Config) -> Vec<Dependency>where
Self: 'static,
fn dependencies(cfg: &Config) -> Vec<Dependency>where
Self: 'static,
Source§fn export(cfg: &Config) -> Result<(), ExportError>where
Self: 'static,
fn export(cfg: &Config) -> Result<(), ExportError>where
Self: 'static,
TS::export_all. Read moreSource§fn export_all(cfg: &Config) -> Result<(), ExportError>where
Self: 'static,
fn export_all(cfg: &Config) -> Result<(), ExportError>where
Self: 'static,
TS::export. Read more