Skip to content

Commit 27dc4c7

Browse files
committed
Merge branch 'main' of https://github.com/MicrosoftDocs/azure-docs-pr into pl-terraform-qs
2 parents eb311fc + aa556aa commit 27dc4c7

File tree

135 files changed

+37528
-1053
lines changed

Some content is hidden

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

135 files changed

+37528
-1053
lines changed

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/assistants-reference-runs.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ Create a run.
3737
| `assistant_id` | string | Required | The ID of the assistant to use to execute this run. |
3838
| `model` | string or null | Optional | The model deployment name to be used to execute this run. If a value is provided here, it will override the model deployment name associated with the assistant. If not, the model deployment name associated with the assistant will be used. |
3939
| `instructions` | string or null | Optional | Overrides the instructions of the assistant. This is useful for modifying the behavior on a per-run basis. |
40-
| `additional_instructions` | string or null | Optional | Appends additional instructions at the end of the instructions for the run. This is useful for modifying the behavior on a per-run basis without overriding other instructions. |
4140
| `tools` | array or null | Optional | Override the tools the assistant can use for this run. This is useful for modifying the behavior on a per-run basis. |
4241
| `metadata` | map | Optional | Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maximum of 512 characters long. |
4342

articles/ai-services/openai/concepts/models.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ In testing, OpenAI reports both the large and small third generation embeddings
6262
| MIRACL average | 31.4 | 44.0 | 54.9 |
6363
| MTEB average | 61.0 | 62.3 | 64.6 |
6464

65-
The third generation embeddings models support reducing the size of the embedding via a new `dimensions` parameter. Typically larger embeddings are more expensive from a compute, memory, and storage perspective. Being able to adjust the number of dimensions allows more control over overall cost and performance. Official support for the dimensions parameter was added to the OpenAI Python library in version `1.10.0`. If you are running an earlier version of the 1.x library you will need to upgrade `pip install openai --upgrade`.
65+
The third generation embeddings models support reducing the size of the embedding via a new `dimensions` parameter. Typically larger embeddings are more expensive from a compute, memory, and storage perspective. Being able to adjust the number of dimensions allows more control over overall cost and performance. The `dimensions` parameter is not supported in all versions of the OpenAI 1.x Python library, to take advantage of this parameter we recommend upgrading to the latest version: `pip install openai --upgrade`.
6666

6767
OpenAI's MTEB benchmark testing found that even when the third generation model's dimensions are reduced to less than `text-embeddings-ada-002` 1,536 dimensions performance remains slightly better.
6868

articles/ai-services/openai/concepts/provisioned-throughput.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ An Azure OpenAI Deployment is a unit of management for a specific OpenAI Model.
3636
| Utilization | Provisioned-managed Utilization measure provided in Azure Monitor. |
3737
| Estimating size | Provided calculator in the studio & benchmarking script. |
3838

39+
## How do I get access to Provisioned?
40+
41+
You need to speak with your Microsoft sales/account team to acquire provisioned throughput. If you don't have a sales/account team, unfortunately at this time, you cannot purchase provisioned throughput.
42+
3943
## Key concepts
4044

4145
### Provisioned throughput units

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)