#[non_exhaustive]pub enum SamplingMessageContentBlock {
Text(TextContent),
Image(ImageContent),
Audio(AudioContent),
ToolUse(ToolUseContent),
ToolResult(ToolResultContent),
}Sampling is deprecated by SEP-2577 and will be removed in a future release. See https://github.com/modelcontextprotocol/modelcontextprotocol/pull/2577
Expand description
Content types for sampling messages (SEP-1577).
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Text(TextContent)
Sampling is deprecated by SEP-2577 and will be removed in a future release. See https://github.com/modelcontextprotocol/modelcontextprotocol/pull/2577
Image(ImageContent)
Sampling is deprecated by SEP-2577 and will be removed in a future release. See https://github.com/modelcontextprotocol/modelcontextprotocol/pull/2577
Audio(AudioContent)
Sampling is deprecated by SEP-2577 and will be removed in a future release. See https://github.com/modelcontextprotocol/modelcontextprotocol/pull/2577
ToolUse(ToolUseContent)
Sampling is deprecated by SEP-2577 and will be removed in a future release. See https://github.com/modelcontextprotocol/modelcontextprotocol/pull/2577
Assistant only
ToolResult(ToolResultContent)
Sampling is deprecated by SEP-2577 and will be removed in a future release. See https://github.com/modelcontextprotocol/modelcontextprotocol/pull/2577
User only
Implementations§
Source§impl SamplingMessageContentBlock
impl SamplingMessageContentBlock
Sourcepub fn as_text(&self) -> Option<&TextContent>
pub fn as_text(&self) -> Option<&TextContent>
Get the text content if this is a Text variant
Sourcepub fn as_tool_use(&self) -> Option<&ToolUseContent>
pub fn as_tool_use(&self) -> Option<&ToolUseContent>
Get the tool use content if this is a ToolUse variant
Sourcepub fn as_tool_result(&self) -> Option<&ToolResultContent>
pub fn as_tool_result(&self) -> Option<&ToolResultContent>
Get the tool result content if this is a ToolResult variant
Trait Implementations§
Source§impl Clone for SamplingMessageContentBlock
impl Clone for SamplingMessageContentBlock
Source§impl Debug for SamplingMessageContentBlock
impl Debug for SamplingMessageContentBlock
Source§impl<'de> Deserialize<'de> for SamplingMessageContentBlock
impl<'de> Deserialize<'de> for SamplingMessageContentBlock
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>,
Source§impl From<&str> for SamplingMessageContentBlock
impl From<&str> for SamplingMessageContentBlock
Source§impl From<String> for SamplingMessageContentBlock
impl From<String> for SamplingMessageContentBlock
Source§impl From<TextContent> for SamplingMessageContentBlock
impl From<TextContent> for SamplingMessageContentBlock
Source§fn from(text: TextContent) -> Self
fn from(text: TextContent) -> Self
Source§impl JsonSchema for SamplingMessageContentBlock
Available on crate feature schemars only.
impl JsonSchema for SamplingMessageContentBlock
schemars only.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