pub struct GenerateTextResult {Show 15 fields
pub text: String,
pub tool_calls: Vec<ToolCall>,
pub finish_reason: FinishReason,
pub usage: Usage,
pub warnings: Vec<Warning>,
pub raw: GenerateResult,
pub reasoning: Vec<ReasoningPart>,
pub reasoning_text: String,
pub sources: Vec<SourcePart>,
pub files: Vec<FilePart>,
pub response_messages: Vec<ModelMessage>,
pub raw_finish_reason: Option<String>,
pub provider_metadata: Option<Value>,
pub response: ResponseMetadata,
pub total_usage: Usage,
}Expand description
Result of generate_text (user-facing).
Fields§
§text: StringThe generated text (concatenated from all text content parts).
tool_calls: Vec<ToolCall>Tool calls requested by the model.
finish_reason: FinishReasonWhy generation stopped.
usage: UsageToken usage.
warnings: Vec<Warning>Warnings from the provider.
raw: GenerateResultRaw provider result (for advanced use).
reasoning: Vec<ReasoningPart>Reasoning / thinking segments from the model.
reasoning_text: StringConcatenated reasoning text (convenience for reasoning.iter().map(text).join("")).
sources: Vec<SourcePart>Sources / citations (search-preview models).
files: Vec<FilePart>Files generated by the model.
response_messages: Vec<ModelMessage>Assistant messages ready to append to the prompt for the next turn (solves the multi-turn “manually build assistant message” footgun).
raw_finish_reason: Option<String>The raw provider-specific finish reason string (e.g. “stop”,
“end_turn”, “safety”). Useful when finish_reason.unified is Other.
provider_metadata: Option<Value>Provider-specific metadata (e.g. Anthropic cache info). Mirrored from
raw.provider_metadata for top-level convenience.
response: ResponseMetadataResponse metadata (id, timestamp, model_id). Mirrored from
raw.response for top-level convenience.
total_usage: UsageTotal token usage across all steps. In single-step mode (aimux’s
default), total_usage equals usage. Provided for AI SDK parity.
Trait Implementations§
Source§impl Debug for GenerateTextResult
impl Debug for GenerateTextResult
Source§impl<'de> Deserialize<'de> for GenerateTextResult
impl<'de> Deserialize<'de> for GenerateTextResult
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 GenerateTextResult
impl Serialize for GenerateTextResult
Source§impl TS for GenerateTextResult
impl TS for GenerateTextResult
Source§type WithoutGenerics = GenerateTextResult
type WithoutGenerics = GenerateTextResult
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 = GenerateTextResult
type OptionInnerType = GenerateTextResult
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