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>) -> AgentResponse
pub fn plain(text: impl Into<String>) -> AgentResponse
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<AgentResponse, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<AgentResponse, <__D as Deserializer<'de>>::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 ==.Source§impl Serialize for AgentResponse
impl Serialize for AgentResponse
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for AgentResponse
Auto Trait Implementations§
impl Freeze 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.