Skip to main content

StructuredCompletionRequestBuilder

Struct StructuredCompletionRequestBuilder 

Source
pub struct StructuredCompletionRequestBuilder<O: StructuredOutput, S: State = Empty> { /* private fields */ }
Expand description

Use builder syntax to set the inputs and finish with build().

Implementations§

Source§

impl<O: StructuredOutput, S: State> StructuredCompletionRequestBuilder<O, S>

Source

pub fn build(self) -> StructuredCompletionRequest<O>
where S: IsComplete,

Finish building and return the requested object

Source

pub fn model( self, value: ModelName, ) -> StructuredCompletionRequestBuilder<O, SetModel<S>>
where S::Model: IsUnset,

Required.

Source

pub fn system( self, value: String, ) -> StructuredCompletionRequestBuilder<O, SetSystem<S>>
where S::System: IsUnset,

Optional (Some / Option setters).

Source

pub fn maybe_system( self, value: Option<String>, ) -> StructuredCompletionRequestBuilder<O, SetSystem<S>>
where S::System: IsUnset,

Optional (Some / Option setters).

Source

pub fn prompt( self, value: impl Into<String>, ) -> StructuredCompletionRequestBuilder<O, SetPrompt<S>>
where S::Prompt: IsUnset,

Required.

Source

pub fn generation( self, value: GenerationParams, ) -> StructuredCompletionRequestBuilder<O, SetGeneration<S>>
where S::Generation: IsUnset,

Optional (Some / Option setters). Default: <GenerationParams as Default>::default().

Source

pub fn maybe_generation( self, value: Option<GenerationParams>, ) -> StructuredCompletionRequestBuilder<O, SetGeneration<S>>
where S::Generation: IsUnset,

Optional (Some / Option setters). Default: <GenerationParams as Default>::default().

Source

pub fn budget( self, value: RequestBudget, ) -> StructuredCompletionRequestBuilder<O, SetBudget<S>>
where S::Budget: IsUnset,

Optional (Some / Option setters). Default: RequestBudget::unlimited().

Source

pub fn maybe_budget( self, value: Option<RequestBudget>, ) -> StructuredCompletionRequestBuilder<O, SetBudget<S>>
where S::Budget: IsUnset,

Optional (Some / Option setters). Default: RequestBudget::unlimited().

Source

pub fn output( self, value: StructuredOutputSpec<O>, ) -> StructuredCompletionRequestBuilder<O, SetOutput<S>>
where S::Output: IsUnset,

Optional (Some / Option setters). Default: <StructuredOutputSpec<O> as Default>::default().

Source

pub fn maybe_output( self, value: Option<StructuredOutputSpec<O>>, ) -> StructuredCompletionRequestBuilder<O, SetOutput<S>>
where S::Output: IsUnset,

Optional (Some / Option setters). Default: <StructuredOutputSpec<O> as Default>::default().

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.