pub struct AgentResponse {
pub answer: String,
pub questions: Vec<QuestionItem>,
pub review_comment_outcomes: Vec<ReviewCommentOutcome>,
}Expand description
Wire-format protocol payload used for schema-driven provider output.
Providers that support output schemas (for example, Codex app-server) are asked to emit this object as the entire assistant response payload.
Fields§
§answer: StringMarkdown answer text emitted for this turn.
questions: Vec<QuestionItem>Ordered clarification questions emitted for this turn.
The canonical JSON Schema description for this field is produced by
[questions_field_description] and injected at schema generation time
by inject_dynamic_schema_guidance. The static schemars metadata
here only sets the field title; the description is intentionally
omitted so the helper is the single source of truth.
review_comment_outcomes: Vec<ReviewCommentOutcome>Per-thread outcomes for an agent-driven forge comment-resolution turn.
Ordinary session and utility turns leave this empty. Resolution workflows accept only identifiers explicitly allowlisted in the turn prompt before applying any forge-side effect.
Implementations§
Source§impl AgentResponse
impl AgentResponse
Sourcepub fn plain(text: impl Into<String>) -> Self
pub fn plain(text: impl Into<String>) -> Self
Creates a plain response from raw text as one answer string.
Sourcepub fn to_display_text(&self) -> String
pub fn to_display_text(&self) -> String
Returns display text by joining non-empty answer and question text with blank lines.
Sourcepub fn to_answer_display_text(&self) -> String
pub fn to_answer_display_text(&self) -> String
Returns transcript text for session output by joining non-empty
answer content with blank lines.
Sourcepub fn answers(&self) -> Vec<String>
pub fn answers(&self) -> Vec<String>
Returns the answer as one single-item vector when it is non-empty.
Sourcepub fn question_items(&self) -> Vec<QuestionItem>
pub fn question_items(&self) -> Vec<QuestionItem>
Returns up to [MAX_QUESTIONS] clarification questions in response
order.
Trait Implementations§
Source§impl Clone for AgentResponse
impl Clone for AgentResponse
Source§impl Debug for AgentResponse
impl Debug for AgentResponse
Source§impl<'de> Deserialize<'de> for AgentResponse
impl<'de> Deserialize<'de> for AgentResponse
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>,
impl Eq for AgentResponse
Source§impl JsonSchema for AgentResponse
impl JsonSchema for AgentResponse
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreSource§impl PartialEq for AgentResponse
impl PartialEq for AgentResponse
Source§impl Serialize for AgentResponse
impl Serialize for AgentResponse
impl StructuralPartialEq for AgentResponse
Auto Trait Implementations§
impl Forget for AgentResponse
impl Freeze for AgentResponse
impl Move for AgentResponse
impl RefUnwindSafe for AgentResponse
impl Send for AgentResponse
impl Sync for AgentResponse
impl Unpin for AgentResponse
impl UnsafeUnpin for AgentResponse
impl UnwindSafe for AgentResponse
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.