@@ -45,11 +45,11 @@ import (
45
45
)
46
46
47
47
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 " )
50
50
51
51
// Ex: "https://<your-azure-openai-host>.openai.azure.com"
52
- azureOpenAIEndpoint := os.Getenv (" AOAI_CHAT_COMPLETIONS_ENDPOINT " )
52
+ azureOpenAIEndpoint := os.Getenv (" AZURE_OPENAI_ENDPOINT " )
53
53
54
54
if azureOpenAIKey == " " || modelDeploymentID == " " || azureOpenAIEndpoint == " " {
55
55
fmt.Fprintf (os.Stderr , " Skipping example, environment variables missing\n " )
@@ -72,13 +72,13 @@ func main() {
72
72
// NOTE: all messages, regardless of role, count against token usage for this API.
73
73
messages := []azopenai.ChatRequestMessageClassification {
74
74
// 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." )},
76
76
77
77
// 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 ?" )},
79
79
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 " )},
82
82
83
83
// The user answers the question based on the latest reply.
84
84
&azopenai.ChatRequestUserMessage {Content: azopenai.NewChatRequestUserMessageContent (" What's the best way to train a parrot?" )},
0 commit comments