Skip to content

Commit 728a215

Browse files
Learn Build Service GitHub AppLearn Build Service GitHub App
authored andcommitted
Merging changes synced from https://github.com/MicrosoftDocs/azure-docs-pr (branch live)
2 parents 54e8c38 + b7fdc37 commit 728a215

File tree

382 files changed

+3578
-1070
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

382 files changed

+3578
-1070
lines changed

.openpublishing.redirection.azure-monitor.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1807,7 +1807,7 @@
18071807
},
18081808
{
18091809
"source_path_from_root": "/articles/monitoring-and-diagnostics/resource-group-insights.md",
1810-
"redirect_url": "/azure/azure-monitor/insights/resource-group-insights",
1810+
"redirect_url": "/azure/azure-resource-manager/management/resource-group-insights",
18111811
"redirect_document_id": true
18121812
},
18131813
{
@@ -6608,6 +6608,11 @@
66086608
"source_path_from_root": "/articles/azure-monitor/monitor-reference.md",
66096609
"redirect_url": "/azure/azure-monitor/overview",
66106610
"redirect_document_id": false
6611+
},
6612+
{
6613+
"source_path_from_root": "/articles/azure-monitor/insights/resource-group-insights.md",
6614+
"redirect_url": "/azure/azure-resource-manager/management/resource-group-insights",
6615+
"redirect_document_id": false
66116616
}
66126617
]
66136618
}

articles/ai-services/language-service/native-document-support/use-native-documents.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ author: laujan
66
manager: nitinme
77
ms.service: azure-ai-language
88
ms.topic: how-to
9-
ms.date: 01/31/2024
9+
ms.date: 02/21/2024
1010
ms.author: lajanuar
1111
---
1212

@@ -197,6 +197,10 @@ For this quickstart, you need a **source document** uploaded to your **source co
197197
}
198198
```
199199

200+
* The source `location` value is the SAS URL for the **source document (blob)**, not the source container SAS URL.
201+
202+
* The `redactionPolicy` possible values are `UseRedactionCharacterWithRefId` (default) or `UseEntityTypeName`. For more information, *see* [**PiiTask Parameters**](/rest/api/language/text-analysis-runtime/analyze-text?view=rest-language-2023-11-15-preview&tabs=HTTP#piitaskparameters&preserve-view=true).
203+
200204
### Run the POST request
201205

202206
1. Here's the preliminary structure of the POST request:
@@ -332,7 +336,7 @@ For this project, you need a **source document** uploaded to your **source conta
332336

333337
1. Copy and paste the Document Summarization **request sample** into your `document-summarization.json` file. Replace **`{your-source-container-SAS-URL}`** and **`{your-target-container-SAS-URL}`** with values from your Azure portal Storage account containers instance:
334338

335-
`**Request sample**`
339+
***Request sample***
336340

337341
```json
338342
{

articles/ai-services/openai/reference.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description: Learn how to use Azure OpenAI's REST API. In this article, you lear
55
manager: nitinme
66
ms.service: azure-ai-openai
77
ms.topic: conceptual
8-
ms.date: 02/13/2024
8+
ms.date: 02/21/2024
99
author: mrbullwinkle
1010
ms.author: mbullwin
1111
recommendations: false
@@ -366,6 +366,9 @@ The definition of a caller-specified function that chat completions can invoke i
366366

367367
Extensions for chat completions, for example Azure OpenAI On Your Data.
368368

369+
> [!IMPORTANT]
370+
> The following information is for version `2023-12-01-preview` of the API. This **is not** the current version of the API. To find the latest reference documentation, see [Azure OpenAI On Your Data reference](./references/on-your-data.md).
371+
369372
**Use chat completions extensions**
370373

371374
```http
@@ -386,7 +389,6 @@ POST {your-resource-name}/openai/deployments/{deployment-id}/extensions/chat/com
386389
- `2023-08-01-preview` (retiring April 2, 2024) [Swagger spec](https://github.com/Azure/azure-rest-api-specs/blob/main/specification/cognitiveservices/data-plane/AzureOpenAI/inference/preview/2023-08-01-preview/inference.json)
387390
- `2023-09-01-preview` (retiring April 2, 2024) [Swagger spec](https://github.com/Azure/azure-rest-api-specs/blob/main/specification/cognitiveservices/data-plane/AzureOpenAI/inference/preview/2023-09-01-preview/inference.json)
388391
- `2023-12-01-preview` [Swagger spec](https://github.com/Azure/azure-rest-api-specs/blob/main/specification/cognitiveservices/data-plane/AzureOpenAI/inference/preview/2023-12-01-preview/inference.json)
389-
- `2024-02-15-preview`[Swagger spec](https://github.com/Azure/azure-rest-api-specs/blob/main/specification/cognitiveservices/data-plane/AzureOpenAI/inference/preview/2024-02-15-preview/inference.json)
390392

391393

392394
#### Example request
Lines changed: 167 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,167 @@
1+
---
2+
title: Azure OpenAI on your Azure Machine Learning index data Python & REST API reference
3+
titleSuffix: Azure OpenAI
4+
description: Learn how to use Azure OpenAI on your Azure Machine Learning index data Python & REST API.
5+
manager: nitinme
6+
ms.service: azure-ai-openai
7+
ms.topic: conceptual
8+
ms.date: 02/14/2024
9+
author: mrbullwinkle
10+
ms.author: mbullwin
11+
recommendations: false
12+
ms.custom:
13+
---
14+
15+
# Data source - Azure Machine Learning index
16+
17+
The configurable options of Azure Machine Learning index when using Azure OpenAI On Your Data. This data source is supported in API version `2024-02-15-preview`.
18+
19+
|Name | Type | Required | Description |
20+
|--- | --- | --- | --- |
21+
|`parameters`| [Parameters](#parameters)| True| The parameters to use when configuring Azure Machine Learning index.|
22+
| `type`| string| True | Must be `azure_ml_index`. |
23+
24+
## Parameters
25+
26+
|Name | Type | Required | Description |
27+
|--- | --- | --- | --- |
28+
| `project_resource_id` | string | True | The resource ID of the Azure Machine Learning project.|
29+
| `name` | string | True | The Azure Machine Learning index name.|
30+
| `version` | string | True | The version of the Azure Machine Learning index.|
31+
| `authentication`| One of [AccessTokenAuthenticationOptions](#access-token-authentication-options), [SystemAssignedManagedIdentityAuthenticationOptions](#system-assigned-managed-identity-authentication-options), [UserAssignedManagedIdentityAuthenticationOptions](#user-assigned-managed-identity-authentication-options) | True | The authentication method to use when accessing the defined data source. |
32+
| `in_scope` | boolean | False | Whether queries should be restricted to use of indexed data. Default is `True`.|
33+
| `role_information`| string | False | Give the model instructions about how it should behave and any context it should reference when generating a response. You can describe the assistant's personality and tell it how to format responses.|
34+
| `strictness` | integer | False | The configured strictness of the search relevance filtering. The higher of strictness, the higher of the precision but lower recall of the answer. Default is `3`.|
35+
| `top_n_documents` | integer | False | The configured top number of documents to feature for the configured query. Default is `5`. |
36+
| `filter`| string | False | Search filter. Only supported if the Azure Machine Learning index is of type Azure Search.|
37+
38+
39+
## Access token authentication options
40+
41+
The authentication options for Azure OpenAI On Your Data when using access token.
42+
43+
|Name | Type | Required | Description |
44+
|--- | --- | --- | --- |
45+
| `access_token`|string|True|The access token to use for authentication.|
46+
| `type`|string|True| Must be `access_token`.|
47+
48+
## System assigned managed identity authentication options
49+
50+
The authentication options for Azure OpenAI On Your Data when using a system-assigned managed identity.
51+
52+
|Name | Type | Required | Description |
53+
|--- | --- | --- | --- |
54+
| `type`|string|True| Must be `system_assigned_managed_identity`.|
55+
56+
## User assigned managed identity authentication options
57+
58+
The authentication options for Azure OpenAI On Your Data when using a user-assigned managed identity.
59+
60+
|Name | Type | Required | Description |
61+
|--- | --- | --- | --- |
62+
| `managed_identity_resource_id`|string|True|The resource ID of the user-assigned managed identity to use for authentication.|
63+
| `type`|string|True| Must be `user_assigned_managed_identity`.|
64+
65+
## Examples
66+
67+
Prerequisites:
68+
* Configure the role assignments from Azure OpenAI system assigned managed identity to Azure Machine Learning workspace resource. Required role: `AzureML Data Scientist`.
69+
* Configure the role assignments from the user to the Azure OpenAI resource. Required role: `Cognitive Services OpenAI User`.
70+
* Install [Az CLI](/cli/azure/install-azure-cli) and run `az login`.
71+
* Define the following environment variables: `AzureOpenAIEndpoint`, `ChatCompletionsDeploymentName`, `ProjectResourceId`, `IndexName`, `IndexVersion`.
72+
* Run `export MSYS_NO_PATHCONV=1` if you're using MINGW.
73+
```bash
74+
export AzureOpenAIEndpoint=https://example.openai.azure.com/
75+
export ChatCompletionsDeploymentName=turbo
76+
export ProjectResourceId='/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/Microsoft.MachineLearningServices/workspaces/{workspace-id}'
77+
export IndexName=testamlindex
78+
export IndexVersion=2
79+
```
80+
81+
# [Python 1.x](#tab/python)
82+
83+
Install the latest pip packages `openai`, `azure-identity`.
84+
85+
```python
86+
import os
87+
from openai import AzureOpenAI
88+
from azure.identity import DefaultAzureCredential, get_bearer_token_provider
89+
90+
endpoint = os.environ.get("AzureOpenAIEndpoint")
91+
deployment = os.environ.get("ChatCompletionsDeploymentName")
92+
project_resource_id = os.environ.get("ProjectResourceId")
93+
index_name = os.environ.get("IndexName")
94+
index_version = os.environ.get("IndexVersion")
95+
96+
token_provider = get_bearer_token_provider(
97+
DefaultAzureCredential(), "https://cognitiveservices.azure.com/.default")
98+
99+
client = AzureOpenAI(
100+
azure_endpoint=endpoint,
101+
azure_ad_token_provider=token_provider,
102+
api_version="2024-02-15-preview",
103+
)
104+
105+
completion = client.chat.completions.create(
106+
model=deployment,
107+
messages=[
108+
{
109+
"role": "user",
110+
"content": "Who is DRI?",
111+
},
112+
],
113+
extra_body={
114+
"data_sources": [
115+
{
116+
"type": "azure_ml_index",
117+
"parameters": {
118+
"project_resource_id": project_resource_id,
119+
"name": index_name,
120+
"version": index_version,
121+
"authentication": {
122+
"type": "system_assigned_managed_identity"
123+
},
124+
}
125+
}
126+
]
127+
}
128+
)
129+
130+
print(completion.model_dump_json(indent=2))
131+
132+
```
133+
134+
# [REST](#tab/rest)
135+
136+
```bash
137+
138+
az rest --method POST \
139+
--uri $AzureOpenAIEndpoint/openai/deployments/$ChatCompletionsDeploymentName/chat/completions?api-version=2024-02-15-preview \
140+
--resource https://cognitiveservices.azure.com/ \
141+
--body \
142+
'
143+
{
144+
"data_sources": [
145+
{
146+
"type": "azure_ml_index",
147+
"parameters": {
148+
"project_resource_id": "'$ProjectResourceId'",
149+
"name": "'$IndexName'",
150+
"version": "'$IndexVersion'",
151+
"authentication": {
152+
"type": "system_assigned_managed_identity"
153+
},
154+
}
155+
}
156+
],
157+
"messages": [
158+
{
159+
"role": "user",
160+
"content": "Who is DRI?"
161+
}
162+
]
163+
}
164+
'
165+
```
166+
167+
---

0 commit comments

Comments
 (0)