Skip to content

Commit ec75df7

Browse files
Merge pull request #245669 from mrbullwinkle/mrb_07_20_2023_ada_v2_array_size
[Azure AI] [Azure OpenAI] update embedding array info
2 parents b64899e + 5ca819e commit ec75df7

File tree

3 files changed

+18
-15
lines changed

3 files changed

+18
-15
lines changed

articles/ai-services/openai/faq.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ sections:
4848
- question: |
4949
I am trying to use embeddings and received the error "InvalidRequestError: Too many inputs. The max number of inputs is 1." How do I fix this?
5050
answer: |
51-
This error typically occurs when you try to send a batch of text to embed in a single API request as an array. Currently Azure OpenAI does not support batching with embedding requests. Embeddings API calls should consist of a single string input per request. The string can be up to 8191 tokens in length when using the text-embedding-ada-002 (Version 2) model.
51+
This error typically occurs when you try to send a batch of text to embed in a single API request as an array. Currently Azure OpenAI only supports arrays of embeddings with multiple inputs for the `text-embedding-ada-002` Version 2 model. This model version supports an array consisting of up to 16 inputs per API request. The array can be up to 8191 tokens in length when using the text-embedding-ada-002 (Version 2) model.
5252
- question: |
5353
Where can I read about better ways to use Azure OpenAI to get the responses I want from the service?
5454
answer: |

articles/ai-services/openai/how-to/switching-endpoints.md

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ ms.service: cognitive-services
88
ms.subservice: openai
99
ms.custom: devx-track-python
1010
ms.topic: how-to
11-
ms.date: 05/24/2023
11+
ms.date: 07/20/2023
1212
manager: nitinme
1313
---
1414

@@ -161,9 +161,9 @@ embedding = openai.Embedding.create(
161161
</tr>
162162
</table>
163163

164-
## Azure OpenAI embeddings doesn't support multiple inputs
164+
## Azure OpenAI embeddings multiple input support
165165

166-
Many examples show passing multiple inputs into the embeddings API. For Azure OpenAI, currently we must pass a single text input per call.
166+
OpenAI currently allows a larger number of array inputs with text-embedding-ada-002. Azure OpenAI currently supports input arrays up to 16 for text-embedding-ada-002 Version 2. Both require the max input token limit per API request to remain under 8191 for this model.
167167

168168
<table>
169169
<tr>
@@ -173,7 +173,7 @@ Many examples show passing multiple inputs into the embeddings API. For Azure Op
173173
<td>
174174

175175
```python
176-
inputs = ["A", "B", "C"]
176+
inputs = ["A", "B", "C"]
177177

178178
embedding = openai.Embedding.create(
179179
input=inputs,
@@ -187,14 +187,13 @@ embedding = openai.Embedding.create(
187187
<td>
188188

189189
```python
190-
inputs = ["A", "B", "C"]
191-
192-
for text in inputs:
193-
embedding = openai.Embedding.create(
194-
input=text,
195-
deployment_id="text-embedding-ada-002"
196-
#engine="text-embedding-ada-002"
197-
)
190+
inputs = ["A", "B", "C"] #max array size=16
191+
192+
embedding = openai.Embedding.create(
193+
input=inputs,
194+
deployment_id="text-embedding-ada-002"
195+
#engine="text-embedding-ada-002"
196+
)
198197
```
199198

200199
</td>

articles/ai-services/openai/whats-new.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ ms.author: mbullwin
88
ms.service: cognitive-services
99
ms.subservice: openai
1010
ms.topic: whats-new
11-
ms.date: 06/12/2023
11+
ms.date: 07/20/2023
1212
recommendations: false
1313
keywords:
1414
---
@@ -17,10 +17,14 @@ keywords:
1717

1818
## July 2023
1919

20-
### Support for function calling
20+
### Support for function calling
2121

2222
- [Azure OpenAI now supports function calling](./how-to/function-calling.md) to enable you to work with functions in the chat completions API.
2323

24+
### Embedding input array increase
25+
26+
- Azure OpenAI now [supports arrays with up to 16 inputs](./how-to/switching-endpoints.md#azure-openai-embeddings-multiple-input-support) per API request with text-embedding-ada-002 Version 2.
27+
2428
## June 2023
2529

2630
### Use Azure OpenAI on your own data (preview)

0 commit comments

Comments
 (0)