Skip to content

Commit

Permalink
set temperature
Browse files Browse the repository at this point in the history
  • Loading branch information
linusbierhoff committed Sep 25, 2024
1 parent ae3d6a6 commit d118058
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/llm/openai/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,9 @@ impl<C: Config> OpenAI<C> {
) -> Result<CreateChatCompletionRequest, LLMError> {
let messages: Vec<ChatCompletionRequestMessage> = self.to_openai_messages(messages)?;
let mut request_builder = CreateChatCompletionRequestArgs::default();
if let Some(temperature) = self.options.temperature {
request_builder.temperature(temperature);
}
if let Some(max_tokens) = self.options.max_tokens {
request_builder.max_tokens(max_tokens);
}
Expand Down

0 comments on commit d118058

Please sign in to comment.