#[non_exhaustive]pub struct ElicitationSchema {
pub type_: ElicitationSchemaType,
pub title: Option<String>,
pub properties: BTreeMap<String, ElicitationPropertySchema>,
pub required: Option<Vec<String>>,
pub description: Option<String>,
pub meta: Option<Meta>,
}unstable_elicitation and unstable_protocol_v2 only.Expand description
Type-safe elicitation schema for requesting structured user input.
This represents a JSON Schema object with primitive-typed properties, as required by the elicitation specification.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.type_: ElicitationSchemaTypeType discriminator. Always "object".
title: Option<String>Optional title for the schema.
properties: BTreeMap<String, ElicitationPropertySchema>Property definitions (must be primitive types).
required: Option<Vec<String>>List of required property names.
description: Option<String>Optional description of what this schema represents.
meta: Option<Meta>The _meta property is reserved by ACP to allow clients and agents to attach additional metadata to their interactions. Implementations MUST NOT make assumptions about values at these keys.
See protocol docs: Extensibility
Implementations§
Source§impl ElicitationSchema
impl ElicitationSchema
Sourcepub fn title(self, title: impl IntoOption<String>) -> Self
pub fn title(self, title: impl IntoOption<String>) -> Self
Optional title for the schema.
Sourcepub fn description(self, description: impl IntoOption<String>) -> Self
pub fn description(self, description: impl IntoOption<String>) -> Self
Optional description of what this schema represents.
Sourcepub fn meta(self, meta: impl IntoOption<Meta>) -> Self
pub fn meta(self, meta: impl IntoOption<Meta>) -> Self
The _meta property is reserved by ACP to allow clients and agents to attach additional metadata to their interactions. Implementations MUST NOT make assumptions about values at these keys.
See protocol docs: Extensibility
Sourcepub fn property<S>(
self,
name: impl Into<String>,
schema: S,
required: bool,
) -> Selfwhere
S: Into<ElicitationPropertySchema>,
pub fn property<S>(
self,
name: impl Into<String>,
schema: S,
required: bool,
) -> Selfwhere
S: Into<ElicitationPropertySchema>,
Add a property to the schema.
Sourcepub fn date_time(self, name: impl Into<String>, required: bool) -> Self
pub fn date_time(self, name: impl Into<String>, required: bool) -> Self
Add a date-time property.
Sourcepub fn number(
self,
name: impl Into<String>,
min: f64,
max: f64,
required: bool,
) -> Self
pub fn number( self, name: impl Into<String>, min: f64, max: f64, required: bool, ) -> Self
Add a number property with range.
Trait Implementations§
Source§impl Clone for ElicitationSchema
impl Clone for ElicitationSchema
Source§fn clone(&self) -> ElicitationSchema
fn clone(&self) -> ElicitationSchema
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ElicitationSchema
impl Debug for ElicitationSchema
Source§impl Default for ElicitationSchema
impl Default for ElicitationSchema
Source§impl<'de> Deserialize<'de> for ElicitationSchema
impl<'de> Deserialize<'de> for ElicitationSchema
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 IntoV1 for ElicitationSchema
impl IntoV1 for ElicitationSchema
Source§impl JsonSchema for ElicitationSchema
impl JsonSchema for ElicitationSchema
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 moreSource§impl PartialEq for ElicitationSchema
impl PartialEq for ElicitationSchema
Source§fn eq(&self, other: &ElicitationSchema) -> bool
fn eq(&self, other: &ElicitationSchema) -> bool
self and other values to be equal, and is used by ==.