pub enum ComputerAction {
Click {
button: MouseButton,
x: i32,
y: i32,
keys: Option<Vec<String>>,
},
DoubleClick {
x: i32,
y: i32,
keys: Option<Vec<String>>,
},
Drag {
path: Vec<ComputerCoordinate>,
keys: Option<Vec<String>>,
},
Keypress {
keys: Vec<String>,
},
Move {
x: i32,
y: i32,
keys: Option<Vec<String>>,
},
Screenshot,
Scroll {
scroll_x: i32,
scroll_y: i32,
x: i32,
y: i32,
keys: Option<Vec<String>>,
},
Type {
text: String,
},
Wait,
}Expand description
Discriminated union of computer-use actions the model may emit.
Spec (openai-responses-api-spec.md §ComputerAction):
Click | DoubleClick | Drag | Keypress | Move | Screenshot | Scroll | Type | Wait.
Variants§
Click
{ type: "click", button, x, y, keys? }.
DoubleClick
{ type: "double_click", x, y, keys? }.
Drag
{ type: "drag", path, keys? }.
Keypress
{ type: "keypress", keys }.
Move
{ type: "move", x, y, keys? }.
Screenshot
{ type: "screenshot" }.
Scroll
{ type: "scroll", scroll_x, scroll_y, x, y, keys? }.
Type
{ type: "type", text }.
Wait
{ type: "wait" }.
Trait Implementations§
Source§impl Clone for ComputerAction
impl Clone for ComputerAction
Source§fn clone(&self) -> ComputerAction
fn clone(&self) -> ComputerAction
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ComputerAction
impl Debug for ComputerAction
Source§impl<'de> Deserialize<'de> for ComputerAction
impl<'de> Deserialize<'de> for ComputerAction
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 JsonSchema for ComputerAction
impl JsonSchema for ComputerAction
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreAuto Trait Implementations§
impl Freeze for ComputerAction
impl RefUnwindSafe for ComputerAction
impl Send for ComputerAction
impl Sync for ComputerAction
impl Unpin for ComputerAction
impl UnsafeUnpin for ComputerAction
impl UnwindSafe for ComputerAction
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