pub struct AgentResponse {
pub answer: String,
pub questions: Vec<QuestionItem>,
pub summary: Option<AgentResponseSummary>,
}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.
summary: Option<AgentResponseSummary>Structured summary for session-discussion turns, or None for legacy
payloads and one-shot prompts.
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§fn clone(&self) -> AgentResponse
fn clone(&self) -> AgentResponse
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§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§fn eq(&self, other: &AgentResponse) -> bool
fn eq(&self, other: &AgentResponse) -> bool
self and other values to be equal, and is used by ==.