pub struct ChatCompletionBuilder<'a, S: State = Empty> { /* private fields */ }
Expand description
Use builder syntax to set the inputs and finish with unstructured()
.
Implementations§
Source§impl<'a, S: State> ChatCompletionBuilder<'a, S>
impl<'a, S: State> ChatCompletionBuilder<'a, S>
Sourcepub fn unstructured(self) -> ChatCompletion<'a>where
S: IsComplete,
pub fn unstructured(self) -> ChatCompletion<'a>where
S: IsComplete,
Finish building and return the requested object
Sourcepub fn messages(
self,
value: Vec<Message<'a>>,
) -> ChatCompletionBuilder<'a, SetMessages<S>>where
S::Messages: IsUnset,
pub fn messages(
self,
value: Vec<Message<'a>>,
) -> ChatCompletionBuilder<'a, SetMessages<S>>where
S::Messages: IsUnset,
Required.
Sourcepub fn temperature(
self,
value: f32,
) -> ChatCompletionBuilder<'a, SetTemperature<S>>where
S::Temperature: IsUnset,
pub fn temperature(
self,
value: f32,
) -> ChatCompletionBuilder<'a, SetTemperature<S>>where
S::Temperature: IsUnset,
Sourcepub fn maybe_temperature(
self,
value: Option<f32>,
) -> ChatCompletionBuilder<'a, SetTemperature<S>>where
S::Temperature: IsUnset,
pub fn maybe_temperature(
self,
value: Option<f32>,
) -> ChatCompletionBuilder<'a, SetTemperature<S>>where
S::Temperature: IsUnset,
Sourcepub fn top_p(self, value: f32) -> ChatCompletionBuilder<'a, SetTopP<S>>where
S::TopP: IsUnset,
pub fn top_p(self, value: f32) -> ChatCompletionBuilder<'a, SetTopP<S>>where
S::TopP: IsUnset,
Sourcepub fn maybe_top_p(
self,
value: Option<f32>,
) -> ChatCompletionBuilder<'a, SetTopP<S>>where
S::TopP: IsUnset,
pub fn maybe_top_p(
self,
value: Option<f32>,
) -> ChatCompletionBuilder<'a, SetTopP<S>>where
S::TopP: IsUnset,
Source§impl<'a, S> ChatCompletionBuilder<'a, S>where
S: IsComplete,
impl<'a, S> ChatCompletionBuilder<'a, S>where
S: IsComplete,
Sourcepub fn structured<SS>(self) -> StructuredChatCompletion<'a, SS>where
SS: OpenAISchema,
pub fn structured<SS>(self) -> StructuredChatCompletion<'a, SS>where
SS: OpenAISchema,
Upgrades a chat completion request to a structured chat completion request.
Unless the return type can be inferred, you probably want to call this like so:
.structured::<MySchemadType>();
Auto Trait Implementations§
impl<'a, S> Freeze for ChatCompletionBuilder<'a, S>
impl<'a, S> RefUnwindSafe for ChatCompletionBuilder<'a, S>
impl<'a, S> Send for ChatCompletionBuilder<'a, S>
impl<'a, S> Sync for ChatCompletionBuilder<'a, S>
impl<'a, S> Unpin for ChatCompletionBuilder<'a, S>
impl<'a, S> UnwindSafe for ChatCompletionBuilder<'a, S>
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