pub enum ResponseItem {
Show 17 variants
AdditionalTools {
id: Option<ResponseItemId>,
role: String,
tools: Vec<Value>,
},
Message {
id: Option<ResponseItemId>,
role: String,
content: Vec<ContentItem>,
phase: Option<MessagePhase>,
internal_chat_message_metadata_passthrough: Option<InternalChatMessageMetadataPassthrough>,
},
AgentMessage {
id: Option<ResponseItemId>,
author: String,
recipient: String,
content: Vec<AgentMessageInputContent>,
internal_chat_message_metadata_passthrough: Option<InternalChatMessageMetadataPassthrough>,
},
Reasoning {
id: Option<ResponseItemId>,
summary: Vec<ReasoningItemReasoningSummary>,
content: Option<Vec<ReasoningItemContent>>,
encrypted_content: Option<String>,
internal_chat_message_metadata_passthrough: Option<InternalChatMessageMetadataPassthrough>,
},
LocalShellCall {
id: Option<ResponseItemId>,
call_id: Option<String>,
status: LocalShellStatus,
action: LocalShellAction,
internal_chat_message_metadata_passthrough: Option<InternalChatMessageMetadataPassthrough>,
},
FunctionCall {
id: Option<ResponseItemId>,
name: String,
namespace: Option<String>,
arguments: String,
call_id: String,
internal_chat_message_metadata_passthrough: Option<InternalChatMessageMetadataPassthrough>,
},
ToolSearchCall {
id: Option<ResponseItemId>,
call_id: Option<String>,
status: Option<String>,
execution: String,
arguments: Value,
internal_chat_message_metadata_passthrough: Option<InternalChatMessageMetadataPassthrough>,
},
FunctionCallOutput {
id: Option<ResponseItemId>,
call_id: String,
output: FunctionCallOutputPayload,
internal_chat_message_metadata_passthrough: Option<InternalChatMessageMetadataPassthrough>,
},
CustomToolCall {
id: Option<ResponseItemId>,
status: Option<String>,
call_id: String,
name: String,
namespace: Option<String>,
input: String,
internal_chat_message_metadata_passthrough: Option<InternalChatMessageMetadataPassthrough>,
},
CustomToolCallOutput {
id: Option<ResponseItemId>,
call_id: String,
name: Option<String>,
output: FunctionCallOutputPayload,
internal_chat_message_metadata_passthrough: Option<InternalChatMessageMetadataPassthrough>,
},
ToolSearchOutput {
id: Option<ResponseItemId>,
call_id: Option<String>,
status: String,
execution: String,
tools: Vec<Value>,
internal_chat_message_metadata_passthrough: Option<InternalChatMessageMetadataPassthrough>,
},
WebSearchCall {
id: Option<ResponseItemId>,
status: Option<String>,
action: Option<WebSearchAction>,
internal_chat_message_metadata_passthrough: Option<InternalChatMessageMetadataPassthrough>,
},
ImageGenerationCall {
id: Option<ResponseItemId>,
status: String,
revised_prompt: Option<String>,
result: String,
internal_chat_message_metadata_passthrough: Option<InternalChatMessageMetadataPassthrough>,
},
Compaction {
id: Option<ResponseItemId>,
encrypted_content: String,
internal_chat_message_metadata_passthrough: Option<InternalChatMessageMetadataPassthrough>,
},
CompactionTrigger {},
ContextCompaction {
id: Option<ResponseItemId>,
encrypted_content: Option<String>,
internal_chat_message_metadata_passthrough: Option<InternalChatMessageMetadataPassthrough>,
},
Other,
}Variants§
AdditionalTools
Message
Fields
§
id: Option<ResponseItemId>§
content: Vec<ContentItem>§
phase: Option<MessagePhase>§
internal_chat_message_metadata_passthrough: Option<InternalChatMessageMetadataPassthrough>AgentMessage
Fields
§
id: Option<ResponseItemId>§
content: Vec<AgentMessageInputContent>§
internal_chat_message_metadata_passthrough: Option<InternalChatMessageMetadataPassthrough>Reasoning
Fields
§
id: Option<ResponseItemId>§
summary: Vec<ReasoningItemReasoningSummary>§
content: Option<Vec<ReasoningItemContent>>§
internal_chat_message_metadata_passthrough: Option<InternalChatMessageMetadataPassthrough>LocalShellCall
Fields
§
id: Option<ResponseItemId>Legacy id field retained for compatibility with older payloads.
§
status: LocalShellStatus§
action: LocalShellAction§
internal_chat_message_metadata_passthrough: Option<InternalChatMessageMetadataPassthrough>FunctionCall
Fields
§
id: Option<ResponseItemId>§
internal_chat_message_metadata_passthrough: Option<InternalChatMessageMetadataPassthrough>ToolSearchCall
Fields
§
id: Option<ResponseItemId>§
internal_chat_message_metadata_passthrough: Option<InternalChatMessageMetadataPassthrough>FunctionCallOutput
Fields
§
id: Option<ResponseItemId>§
output: FunctionCallOutputPayload§
internal_chat_message_metadata_passthrough: Option<InternalChatMessageMetadataPassthrough>CustomToolCall
Fields
§
id: Option<ResponseItemId>§
internal_chat_message_metadata_passthrough: Option<InternalChatMessageMetadataPassthrough>CustomToolCallOutput
Fields
§
id: Option<ResponseItemId>§
output: FunctionCallOutputPayload§
internal_chat_message_metadata_passthrough: Option<InternalChatMessageMetadataPassthrough>ToolSearchOutput
Fields
§
id: Option<ResponseItemId>§
internal_chat_message_metadata_passthrough: Option<InternalChatMessageMetadataPassthrough>WebSearchCall
Fields
§
id: Option<ResponseItemId>§
action: Option<WebSearchAction>§
internal_chat_message_metadata_passthrough: Option<InternalChatMessageMetadataPassthrough>ImageGenerationCall
Fields
§
id: Option<ResponseItemId>§
internal_chat_message_metadata_passthrough: Option<InternalChatMessageMetadataPassthrough>Compaction
Fields
§
id: Option<ResponseItemId>§
internal_chat_message_metadata_passthrough: Option<InternalChatMessageMetadataPassthrough>CompactionTrigger
ContextCompaction
Fields
§
id: Option<ResponseItemId>§
internal_chat_message_metadata_passthrough: Option<InternalChatMessageMetadataPassthrough>Other
Implementations§
Source§impl ResponseItem
impl ResponseItem
Sourcepub fn is_user_message(&self) -> bool
pub fn is_user_message(&self) -> bool
Returns whether this item is an ordinary user-role message.
Sourcepub fn id(&self) -> Option<&ResponseItemId>
pub fn id(&self) -> Option<&ResponseItemId>
Returns the Responses API item ID, if present.
Sourcepub fn set_id(&mut self, new_id: Option<ResponseItemId>)
pub fn set_id(&mut self, new_id: Option<ResponseItemId>)
Sets or clears the Responses API item ID for variants that carry one.
Sourcepub fn id_prefix(&self) -> Option<&'static str>
pub fn id_prefix(&self) -> Option<&'static str>
Returns the Responses API item ID prefix for variants that carry an ID.
Sourcepub fn turn_id(&self) -> Option<&str>
pub fn turn_id(&self) -> Option<&str>
Returns the non-empty turn ID stamped onto this item, if present.
Sourcepub fn set_turn_id_if_missing(&mut self, turn_id: &str)
pub fn set_turn_id_if_missing(&mut self, turn_id: &str)
Stamps the item with turn_id unless it already has a non-empty turn ID.
Sourcepub fn clear_internal_chat_message_metadata_passthrough(&mut self)
pub fn clear_internal_chat_message_metadata_passthrough(&mut self)
Removes internal chat message metadata passthrough before sending to a provider that does not accept it.
Trait Implementations§
Source§impl Clone for ResponseItem
impl Clone for ResponseItem
Source§fn clone(&self) -> ResponseItem
fn clone(&self) -> ResponseItem
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ResponseItem
impl Debug for ResponseItem
Source§impl<'de> Deserialize<'de> for ResponseItem
impl<'de> Deserialize<'de> for ResponseItem
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<CompactedItem> for ResponseItem
impl From<CompactedItem> for ResponseItem
Source§fn from(value: CompactedItem) -> Self
fn from(value: CompactedItem) -> Self
Converts to this type from the input type.
Source§impl From<ResponseInputItem> for ResponseItem
impl From<ResponseInputItem> for ResponseItem
Source§fn from(item: ResponseInputItem) -> Self
fn from(item: ResponseInputItem) -> Self
Converts to this type from the input type.
Source§impl JsonSchema for ResponseItem
impl JsonSchema for ResponseItem
Source§fn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. Read more
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
Whether JSON Schemas generated for this type should be re-used where possible using the
$ref keyword. Read moreSource§impl PartialEq for ResponseItem
impl PartialEq for ResponseItem
Source§impl Serialize for ResponseItem
impl Serialize for ResponseItem
impl StructuralPartialEq for ResponseItem
Source§impl TS for ResponseItem
impl TS for ResponseItem
Source§type WithoutGenerics = ResponseItem
type WithoutGenerics = ResponseItem
If this type does not have generic parameters, then
WithoutGenerics should just be Self.
If the type does have generic parameters, then all generic parameters must be replaced with
a dummy type, e.g ts_rs::Dummy or ().
The only requirement for these dummy types is that EXPORT_TO must be None. Read moreSource§type OptionInnerType = ResponseItem
type OptionInnerType = ResponseItem
If the implementing type is
std::option::Option<T>, then this associated type is set to T.
All other implementations of TS should set this type to Self instead.Source§fn decl_concrete() -> String
fn decl_concrete() -> String
Declaration of this type using the supplied generic arguments.
The resulting TypeScript definition will not be generic. For that, see
TS::decl().
If this type is not generic, then this function is equivalent to TS::decl().Source§fn decl() -> String
fn decl() -> String
Declaration of this type, e.g.
type User = { user_id: number, ... }.
This function will panic if the type has no declaration. Read moreSource§fn inline() -> String
fn inline() -> String
Formats this types definition in TypeScript, e.g
{ user_id: number }.
This function will panic if the type cannot be inlined.Source§fn inline_flattened() -> String
fn inline_flattened() -> String
Flatten a type declaration.
This function will panic if the type cannot be flattened.
This function will panic if the type cannot be flattened.
Source§fn visit_generics(v: &mut impl TypeVisitor)where
Self: 'static,
fn visit_generics(v: &mut impl TypeVisitor)where
Self: 'static,
Iterates over all type parameters of this type.
Source§fn output_path() -> Option<PathBuf>
fn output_path() -> Option<PathBuf>
Returns the output path to where
The returned path does not include the base directory from
T should be exported.The returned path does not include the base directory from
TS_RS_EXPORT_DIR. Read moreSource§fn visit_dependencies(v: &mut impl TypeVisitor)where
Self: 'static,
fn visit_dependencies(v: &mut impl TypeVisitor)where
Self: 'static,
Iterates over all dependency of this type.
Source§fn docs() -> Option<String>
fn docs() -> Option<String>
JSDoc comment to describe this type in TypeScript - when
TS is derived, docs are
automatically read from your doc comments or #[doc = ".."] attributesSource§fn dependencies() -> Vec<Dependency>where
Self: 'static,
fn dependencies() -> Vec<Dependency>where
Self: 'static,
Resolves all dependencies of this type recursively.
Source§fn export() -> Result<(), ExportError>where
Self: 'static,
fn export() -> Result<(), ExportError>where
Self: 'static,
Manually export this type to the filesystem.
To export this type together with all of its dependencies, use
TS::export_all. Read moreSource§fn export_all() -> Result<(), ExportError>where
Self: 'static,
fn export_all() -> Result<(), ExportError>where
Self: 'static,
Manually export this type to the filesystem, together with all of its dependencies.
To export only this type, without its dependencies, use
To export only this type, without its dependencies, use
TS::export. Read moreSource§fn export_all_to(out_dir: impl AsRef<Path>) -> Result<(), ExportError>where
Self: 'static,
fn export_all_to(out_dir: impl AsRef<Path>) -> Result<(), ExportError>where
Self: 'static,
Manually export this type into the given directory, together with all of its dependencies.
To export only this type, without its dependencies, use
To export only this type, without its dependencies, use
TS::export. Read moreSource§fn export_to_string() -> Result<String, ExportError>where
Self: 'static,
fn export_to_string() -> Result<String, ExportError>where
Self: 'static,
Auto Trait Implementations§
impl Freeze for ResponseItem
impl RefUnwindSafe for ResponseItem
impl Send for ResponseItem
impl Sync for ResponseItem
impl Unpin for ResponseItem
impl UnsafeUnpin for ResponseItem
impl UnwindSafe for ResponseItem
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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>,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more