Skip to content

Commit 8d08fe7

Browse files
authored
Merge pull request #285507 from MicrosoftDocs/main
8/26/2024 AM Publish
2 parents bbd294c + d6d6fa3 commit 8d08fe7

File tree

4 files changed

+16
-25
lines changed

4 files changed

+16
-25
lines changed

articles/ai-services/openai/how-to/use-your-data-securely.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ The [custom subdomain](/azure/ai-services/cognitive-services-custom-subdomains)
144144

145145
### Enable managed identity
146146

147-
To allow your Azure AI Search and Storage Account to recognize your Azure OpenAI service via Microsoft Entra ID authentication, you need to assign a managed identity for your Azure OpenAI service. The easiest way is to toggle on system assigned managed identity on Azure portal.
147+
To allow your Azure AI Search and Storage Account to recognize your Azure OpenAI Service via Microsoft Entra ID authentication, you need to assign a managed identity for your Azure OpenAI Service. The easiest way is to toggle on system assigned managed identity on Azure portal.
148148
:::image type="content" source="../media/use-your-data/openai-managed-identity.png" alt-text="A screenshot showing the system assigned managed identity option in the Azure portal." lightbox="../media/use-your-data/openai-managed-identity.png":::
149149

150150
To set the managed identities via the management API, see [the management API reference documentation](/rest/api/aiservices/accountmanagement/accounts/update#identity).
@@ -175,7 +175,7 @@ This step can be skipped only if you have a [shared private link](#create-shared
175175

176176
You can disable public network access of your Azure OpenAI resource in the Azure portal.
177177

178-
To allow access to your Azure OpenAI service from your client machines, like using Azure OpenAI Studio, you need to create [private endpoint connections](/azure/ai-services/cognitive-services-virtual-networks?tabs=portal#use-private-endpoints) that connect to your Azure OpenAI resource.
178+
To allow access to your Azure OpenAI Service from your client machines, like using Azure OpenAI Studio, you need to create [private endpoint connections](/azure/ai-services/cognitive-services-virtual-networks?tabs=portal#use-private-endpoints) that connect to your Azure OpenAI resource.
179179

180180

181181
## Configure Azure AI Search
@@ -290,7 +290,7 @@ To enable the developers to use these resources to build applications, the admin
290290

291291
## Configure gateway and client
292292

293-
To access the Azure OpenAI service from your on-premises client machines, one of the approaches is to configure Azure VPN Gateway and Azure VPN Client.
293+
To access the Azure OpenAI Service from your on-premises client machines, one of the approaches is to configure Azure VPN Gateway and Azure VPN Client.
294294

295295
Follow [this guideline](/azure/vpn-gateway/tutorial-create-gateway-portal#VNetGateway) to create virtual network gateway for your virtual network.
296296

articles/ai-services/openai/includes/dall-e-go.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ import (
6161
"os"
6262

6363
"github.com/Azure/azure-sdk-for-go/sdk/ai/azopenai"
64+
"github.com/Azure/azure-sdk-for-go/sdk/azcore"
6465
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
6566
)
6667

@@ -75,19 +76,15 @@ func main() {
7576
return
7677
}
7778

78-
keyCredential, err := azopenai.NewKeyCredential(azureOpenAIKey)
79-
80-
if err != nil {
81-
// handle error
82-
}
79+
keyCredential := azcore.NewKeyCredential(azureOpenAIKey)
8380

8481
client, err := azopenai.NewClientWithKeyCredential(azureOpenAIEndpoint, keyCredential, nil)
8582

8683
if err != nil {
8784
// handle error
8885
}
8986

90-
resp, err := client.CreateImage(context.TODO(), azopenai.ImageGenerationOptions{
87+
resp, err := client.GetImageGenerations(context.TODO(), azopenai.ImageGenerationOptions{
9188
Prompt: to.Ptr("a painting of a cat in the style of Dali"),
9289
ResponseFormat: to.Ptr(azopenai.ImageGenerationResponseFormatURL),
9390
}, nil)

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

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ import (
3838
"os"
3939

4040
"github.com/Azure/azure-sdk-for-go/sdk/ai/azopenai"
41+
"github.com/Azure/azure-sdk-for-go/sdk/azcore"
4142
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
4243
)
4344

@@ -52,11 +53,7 @@ func main() {
5253
return
5354
}
5455

55-
keyCredential, err := azopenai.NewKeyCredential(azureOpenAIKey)
56-
57-
if err != nil {
58-
// TODO: handle error
59-
}
56+
keyCredential := azcore.NewKeyCredential(azureOpenAIKey)
6057

6158
client, err := azopenai.NewClientWithKeyCredential(azureOpenAIEndpoint, keyCredential, nil)
6259

@@ -65,10 +62,10 @@ func main() {
6562
}
6663

6764
resp, err := client.GetCompletions(context.TODO(), azopenai.CompletionsOptions{
68-
Prompt: []string{"What is Azure OpenAI, in 20 words or less"},
69-
MaxTokens: to.Ptr(int32(2048)),
70-
Temperature: to.Ptr(float32(0.0)),
71-
Deployment: modelDeploymentID,
65+
Prompt: []string{"What is Azure OpenAI, in 20 words or less"},
66+
MaxTokens: to.Ptr(int32(2048)),
67+
Temperature: to.Ptr(float32(0.0)),
68+
DeploymentName: &modelDeploymentID,
7269
}, nil)
7370

7471
if err != nil {

articles/ai-services/openai/includes/use-your-data-go.md

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -80,15 +80,15 @@ ms.date: 03/07/2024
8080
},
8181
MaxTokens: to.Ptr[int32](512),
8282
AzureExtensionsOptions: []azopenai.AzureChatExtensionConfigurationClassification{
83-
&azopenai.AzureCognitiveSearchChatExtensionConfiguration{
83+
&azopenai.AzureSearchChatExtensionConfiguration{
8484
// This allows Azure OpenAI to use an Azure AI Search index.
8585
//
8686
// > Because the model has access to, and can reference specific sources to support its responses, answers are not only based on its pretrained knowledge
8787
// > but also on the latest information available in the designated data source. This grounding data also helps the model avoid generating responses
8888
// > based on outdated or incorrect information.
8989
//
9090
// Quote from here: https://learn.microsoft.com/en-us/azure/ai-services/openai/concepts/use-your-data
91-
Parameters: &azopenai.AzureCognitiveSearchChatExtensionParameters{
91+
Parameters: &azopenai.AzureSearchChatExtensionParameters{
9292
Endpoint: &searchEndpoint,
9393
IndexName: &searchIndex,
9494
Authentication: &azopenai.OnYourDataAPIKeyAuthenticationOptions{
@@ -105,12 +105,9 @@ ms.date: 03/07/2024
105105
log.Fatalf("ERROR: %s", err)
106106
}
107107
108-
// Contains contextual information from your Azure chat completion extensions, configured above in `AzureExtensionsOptions`
109-
msgContext := resp.Choices[0].Message.Context
110-
111108
fmt.Fprintf(os.Stderr, "Extensions Context Role: %s\nExtensions Context (length): %d\n",
112-
*msgContext.Messages[0].Role,
113-
len(*msgContext.Messages[0].Content))
109+
*resp.Choices[0].Message.Role,
110+
len(*resp.Choices[0].Message.Content))
114111
115112
fmt.Fprintf(os.Stderr, "ChatRole: %s\nChat content: %s\n",
116113
*resp.Choices[0].Message.Role,

0 commit comments

Comments
 (0)