Skip to content

Commit

Permalink
Set temperature
Browse files Browse the repository at this point in the history
  • Loading branch information
hupe1980 committed Aug 1, 2023
1 parent b9497c7 commit a019a32
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion docs/content/en/docs/chains/structured_output.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ type Person struct {
}

func main() {
chatModel, err := chatmodel.NewOpenAI(os.Getenv("OPENAI_API_KEY"))
chatModel, err := chatmodel.NewOpenAI(os.Getenv("OPENAI_API_KEY"), func(o *chatmodel.OpenAIOptions) {
o.Temperature = 0
})
if err != nil {
log.Fatal(err)
}
Expand Down
4 changes: 3 additions & 1 deletion examples/structured_output_chain/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ type Person struct {
}

func main() {
chatModel, err := chatmodel.NewOpenAI(os.Getenv("OPENAI_API_KEY"))
chatModel, err := chatmodel.NewOpenAI(os.Getenv("OPENAI_API_KEY"), func(o *chatmodel.OpenAIOptions) {
o.Temperature = 0
})
if err != nil {
log.Fatal(err)
}
Expand Down

0 comments on commit a019a32

Please sign in to comment.