pub enum UserInput {
Text {
text: String,
},
Image {
data: String,
},
}Expand description
User input sent as part of a TurnStartParams.
§Example
use codex_codes::UserInput;
let text = UserInput::Text { text: "What is 2+2?".into() };
let json = serde_json::to_string(&text).unwrap();
assert!(json.contains(r#""type":"text""#));Variants§
Text
Text input from the user.
Image
Pre-encoded image as a data URI (e.g., data:image/png;base64,...).
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