Skip to content

Commit 980504b

Browse files
authored
docs(readme): update format (#317)
1 parent a18c18d commit 980504b

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

README.md

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -435,16 +435,15 @@ import (
435435
)
436436

437437
func main() {
438-
439438
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+
448447
client := openai.NewClientWithConfig(config)
449448
resp, err := client.CreateChatCompletion(
450449
context.Background(),
@@ -458,14 +457,14 @@ func main() {
458457
},
459458
},
460459
)
461-
462460
if err != nil {
463461
fmt.Printf("ChatCompletion error: %v\n", err)
464462
return
465463
}
466464

467465
fmt.Println(resp.Choices[0].Message.Content)
468466
}
467+
469468
```
470469
</details>
471470

0 commit comments

Comments
 (0)