pub struct CreateResponseRequest {Show 28 fields
pub background: Option<bool>,
pub conversation: Option<Value>,
pub include: Option<Vec<String>>,
pub input: Option<Value>,
pub instructions: Option<String>,
pub max_output_tokens: Option<u32>,
pub max_tool_calls: Option<u32>,
pub metadata: Option<BTreeMap<String, String>>,
pub model: Option<String>,
pub parallel_tool_calls: Option<bool>,
pub previous_response_id: Option<String>,
pub prompt: Option<Value>,
pub prompt_cache_key: Option<String>,
pub reasoning: Option<Value>,
pub safety_identifier: Option<String>,
pub service_tier: Option<String>,
pub store: Option<bool>,
pub stream: Option<bool>,
pub stream_options: Option<Value>,
pub temperature: Option<f32>,
pub text: Option<Value>,
pub tool_choice: Option<Value>,
pub tools: Option<Vec<Tools>>,
pub top_logprobs: Option<u32>,
pub top_p: Option<f32>,
pub truncation: Option<String>,
pub user: Option<String>,
pub extra: BTreeMap<String, Value>,
}Fields§
§background: Option<bool>§conversation: Option<Value>§include: Option<Vec<String>>§input: Option<Value>§instructions: Option<String>§max_output_tokens: Option<u32>§max_tool_calls: Option<u32>§metadata: Option<BTreeMap<String, String>>§model: Option<String>§parallel_tool_calls: Option<bool>§previous_response_id: Option<String>§prompt: Option<Value>§prompt_cache_key: Option<String>§reasoning: Option<Value>§safety_identifier: Option<String>§service_tier: Option<String>§store: Option<bool>§stream: Option<bool>§stream_options: Option<Value>§temperature: Option<f32>§text: Option<Value>§tool_choice: Option<Value>§tools: Option<Vec<Tools>>§top_logprobs: Option<u32>§top_p: Option<f32>§truncation: Option<String>§user: Option<String>§extra: BTreeMap<String, Value>Implementations§
Source§impl CreateResponseRequest
impl CreateResponseRequest
Sourcepub fn new() -> Self
pub fn new() -> Self
Examples found in repository?
examples/responses.rs (line 12)
8async fn main() -> Result<(), Box<dyn std::error::Error>> {
9 let api_key = env::var("OPENAI_API_KEY").unwrap();
10 let mut client = OpenAIClient::builder().with_api_key(api_key).build()?;
11
12 let mut req = CreateResponseRequest::new();
13 req.model = Some(GPT4_1_MINI.to_string());
14 req.input = Some(json!("Tell me a three sentence bedtime story about a unicorn."));
15 req.extra.insert("temperature".to_string(), json!(0.7));
16
17 let resp = client.create_response(req).await?;
18 println!("response id: {} status: {:?}", resp.id, resp.status);
19 println!("response output: {:?}", resp.output);
20 Ok(())
21}Trait Implementations§
Source§impl Clone for CreateResponseRequest
impl Clone for CreateResponseRequest
Source§fn clone(&self) -> CreateResponseRequest
fn clone(&self) -> CreateResponseRequest
Returns a duplicate of the value. Read more
1.0.0 · 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 CreateResponseRequest
impl Debug for CreateResponseRequest
Source§impl Default for CreateResponseRequest
impl Default for CreateResponseRequest
Source§impl<'de> Deserialize<'de> for CreateResponseRequest
impl<'de> Deserialize<'de> for CreateResponseRequest
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
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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