Skip to content

Commit

Permalink
Merge pull request #340 from overmindtech/azuuuuuure
Browse files Browse the repository at this point in the history
Accept azureModelName configuration
  • Loading branch information
DavidS-ovm authored Dec 9, 2024
2 parents 8b110f6 + 7336910 commit da33b2f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion llm/openai.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,13 @@ import (
// Creates a new OpenAI Provider. The user must pass in the API key, the model
// to use, and the name. The name is used in the subsequent names of all the
// assistants that are created. Set `azureBaseURL` to enable azure mode
func NewOpenAIProvider(apiKey string, azureBaseURL string, model string, name string, jsonMode bool) *openAIProvider {
func NewOpenAIProvider(apiKey string, azureBaseURL string, model, azureModelName string, name string, jsonMode bool) *openAIProvider {
var cfg openai.ClientConfig
if azureBaseURL != "" {
cfg = openai.DefaultAzureConfig(apiKey, azureBaseURL)
cfg.AzureModelMapperFunc = func(m string) string {
return azureModelName
}
} else {
cfg = openai.DefaultConfig(apiKey)
}
Expand Down
2 changes: 1 addition & 1 deletion llm/openai_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ func TestNewOpenAIProvider(t *testing.T) {
t.Skip("OPENAI_API_KEY not set")
}

openaiProvider := NewOpenAIProvider(key, "", openai.GPT4oMini, t.Name(), false)
openaiProvider := NewOpenAIProvider(key, "", openai.GPT4oMini, "", t.Name(), false)

// Assert that the result matches the provider interface
var _ Provider = openaiProvider
Expand Down

0 comments on commit da33b2f

Please sign in to comment.