pub struct InteractionResponse {
pub request_id: String,
pub value: Option<String>,
pub choice_index: Option<usize>,
pub approved: Option<bool>,
pub scope: Option<ApprovalScope>,
pub feedback: Option<String>,
pub parts: Vec<InboundPart>,
}Expand description
A response written by the dashboard (or lev respond) to answer the worker.
Fields§
§request_id: StringMust match InteractionRequest.id.
value: Option<String>The user’s free-text value (FreeText / InteractionPoints).
choice_index: Option<usize>Index into options for MultipleChoice / ToolApproval.
approved: Option<bool>Whether a ToolApproval was granted.
scope: Option<ApprovalScope>Scope of a tool approval decision.
feedback: Option<String>What the person wants the model to do instead, on a denied tool approval. Reaches the model as part of the tool result.
Absent (the default) is the plain deny every existing client sends, so
an answer written before this field existed still means what it meant.
Only ever read alongside approved: Some(false): a grant has nothing to
redirect.
parts: Vec<InboundPart>Files attached to a text answer: what lev respond --attach and a
@path in a dashboard reply send. The run stores each one and
writes it beside the answer’s text in the tool result. Absent on
every answer written before parts existed, and on every answer that
is not text.
Implementations§
Source§impl InteractionResponse
impl InteractionResponse
Sourcepub fn with_parts(self, parts: Vec<InboundPart>) -> Self
pub fn with_parts(self, parts: Vec<InboundPart>) -> Self
The same answer, with files attached.
Sourcepub fn text(request_id: impl Into<String>, value: impl Into<String>) -> Self
pub fn text(request_id: impl Into<String>, value: impl Into<String>) -> Self
Build a simple text response.
Sourcepub fn choice(request_id: impl Into<String>, index: usize) -> Self
pub fn choice(request_id: impl Into<String>, index: usize) -> Self
Build a choice response (0-based index).
Sourcepub fn approval(
request_id: impl Into<String>,
approved: bool,
scope: ApprovalScope,
) -> Self
pub fn approval( request_id: impl Into<String>, approved: bool, scope: ApprovalScope, ) -> Self
Build an approval response.
Sourcepub fn deny_with_feedback(request_id: impl Into<String>, feedback: &str) -> Self
pub fn deny_with_feedback(request_id: impl Into<String>, feedback: &str) -> Self
Build a deny that tells the model what to do instead.
The text is trimmed, and an answer that is all whitespace is the plain deny: the tool result must not carry an empty “Feedback:” for the model to puzzle over.
Sourcepub fn deny_feedback(&self) -> Option<&str>
pub fn deny_feedback(&self) -> Option<&str>
The redirect a denied tool approval carries, if the person wrote one.
None on a grant, whatever the field says: feedback beside
approved: true is a client bug, and the model must not be told the
call it just ran was refused.
Trait Implementations§
Source§impl Clone for InteractionResponse
impl Clone for InteractionResponse
Source§fn clone(&self) -> InteractionResponse
fn clone(&self) -> InteractionResponse
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more