pub struct InteractionRequest {
pub id: String,
pub kind: InteractionKind,
pub prompt: String,
pub options: Vec<String>,
pub tool_name: Option<String>,
pub tool_arguments: Option<Value>,
pub required: bool,
pub stage_name: String,
pub body: Option<String>,
pub body_format: BodyFormat,
}Expand description
A pending interaction request written by the worker.
Fields§
§id: StringUnique ID for this request (uuid-lite: timestamp + stage index).
kind: InteractionKindWhat kind of answer is expected.
prompt: StringPrompt text to display to the user.
options: Vec<String>Options for MultipleChoice (index-labelled).
tool_name: Option<String>For ToolApproval: the tool name.
tool_arguments: Option<Value>For ToolApproval: the tool arguments (JSON).
required: boolWhether an answer is mandatory (empty/cancel not allowed).
stage_name: StringStage name that triggered this request.
body: Option<String>Optional rich body (markdown document, plan, etc.) for the user to review.
body_format: BodyFormatFormat of the body content.
Implementations§
Source§impl InteractionRequest
impl InteractionRequest
Sourcepub fn free_text(
id: impl Into<String>,
prompt: impl Into<String>,
stage: impl Into<String>,
required: bool,
) -> Self
pub fn free_text( id: impl Into<String>, prompt: impl Into<String>, stage: impl Into<String>, required: bool, ) -> Self
Create a new free-text request.
Sourcepub fn review(
id: impl Into<String>,
title: impl Into<String>,
markdown: impl Into<String>,
stage: impl Into<String>,
) -> Self
pub fn review( id: impl Into<String>, title: impl Into<String>, markdown: impl Into<String>, stage: impl Into<String>, ) -> Self
Create a “present for review” request: pauses the run and shows a rich markdown document to the user before accepting feedback.
Sourcepub fn edit_text(
id: impl Into<String>,
prompt: impl Into<String>,
stage: impl Into<String>,
initial_content: impl Into<String>,
) -> Self
pub fn edit_text( id: impl Into<String>, prompt: impl Into<String>, stage: impl Into<String>, initial_content: impl Into<String>, ) -> Self
Create an “edit document” request: shows initial_content in an
editable field pre-seeded with it (via body); the user edits it and
the modified text is returned as the response text.
Sourcepub fn multiple_choice(
id: impl Into<String>,
prompt: impl Into<String>,
options: Vec<String>,
stage: impl Into<String>,
) -> Self
pub fn multiple_choice( id: impl Into<String>, prompt: impl Into<String>, options: Vec<String>, stage: impl Into<String>, ) -> Self
Create a new multiple-choice request.
Sourcepub fn confirm(
id: impl Into<String>,
prompt: impl Into<String>,
stage: impl Into<String>,
) -> Self
pub fn confirm( id: impl Into<String>, prompt: impl Into<String>, stage: impl Into<String>, ) -> Self
Create a new confirm request.
pub fn tool_approval( id: impl Into<String>, tool_name: impl Into<String>, arguments: Value, stage: impl Into<String>, ) -> Self
Trait Implementations§
Source§impl Clone for InteractionRequest
impl Clone for InteractionRequest
Source§fn clone(&self) -> InteractionRequest
fn clone(&self) -> InteractionRequest
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more