pub enum UserInput {
Text {
text: String,
text_elements: Vec<TextElement>,
},
Image {
detail: Option<ImageDetail>,
url: String,
},
LocalImage {
detail: Option<ImageDetail>,
path: String,
},
Skill {
name: String,
path: String,
},
Mention {
name: String,
path: String,
},
}Expand description
UserInput
JSON schema
{
"oneOf": [
{
"title": "TextUserInput",
"type": "object",
"required": [
"text",
"type"
],
"properties": {
"text": {
"type": "string"
},
"text_elements": {
"description": "UI-defined spans within `text` used to render or persist special elements.",
"default": [],
"type": "array",
"items": {
"$ref": "#/definitions/TextElement"
}
},
"type": {
"title": "TextUserInputType",
"type": "string",
"enum": [
"text"
]
}
}
},
{
"title": "ImageUserInput",
"type": "object",
"required": [
"type",
"url"
],
"properties": {
"detail": {
"default": null,
"anyOf": [
{
"$ref": "#/definitions/ImageDetail"
},
{
"type": "null"
}
]
},
"type": {
"title": "ImageUserInputType",
"type": "string",
"enum": [
"image"
]
},
"url": {
"type": "string"
}
}
},
{
"title": "LocalImageUserInput",
"type": "object",
"required": [
"path",
"type"
],
"properties": {
"detail": {
"default": null,
"anyOf": [
{
"$ref": "#/definitions/ImageDetail"
},
{
"type": "null"
}
]
},
"path": {
"type": "string"
},
"type": {
"title": "LocalImageUserInputType",
"type": "string",
"enum": [
"localImage"
]
}
}
},
{
"title": "SkillUserInput",
"type": "object",
"required": [
"name",
"path",
"type"
],
"properties": {
"name": {
"type": "string"
},
"path": {
"type": "string"
},
"type": {
"title": "SkillUserInputType",
"type": "string",
"enum": [
"skill"
]
}
}
},
{
"title": "MentionUserInput",
"type": "object",
"required": [
"name",
"path",
"type"
],
"properties": {
"name": {
"type": "string"
},
"path": {
"type": "string"
},
"type": {
"title": "MentionUserInputType",
"type": "string",
"enum": [
"mention"
]
}
}
}
]
}Variants§
Text
TextUserInput
Fields
§
text_elements: Vec<TextElement>UI-defined spans within text used to render or persist special elements.
Image
ImageUserInput
LocalImage
LocalImageUserInput
Skill
SkillUserInput
Mention
MentionUserInput
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for UserInput
impl<'de> Deserialize<'de> for UserInput
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 UserInput
impl RefUnwindSafe for UserInput
impl Send for UserInput
impl Sync for UserInput
impl Unpin for UserInput
impl UnsafeUnpin for UserInput
impl UnwindSafe for UserInput
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