pub struct Item {
pub id: Option<String>,
pub text: Option<String>,
pub images: Vec<ImageInput>,
pub audio: Option<AudioInput>,
pub video: Option<BinaryInput>,
pub document: Option<BinaryInput>,
pub metadata: Option<Value>,
}Expand description
One unit of input: text, images, audio, video or a document, in any combination the model accepts.
Fields§
§id: Option<String>Caller-chosen identifier, echoed back on the matching result.
text: Option<String>§images: Vec<ImageInput>§audio: Option<AudioInput>§video: Option<BinaryInput>§document: Option<BinaryInput>§metadata: Option<Value>Opaque metadata passed through to the model adapter.
Implementations§
Source§impl Item
impl Item
Sourcepub fn image(image: ImageInput) -> Self
pub fn image(image: ImageInput) -> Self
An item holding a single image.
Sourcepub fn with_id(self, id: impl Into<String>) -> Self
pub fn with_id(self, id: impl Into<String>) -> Self
Set the identifier echoed back on the result.
Sourcepub fn with_image(self, image: ImageInput) -> Self
pub fn with_image(self, image: ImageInput) -> Self
Append an image.
Sourcepub fn with_audio(self, audio: AudioInput) -> Self
pub fn with_audio(self, audio: AudioInput) -> Self
Attach audio.
Sourcepub fn with_video(self, video: BinaryInput) -> Self
pub fn with_video(self, video: BinaryInput) -> Self
Attach a video.
Sourcepub fn with_document(self, document: BinaryInput) -> Self
pub fn with_document(self, document: BinaryInput) -> Self
Attach a document.
Sourcepub fn with_metadata(self, metadata: Value) -> Self
pub fn with_metadata(self, metadata: Value) -> Self
Attach adapter metadata.
Trait Implementations§
impl StructuralPartialEq for Item
Auto Trait Implementations§
impl Freeze for Item
impl RefUnwindSafe for Item
impl Send for Item
impl Sync for Item
impl Unpin for Item
impl UnsafeUnpin for Item
impl UnwindSafe for Item
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