Skip to content

Commit 0964d0e

Browse files
authored
🐛 Set Azure OpenAI chunk_size to 16. (#30795)
1 parent 3834b61 commit 0964d0e

File tree

1 file changed

+2
-1
lines changed
  • airbyte-cdk/python/airbyte_cdk/destinations/vector_db_based

1 file changed

+2
-1
lines changed

airbyte-cdk/python/airbyte_cdk/destinations/vector_db_based/embedder.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,8 @@ def __init__(self, config: OpenAIEmbeddingConfigModel, chunk_size: int):
9797

9898
class AzureOpenAIEmbedder(BaseOpenAIEmbedder):
9999
def __init__(self, config: AzureOpenAIEmbeddingConfigModel, chunk_size: int):
100-
super().__init__(OpenAIEmbeddings(openai_api_key=config.openai_key, chunk_size=8191, max_retries=15, openai_api_type="azure", openai_api_version="2023-05-15", openai_api_base=config.api_base, deployment=config.deployment), chunk_size) # type: ignore
100+
# Azure OpenAI API has — as of 20230927 — a limit of 16 documents per request
101+
super().__init__(OpenAIEmbeddings(openai_api_key=config.openai_key, chunk_size=16, max_retries=15, openai_api_type="azure", openai_api_version="2023-05-15", openai_api_base=config.api_base, deployment=config.deployment), chunk_size) # type: ignore
101102

102103

103104
COHERE_VECTOR_SIZE = 1024

0 commit comments

Comments
 (0)