Struct rust_gpt::chat::ChatBuilder
source · pub struct ChatBuilder { /* private fields */ }
Expand description
Builds a Chat
struct for initiating a chat session.
Implementations§
source§impl ChatBuilder
impl ChatBuilder
sourcepub fn new(model: ChatModel, api_key: String) -> Self
pub fn new(model: ChatModel, api_key: String) -> Self
Creates a new ChatBuilder
with the given model and API key.
sourcepub fn len(self, len: usize) -> Self
pub fn len(self, len: usize) -> Self
Sets the amount of messages that are stored in the chat session.
sourcepub fn system(self, system: ChatMessage) -> Self
pub fn system(self, system: ChatMessage) -> Self
Sets the system message that is sent to the chat API
sourcepub fn temperature(self, temperature: f32) -> Self
pub fn temperature(self, temperature: f32) -> Self
Sets the temperature
sourcepub fn max_tokens(self, max_tokens: u32) -> Self
pub fn max_tokens(self, max_tokens: u32) -> Self
Sets the maximum amount of tokens that can be generated by the chat API.
sourcepub fn presence_penalty(self, presence_penalty: f32) -> Self
pub fn presence_penalty(self, presence_penalty: f32) -> Self
Sets the presence penalty
sourcepub fn frequency_penalty(self, frequency_penalty: f32) -> Self
pub fn frequency_penalty(self, frequency_penalty: f32) -> Self
Sets the frequency penalty