Adjust the azure model deployment name call corresponding to README (#309)
This commit is contained in:
10
README.md
10
README.md
@@ -436,7 +436,15 @@ import (
|
|||||||
|
|
||||||
func main() {
|
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)
|
client := openai.NewClientWithConfig(config)
|
||||||
resp, err := client.CreateChatCompletion(
|
resp, err := client.CreateChatCompletion(
|
||||||
context.Background(),
|
context.Background(),
|
||||||
|
|||||||
Reference in New Issue
Block a user