Skip to content

Commit

Permalink
openai[patch]: remove openai chunk size validation (#19878)
Browse files Browse the repository at this point in the history
  • Loading branch information
efriis committed Apr 1, 2024
1 parent a1f3e9f commit 4fbdc2a
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions libs/partners/openai/langchain_openai/embeddings/azure.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,14 +102,6 @@ def validate_environment(cls, values: Dict) -> Dict:
values["azure_ad_token"] = (
convert_to_secret_str(azure_ad_token) if azure_ad_token else None
)
# Azure OpenAI embedding models allow a maximum of 2048 texts
# at a time in each batch
# See: https://learn.microsoft.com/en-us/azure/ai-services/openai/how-to/embeddings?tabs=console#best-practices
if values["chunk_size"] > 2048:
raise ValueError(
"Azure OpenAI embeddings only allow a maximum of 2048 texts at a time "
"in each batch."
)
# For backwards compatibility. Before openai v1, no distinction was made
# between azure_endpoint and base_url (openai_api_base).
openai_api_base = values["openai_api_base"]
Expand Down

0 comments on commit 4fbdc2a

Please sign in to comment.