pub enum SamplingContentBlock {
Text {
text: String,
annotations: Option<Annotations>,
meta: Option<OpenMetadata>,
additional: BTreeMap<String, Value>,
},
Image {
data: String,
mime_type: String,
annotations: Option<Annotations>,
meta: Option<OpenMetadata>,
additional: BTreeMap<String, Value>,
},
Audio {
data: String,
mime_type: String,
annotations: Option<Annotations>,
meta: Option<OpenMetadata>,
additional: BTreeMap<String, Value>,
},
ToolUse {
id: String,
name: String,
input: Map<String, Value>,
meta: Option<OpenMetadata>,
additional: BTreeMap<String, Value>,
},
ToolResult {
tool_use_id: String,
content: Vec<ContentBlock>,
is_error: Option<bool>,
structured_content: Option<Value>,
meta: Option<OpenMetadata>,
additional: BTreeMap<String, Value>,
},
}Expand description
Final sampling-only content blocks.
Tool use and tool result are intentionally absent from ContentBlock:
they are legal only in the final sampling message/result union. Tool result
bodies, in turn, use the general content union and therefore cannot nest
further tool-use/result blocks.
Variants§
Text
Text sampling content.
Image
Image sampling content.
Audio
Audio sampling content.
ToolUse
A requested assistant tool call.
Fields
§
meta: Option<OpenMetadata>ToolResult
A result for a preceding tool call.
Trait Implementations§
Source§impl Clone for SamplingContentBlock
impl Clone for SamplingContentBlock
Source§fn clone(&self) -> SamplingContentBlock
fn clone(&self) -> SamplingContentBlock
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SamplingContentBlock
impl Debug for SamplingContentBlock
Source§impl<'de> Deserialize<'de> for SamplingContentBlock
impl<'de> Deserialize<'de> for SamplingContentBlock
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for SamplingContentBlock
impl PartialEq for SamplingContentBlock
Source§impl Serialize for SamplingContentBlock
impl Serialize for SamplingContentBlock
impl StructuralPartialEq for SamplingContentBlock
Auto Trait Implementations§
impl Freeze for SamplingContentBlock
impl RefUnwindSafe for SamplingContentBlock
impl Send for SamplingContentBlock
impl Sync for SamplingContentBlock
impl Unpin for SamplingContentBlock
impl UnsafeUnpin for SamplingContentBlock
impl UnwindSafe for SamplingContentBlock
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, _span: NoopSpan) -> Self
fn instrument(self, _span: NoopSpan) -> Self
Instruments this future with a span (no-op when disabled).
Source§fn in_current_span(self) -> Self
fn in_current_span(self) -> Self
Instruments this future with the current span (no-op when disabled).