Skip to content

Commit

Permalink
Upgrade dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
edofic committed Mar 26, 2024
1 parent 04a2d4f commit 555919d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module github.com/edofic/chatgpt-cli

go 1.19
go 1.22

require github.com/sashabaranov/go-openai v1.7.0
require github.com/sashabaranov/go-openai v1.20.4
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
github.com/sashabaranov/go-openai v1.7.0 h1:D1dBXoZhtf/aKNu6WFf0c7Ah2NM30PZ/3Mqly6cZ7fk=
github.com/sashabaranov/go-openai v1.7.0/go.mod h1:lj5b/K+zjTSFxVLijLSTDZuP7adOgerWeFyZLUhAKRg=
github.com/sashabaranov/go-openai v1.20.4 h1:095xQ/fAtRa0+Rj21sezVJABgKfGPNbyx/sAN/hJUmg=
github.com/sashabaranov/go-openai v1.20.4/go.mod h1:lj5b/K+zjTSFxVLijLSTDZuP7adOgerWeFyZLUhAKRg=
8 changes: 7 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,13 @@ func getClient() *openai.Client {
url := os.Getenv("OPENAI_AZURE_ENDPOINT")
if url != "" {
deployment := os.Getenv("OPENAI_AZURE_MODEL")
config := openai.DefaultAzureConfig(apiKey, url, deployment)
config := openai.DefaultAzureConfig(apiKey, url)
config.AzureModelMapperFunc = func(model string) string {
if deployment != "" {
return deployment
}
return model
}
return openai.NewClientWithConfig(config)
}
return openai.NewClient(apiKey)
Expand Down

0 comments on commit 555919d

Please sign in to comment.