File tree Expand file tree Collapse file tree 1 file changed +9
-10
lines changed Expand file tree Collapse file tree 1 file changed +9
-10
lines changed Original file line number Diff line number Diff line change @@ -435,16 +435,15 @@ import (
435
435
)
436
436
437
437
func main () {
438
-
439
438
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
-
439
+ // If you use a deployment name different from the model name, you can customize the AzureModelMapperFunc function
440
+ // config.AzureModelMapperFunc = func(model string) string {
441
+ // azureModelMapping = map[string]string{
442
+ // "gpt-3.5-turbo": "your gpt-3.5-turbo deployment name",
443
+ // }
444
+ // return azureModelMapping[model]
445
+ // }
446
+
448
447
client := openai.NewClientWithConfig (config)
449
448
resp , err := client.CreateChatCompletion (
450
449
context.Background (),
@@ -458,14 +457,14 @@ func main() {
458
457
},
459
458
},
460
459
)
461
-
462
460
if err != nil {
463
461
fmt.Printf (" ChatCompletion error: %v \n " , err)
464
462
return
465
463
}
466
464
467
465
fmt.Println (resp.Choices [0 ].Message .Content )
468
466
}
467
+
469
468
```
470
469
</details >
471
470
You can’t perform that action at this time.
0 commit comments