Skip to content

Commit 800154a

Browse files
committed
update
1 parent d646597 commit 800154a

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

articles/ai-services/openai/includes/chat-go.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,11 @@ import (
4545
)
4646

4747
func main() {
48-
azureOpenAIKey := os.Getenv("AOAI_CHAT_COMPLETIONS_API_KEY")
49-
modelDeploymentID := os.Getenv("AOAI_CHAT_COMPLETIONS_MODEL")
48+
azureOpenAIKey := os.Getenv("AZURE_OPENAI_API_KEY")
49+
modelDeploymentID := os.Getenv("YOUR_MODEL_DEPLOYMENT_NAME")
5050

5151
// Ex: "https://<your-azure-openai-host>.openai.azure.com"
52-
azureOpenAIEndpoint := os.Getenv("AOAI_CHAT_COMPLETIONS_ENDPOINT")
52+
azureOpenAIEndpoint := os.Getenv("AZURE_OPENAI_ENDPOINT")
5353

5454
if azureOpenAIKey == "" || modelDeploymentID == "" || azureOpenAIEndpoint == "" {
5555
fmt.Fprintf(os.Stderr, "Skipping example, environment variables missing\n")
@@ -72,13 +72,13 @@ func main() {
7272
// NOTE: all messages, regardless of role, count against token usage for this API.
7373
messages := []azopenai.ChatRequestMessageClassification{
7474
// You set the tone and rules of the conversation with a prompt as the system role.
75-
&azopenai.ChatRequestSystemMessage{Content: to.Ptr("You are a helpful assistant. You will talk like a pirate.")},
75+
&azopenai.ChatRequestSystemMessage{Content: to.Ptr("You are a helpful assistant.")},
7676

7777
// The user asks a question
78-
&azopenai.ChatRequestUserMessage{Content: azopenai.NewChatRequestUserMessageContent("Can you help me?")},
78+
&azopenai.ChatRequestUserMessage{Content: azopenai.NewChatRequestUserMessageContent("Does Azure OpenAI support customer managed keys?")},
7979

80-
// The reply would come back from the ChatGPT. You'd add it to the conversation so we can maintain context.
81-
&azopenai.ChatRequestAssistantMessage{Content: to.Ptr("Arrrr! Of course, me hearty! What can I do for ye?")},
80+
// The reply would come back from the model. You'd add it to the conversation so we can maintain context.
81+
&azopenai.ChatRequestAssistantMessage{Content: to.Ptr("Yes, customer managed keys are supported by Azure OpenAI")},
8282

8383
// The user answers the question based on the latest reply.
8484
&azopenai.ChatRequestUserMessage{Content: azopenai.NewChatRequestUserMessageContent("What's the best way to train a parrot?")},

0 commit comments

Comments
 (0)