From 83d03fca527288a2959783d3679e80526ecf60c6 Mon Sep 17 00:00:00 2001 From: "xuanming.zhang" Date: Mon, 15 May 2023 12:29:28 +0800 Subject: [PATCH] Adjust the azure model deployment name call corresponding to README (#309) --- README.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 272d853..994f26d 100644 --- a/README.md +++ b/README.md @@ -436,7 +436,15 @@ import ( func main() { - config := openai.DefaultAzureConfig("your Azure OpenAI Key", "https://your Azure OpenAI Endpoint ", "your Model deployment name") + config := openai.DefaultAzureConfig("your Azure OpenAI Key", "https://your Azure OpenAI Endpoint") + //If you use a deployment name different from the model name, you can customize the AzureModelMapperFunc function + //config.AzureModelMapperFunc = func(model string) string { + // azureModelMapping = map[string]string{ + // "gpt-3.5-turbo":"your gpt-3.5-turbo deployment name", + // } + // return azureModelMapping[model] + //} + client := openai.NewClientWithConfig(config) resp, err := client.CreateChatCompletion( context.Background(),