pub struct ResponseRequest {Show 14 fields
pub model: String,
pub input: Option<Value>,
pub instructions: Option<String>,
pub previous_response_id: Option<String>,
pub store: Option<bool>,
pub background: Option<bool>,
pub temperature: Option<f32>,
pub top_p: Option<f32>,
pub max_output_tokens: Option<u32>,
pub tools: Option<Vec<Value>>,
pub tool_choice: Option<Value>,
pub parallel_tool_calls: Option<bool>,
pub text: Option<Value>,
pub include: Option<Vec<String>>,
}Expand description
A Responses generation request.
Fields§
§model: StringModel (for example muse-spark-1.3).
input: Option<Value>Text input, or structured input items via ResponseRequest::with_items.
instructions: Option<String>Per-request instructions (not persisted).
previous_response_id: Option<String>Chain onto a stored response (carries reasoning across turns).
store: Option<bool>Persist the response server-side (default true server-side).
background: Option<bool>Run asynchronously (poll with MuseResponsesClient::get).
temperature: Option<f32>Sampling temperature.
top_p: Option<f32>Nucleus sampling threshold.
max_output_tokens: Option<u32>Output cap (minimum 16 server-side).
tools: Option<Vec<Value>>Function/custom tools (caller-executed) or server-side built-ins.
tool_choice: Option<Value>Tool choice.
parallel_tool_calls: Option<bool>Whether tools may run in parallel in one turn.
text: Option<Value>Output format, for example strict JSON Schema via text.format.
include: Option<Vec<String>>Include values, for example reasoning.encrypted_content.
Implementations§
Source§impl ResponseRequest
impl ResponseRequest
Sourcepub fn text(model: impl Into<String>, input: impl Into<String>) -> Self
pub fn text(model: impl Into<String>, input: impl Into<String>) -> Self
A request with plain-text input.
Sourcepub fn with_items(self, items: Vec<ResponseItem>) -> Self
pub fn with_items(self, items: Vec<ResponseItem>) -> Self
Attach structured input items (images, files, function outputs).
Sourcepub fn with_previous(self, previous_response_id: impl Into<String>) -> Self
pub fn with_previous(self, previous_response_id: impl Into<String>) -> Self
Chain onto a stored response.
Sourcepub fn with_json_schema(self, name: &str, schema: Value) -> Self
pub fn with_json_schema(self, name: &str, schema: Value) -> Self
Constrain output to a strict JSON Schema (Responses text.format).
Trait Implementations§
Source§impl Clone for ResponseRequest
impl Clone for ResponseRequest
Source§impl Debug for ResponseRequest
impl Debug for ResponseRequest
Source§impl Default for ResponseRequest
impl Default for ResponseRequest
Auto Trait Implementations§
impl Forget for ResponseRequest
impl Freeze for ResponseRequestwhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<Value>: Freeze,
PhantomData<usize>: Freeze,
PhantomData<Bucket<String, Value>>: Freeze,
PhantomData<String>: Freeze,
impl Move for ResponseRequest
impl RefUnwindSafe for ResponseRequest
impl Send for ResponseRequest
impl Sync for ResponseRequest
impl Unpin for ResponseRequest
impl UnsafeUnpin for ResponseRequestwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<Value>: UnsafeUnpin,
PhantomData<usize>: UnsafeUnpin,
PhantomData<Bucket<String, Value>>: UnsafeUnpin,
PhantomData<String>: UnsafeUnpin,
impl UnwindSafe for ResponseRequest
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
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,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
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> ⓘ
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> ⓘ
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request