pub struct RequestOptions {
pub response_schema: Option<Value>,
}Expand description
Per-request options passed to AiClient::send_request_with_options.
Schema and other knobs live on the request, not the client, so a shared
client cannot leak settings between concurrent calls. Backends that do
not support an option are expected to ignore it (and the call site is
expected to consult AiClient::capabilities before setting it).
Fields§
§response_schema: Option<Value>Optional JSON Schema (as a serde_json::Value) constraining the
model’s response. Only honoured by backends whose
AiClientCapabilities::supports_response_schema is true.
Implementations§
Source§impl RequestOptions
impl RequestOptions
Sourcepub fn with_response_schema(self, schema: Value) -> Self
pub fn with_response_schema(self, schema: Value) -> Self
Returns a new RequestOptions with [response_schema] set.
Trait Implementations§
Source§impl Clone for RequestOptions
impl Clone for RequestOptions
Source§fn clone(&self) -> RequestOptions
fn clone(&self) -> RequestOptions
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 RequestOptions
impl Debug for RequestOptions
Source§impl Default for RequestOptions
impl Default for RequestOptions
Source§fn default() -> RequestOptions
fn default() -> RequestOptions
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for RequestOptions
impl RefUnwindSafe for RequestOptions
impl Send for RequestOptions
impl Sync for RequestOptions
impl Unpin for RequestOptions
impl UnsafeUnpin for RequestOptions
impl UnwindSafe for RequestOptions
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