#[non_exhaustive]pub struct CreateResponseRequest {Show 18 fields
pub input: ResponseInput,
pub include: Option<Vec<Includable>>,
pub instructions: Option<String>,
pub max_output_tokens: Option<i32>,
pub metadata: Option<Metadata>,
pub model: ModelIdsResponses,
pub parallel_tool_calls: bool,
pub previous_response_id: Option<String>,
pub reasoning: Option<Reasoning>,
pub store: Option<bool>,
pub stream: Option<bool>,
pub temperature: Option<f32>,
pub text: Option<TextResponseFormatConfigurationOptions>,
pub tool_choice: Option<ToolChoice>,
pub tools: Option<Vec<Tool>>,
pub top_p: Option<f32>,
pub truncation: Option<String>,
pub user: Option<String>,
}Expand description
Represents the request body for creating a model response.
Corresponds to the request body of POST /responses.
§Used By
api::responses::Responses::create
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.input: ResponseInputText, image, or file inputs to the model.
include: Option<Vec<Includable>>Additional output data to include (e.g., “file_search_call.results”).
instructions: Option<String>System instructions for the model.
max_output_tokens: Option<i32>Maximum output tokens allowed.
metadata: Option<Metadata>Metadata associated with the request.
model: ModelIdsResponsesModel ID used to generate the response.
parallel_tool_calls: boolWhether to allow parallel tool calls. Defaults to true.
previous_response_id: Option<String>ID of the previous response in the conversation.
reasoning: Option<Reasoning>Reasoning configuration.
store: Option<bool>Whether to store the generated response. Defaults to true.
stream: Option<bool>Whether to stream the response. Defaults to false.
temperature: Option<f32>Sampling temperature.
text: Option<TextResponseFormatConfigurationOptions>Text response format configuration.
tool_choice: Option<ToolChoice>Strategy for choosing tools.
tools: Option<Vec<Tool>>List of available tools.
top_p: Option<f32>Nucleus sampling probability.
truncation: Option<String>Truncation strategy (“auto” or “disabled”).
user: Option<String>End-user identifier.
Implementations§
Source§impl CreateResponseRequest
impl CreateResponseRequest
Sourcepub fn former() -> CreateResponseRequestFormer<CreateResponseRequestFormerDefinition<(), CreateResponseRequest, ReturnPreformed>>
pub fn former() -> CreateResponseRequestFormer<CreateResponseRequestFormerDefinition<(), CreateResponseRequest, ReturnPreformed>>
Provides a mechanism to initiate the formation process with a default completion behavior.
Trait Implementations§
Source§impl Clone for CreateResponseRequest
impl Clone for CreateResponseRequest
Source§fn clone(&self) -> CreateResponseRequest
fn clone(&self) -> CreateResponseRequest
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl CreateResponseRequestEnhancements for CreateResponseRequest
impl CreateResponseRequestEnhancements for CreateResponseRequest
Source§fn with_simple_text(model: &str, text: &str) -> CreateResponseRequest
fn with_simple_text(model: &str, text: &str) -> CreateResponseRequest
Source§fn with_messages(
model: &str,
messages: Vec<InputMessage>,
) -> CreateResponseRequest
fn with_messages( model: &str, messages: Vec<InputMessage>, ) -> CreateResponseRequest
Source§fn validate_request(&self) -> Result<(), ResponseRequestValidationError>
fn validate_request(&self) -> Result<(), ResponseRequestValidationError>
Source§impl Debug for CreateResponseRequest
impl Debug for CreateResponseRequest
Source§impl<__Context, __Formed, __End> EntityToDefinition<__Context, __Formed, __End> for CreateResponseRequestwhere
__End: FormingEnd<CreateResponseRequestFormerDefinitionTypes<__Context, __Formed>>,
impl<__Context, __Formed, __End> EntityToDefinition<__Context, __Formed, __End> for CreateResponseRequestwhere
__End: FormingEnd<CreateResponseRequestFormerDefinitionTypes<__Context, __Formed>>,
Source§type Definition = CreateResponseRequestFormerDefinition<__Context, __Formed, __End>
type Definition = CreateResponseRequestFormerDefinition<__Context, __Formed, __End>
FormerDefinition associated with this entity. Read moreSource§type Types = CreateResponseRequestFormerDefinitionTypes<__Context, __Formed>
type Types = CreateResponseRequestFormerDefinitionTypes<__Context, __Formed>
FormerDefinitionTypes associated with this entity. Read moreSource§impl<__Context, __Formed> EntityToDefinitionTypes<__Context, __Formed> for CreateResponseRequest
impl<__Context, __Formed> EntityToDefinitionTypes<__Context, __Formed> for CreateResponseRequest
Source§impl<Definition> EntityToFormer<Definition> for CreateResponseRequestwhere
Definition: FormerDefinition<Storage = CreateResponseRequestFormerStorage>,
impl<Definition> EntityToFormer<Definition> for CreateResponseRequestwhere
Definition: FormerDefinition<Storage = CreateResponseRequestFormerStorage>,
Source§impl PartialEq for CreateResponseRequest
impl PartialEq for CreateResponseRequest
Source§impl Serialize for CreateResponseRequest
impl Serialize for CreateResponseRequest
impl StructuralPartialEq for CreateResponseRequest
Auto Trait Implementations§
impl Freeze for CreateResponseRequest
impl RefUnwindSafe for CreateResponseRequest
impl Send for CreateResponseRequest
impl Sync for CreateResponseRequest
impl Unpin for CreateResponseRequest
impl UnwindSafe for CreateResponseRequest
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,
Source§impl<C, E> EntryToVal<C> for Ewhere
C: Collection<Entry = E>,
impl<C, E> EntryToVal<C> for Ewhere
C: Collection<Entry = E>,
Source§type Val = <C as Collection>::Val
type Val = <C as Collection>::Val
Entry in complex collections.
For example, in a HashMap, while Entry might be a ( key, value ) tuple, Val might only be the value part.Source§fn entry_to_val(self) -> <E as EntryToVal<C>>::Val
fn entry_to_val(self) -> <E as EntryToVal<C>>::Val
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> IntoResult<T> for T
impl<T> IntoResult<T> for T
type Err = Infallible
fn into_result(self) -> Result<T, <T as IntoResult<T>>::Err>
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<C, Val> ValToEntry<C> for Valwhere
C: CollectionValToEntry<Val>,
impl<C, Val> ValToEntry<C> for Valwhere
C: CollectionValToEntry<Val>,
Source§fn val_to_entry(self) -> <C as CollectionValToEntry<Val>>::Entry
fn val_to_entry(self) -> <C as CollectionValToEntry<Val>>::Entry
Invokes the val_to_entry function of the CollectionValToEntry trait to convert the value to an entry.
Source§type Entry = <C as CollectionValToEntry<Val>>::Entry
type Entry = <C as CollectionValToEntry<Val>>::Entry
Entry is defined by the Collection trait.