Adjust the azure model deployment name call corresponding to README (#309)

This commit is contained in:
xuanming.zhang
2023-05-15 12:29:28 +08:00
committed by GitHub
parent be253c2d63
commit 83d03fca52

View File

@@ -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(),