Skip to content

Commit 83d03fc

Browse files
authored
Adjust the azure model deployment name call corresponding to README (#309)
1 parent be253c2 commit 83d03fc

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,15 @@ import (
436436

437437
func main() {
438438

439-
config := openai.DefaultAzureConfig("your Azure OpenAI Key", "https://your Azure OpenAI Endpoint ", "your Model deployment name")
439+
config := openai.DefaultAzureConfig("your Azure OpenAI Key", "https://your Azure OpenAI Endpoint")
440+
//If you use a deployment name different from the model name, you can customize the AzureModelMapperFunc function
441+
//config.AzureModelMapperFunc = func(model string) string {
442+
// azureModelMapping = map[string]string{
443+
// "gpt-3.5-turbo":"your gpt-3.5-turbo deployment name",
444+
// }
445+
// return azureModelMapping[model]
446+
//}
447+
440448
client := openai.NewClientWithConfig(config)
441449
resp, err := client.CreateChatCompletion(
442450
context.Background(),

0 commit comments

Comments
 (0)