pub enum ModelOutputStart {
Text {
language: Option<LanguageTag>,
metadata: ContentMetadata,
},
Json {
schema: Option<SchemaReference>,
metadata: ContentMetadata,
},
Artifact(Box<ArtifactRef>),
ReasoningSummary {
language: Option<LanguageTag>,
metadata: ContentMetadata,
},
ToolCall {
tool: CapabilityIdentity,
provider_call_id: Option<ModelProviderToolCallId>,
extensions: Extensions,
},
}Expand description
Header that fixes the type and immutable metadata of one streamed output.
Text, JSON, reasoning, and tool arguments arrive through subsequent deltas.
Artifact bytes never cross this boundary: an artifact start carries only a
complete immutable ArtifactRef.
Variants§
Text
User-visible text header.
Fields
language: Option<LanguageTag>Optional stable language tag for the completed text.
metadata: ContentMetadataMandatory model-source, untrusted security metadata.
Json
Structured JSON header.
Fields
schema: Option<SchemaReference>Optional digest-pinned schema identity asserted for the completed value.
metadata: ContentMetadataMandatory model-source, untrusted security metadata.
Artifact(Box<ArtifactRef>)
Complete immutable artifact reference; no inline deltas are accepted.
ReasoningSummary
Human-readable reasoning-summary header, never hidden chain of thought.
Fields
language: Option<LanguageTag>Optional stable language tag for the completed summary.
metadata: ContentMetadataMandatory model-source, untrusted security metadata.
ToolCall
Complete identity header for an unapproved model tool-call proposal.
Fields
tool: CapabilityIdentityExact requested, owner-qualified tool identity.
provider_call_id: Option<ModelProviderToolCallId>Optional opaque provider correlation identifier.
extensions: ExtensionsRegistered bounded proposal extensions.
Implementations§
Source§impl ModelOutputStart
impl ModelOutputStart
Sourcepub fn text(
language: Option<LanguageTag>,
metadata: ContentMetadata,
) -> Result<Self, ModelOutputItemError>
pub fn text( language: Option<LanguageTag>, metadata: ContentMetadata, ) -> Result<Self, ModelOutputItemError>
Constructs a validated user-visible text header.
Sourcepub fn json(
schema: Option<SchemaReference>,
metadata: ContentMetadata,
) -> Result<Self, ModelOutputItemError>
pub fn json( schema: Option<SchemaReference>, metadata: ContentMetadata, ) -> Result<Self, ModelOutputItemError>
Constructs a validated structured JSON header.
Sourcepub fn artifact(artifact: ArtifactRef) -> Result<Self, ModelOutputItemError>
pub fn artifact(artifact: ArtifactRef) -> Result<Self, ModelOutputItemError>
Constructs a validated immutable artifact header.
Sourcepub fn reasoning_summary(
language: Option<LanguageTag>,
metadata: ContentMetadata,
) -> Result<Self, ModelOutputItemError>
pub fn reasoning_summary( language: Option<LanguageTag>, metadata: ContentMetadata, ) -> Result<Self, ModelOutputItemError>
Constructs a validated readable reasoning-summary header.
Sourcepub fn tool_call(
tool: CapabilityIdentity,
provider_call_id: Option<ModelProviderToolCallId>,
extensions: Extensions,
) -> Self
pub fn tool_call( tool: CapabilityIdentity, provider_call_id: Option<ModelProviderToolCallId>, extensions: Extensions, ) -> Self
Constructs a tool-call header whose arguments will arrive as JSON deltas.
Sourcepub const fn kind(&self) -> ModelOutputItemKind
pub const fn kind(&self) -> ModelOutputItemKind
Returns the final response-item classification.
Sourcepub const fn delta_kind(&self) -> Option<ModelOutputDeltaKind>
pub const fn delta_kind(&self) -> Option<ModelOutputDeltaKind>
Returns the only accepted delta classification, or None for artifacts.
Trait Implementations§
Source§impl Clone for ModelOutputStart
impl Clone for ModelOutputStart
Source§impl Debug for ModelOutputStart
impl Debug for ModelOutputStart
Source§impl<'de> Deserialize<'de> for ModelOutputStart
impl<'de> Deserialize<'de> for ModelOutputStart
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>,
impl Eq for ModelOutputStart
Source§impl JsonSchema for ModelOutputStart
impl JsonSchema for ModelOutputStart
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read more