pub struct ChatRequestBuilder { /* private fields */ }Expand description
Builder for ChatRequest.
Implementations§
Source§impl ChatRequestBuilder
impl ChatRequestBuilder
Sourcepub fn model<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self
pub fn model<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self
ID of the model to use. See the model endpoint compatibility table for details on which models work with the Chat API.
Sourcepub fn messages<VALUE: Into<Vec<ChatMessage>>>(
&mut self,
value: VALUE,
) -> &mut Self
pub fn messages<VALUE: Into<Vec<ChatMessage>>>( &mut self, value: VALUE, ) -> &mut Self
A list of messages comprising the conversation so far.
Sourcepub fn tools<VALUE: Into<Vec<ToolDefinition>>>(
&mut self,
value: VALUE,
) -> &mut Self
pub fn tools<VALUE: Into<Vec<ToolDefinition>>>( &mut self, value: VALUE, ) -> &mut Self
A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for.
Sourcepub fn stream<VALUE: Into<bool>>(&mut self, value: VALUE) -> &mut Self
pub fn stream<VALUE: Into<bool>>(&mut self, value: VALUE) -> &mut Self
If set, partial message deltas will be sent, like in ChatGPT. Tokens will be sent as data-only server-sent events as they become available, with the stream terminated by a data: [DONE] message.
Sourcepub fn temperature<VALUE: Into<f64>>(&mut self, value: VALUE) -> &mut Self
pub fn temperature<VALUE: Into<f64>>(&mut self, value: VALUE) -> &mut Self
What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both.
Sourcepub fn build(&self) -> Result<ChatRequest, ChatRequestBuilderError>
pub fn build(&self) -> Result<ChatRequest, ChatRequestBuilderError>
Trait Implementations§
Source§impl Clone for ChatRequestBuilder
impl Clone for ChatRequestBuilder
Source§fn clone(&self) -> ChatRequestBuilder
fn clone(&self) -> ChatRequestBuilder
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more