pub struct AudioContent {
pub data: Bytes,
pub mime: String,
pub annotations: Option<Annotations>,
pub meta: Option<Value>,
}Expand description
Audio provided to or from an LLM.
See the schema for details
Fields§
§data: BytesRaw audio data.
Note: will be serialized as a base64-encoded string
mime: StringThe MIME type of the audio content, e.g. “audio/mpeg” or “audio/wav”.
annotations: Option<Annotations>Optional annotations for the client.
meta: Option<Value>Metadata reserved by MCP for protocol-level metadata.
Implementations§
Source§impl AudioContent
impl AudioContent
Sourcepub fn new(data: impl Into<Bytes>) -> Self
pub fn new(data: impl Into<Bytes>) -> Self
Creates a new AudioContent
Sourcepub fn with_annotations<F>(self, config: F) -> Self
pub fn with_annotations<F>(self, config: F) -> Self
Sets annotations for the client
Sourcepub fn into_stream(self) -> impl Stream<Item = Bytes>
pub fn into_stream(self) -> impl Stream<Item = Bytes>
Turns this AudioContent into a chunked stream of bytes
Trait Implementations§
Source§impl Clone for AudioContent
impl Clone for AudioContent
Source§fn clone(&self) -> AudioContent
fn clone(&self) -> AudioContent
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AudioContent
impl Debug for AudioContent
Source§impl<'de> Deserialize<'de> for AudioContent
impl<'de> Deserialize<'de> for AudioContent
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 From<AudioContent> for Content
impl From<AudioContent> for Content
Source§fn from(value: AudioContent) -> Self
fn from(value: AudioContent) -> Self
Converts to this type from the input type.
Source§impl Serialize for AudioContent
impl Serialize for AudioContent
Auto Trait Implementations§
impl !Freeze for AudioContent
impl RefUnwindSafe for AudioContent
impl Send for AudioContent
impl Sync for AudioContent
impl Unpin for AudioContent
impl UnwindSafe for AudioContent
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)