pub struct Artifact {
pub id: String,
pub name: Option<String>,
pub description: Option<String>,
pub parts: Vec<Part>,
pub index: Option<u32>,
pub metadata: Option<HashMap<String, Value>>,
}Expand description
A tangible output generated by a task
Fields§
§id: StringUnique artifact identifier
name: Option<String>Human-readable name
description: Option<String>Description of the artifact
parts: Vec<Part>Content parts
index: Option<u32>Index for ordering multiple artifacts
metadata: Option<HashMap<String, Value>>Custom metadata
Implementations§
Source§impl Artifact
impl Artifact
Sourcepub fn text(id: impl Into<String>, text: impl Into<String>) -> Self
pub fn text(id: impl Into<String>, text: impl Into<String>) -> Self
Create a new artifact with text content
Sourcepub fn file(id: impl Into<String>, file: FileContent) -> Self
pub fn file(id: impl Into<String>, file: FileContent) -> Self
Create a new artifact with file content
Sourcepub fn with_description(self, description: impl Into<String>) -> Self
pub fn with_description(self, description: impl Into<String>) -> Self
Add a description to the artifact
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Artifact
impl<'de> Deserialize<'de> for Artifact
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
Auto Trait Implementations§
impl Freeze for Artifact
impl RefUnwindSafe for Artifact
impl Send for Artifact
impl Sync for Artifact
impl Unpin for Artifact
impl UnsafeUnpin for Artifact
impl UnwindSafe for Artifact
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