mirror of
https://github.com/hwchase17/langchain.git
synced 2025-07-17 10:13:29 +00:00
openai[patch]: remove openai chunk size validation (#19878)
This commit is contained in:
parent
a1f3e9f537
commit
4fbdc2a7ee
@ -102,14 +102,6 @@ class AzureOpenAIEmbeddings(OpenAIEmbeddings):
|
|||||||
values["azure_ad_token"] = (
|
values["azure_ad_token"] = (
|
||||||
convert_to_secret_str(azure_ad_token) if azure_ad_token else None
|
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
|
# For backwards compatibility. Before openai v1, no distinction was made
|
||||||
# between azure_endpoint and base_url (openai_api_base).
|
# between azure_endpoint and base_url (openai_api_base).
|
||||||
openai_api_base = values["openai_api_base"]
|
openai_api_base = values["openai_api_base"]
|
||||||
|
Loading…
Reference in New Issue
Block a user