File ~/opt/miniconda3/envs/envml/lib/python3.11/site-packages/langchain_core/load/serializable.py:113 in init
super().init(*args, **kwargs)
File pydantic/main.py:341 in pydantic.main.BaseModel.init
ValidationError: 1 validation error for AzureMLChatOnlineEndpoint
endpoint_api_type
Endpoints of type serverless should follow the format https://<your-endpoint>.<your_region>.inference.ml.azure.com/v1/chat/completions or https://<your-endpoint>.<your_region>.inference.ml.azure.com/v1/chat/completions (type=value_error)
Description
Azure have updated their endpoint urls to exclude v1 from /v1/chat/completions.
if field_value == AzureMLEndpointApiType.serverless and not (
endpoint_url.endswith("/v1/completions") # type: ignore[union-attr]
or endpoint_url.endswith("/v1/chat/completions") # type: ignore[union-attr]
):
Checked other resources
Example Code
The following code:
Error Message and Stack Trace (if applicable)
Traceback (most recent call last):
File ~/opt/miniconda3/envs/envml/lib/python3.11/site-packages/spyder_kernels/py3compat.py:356 in compat_exec exec(code, globals, locals)
File ~/Programming/temp/test_mistral_2407.py:26 chat = AzureMLChatOnlineEndpoint(
File ~/opt/miniconda3/envs/envml/lib/python3.11/site-packages/langchain_core/load/serializable.py:113 in init super().init(*args, **kwargs)
File pydantic/main.py:341 in pydantic.main.BaseModel.init
ValidationError: 1 validation error for AzureMLChatOnlineEndpoint endpoint_api_type Endpoints of type
serverless
should follow the formathttps://<your-endpoint>.<your_region>.inference.ml.azure.com/v1/chat/completions
orhttps://<your-endpoint>.<your_region>.inference.ml.azure.com/v1/chat/completions
(type=value_error)Description
Azure have updated their endpoint urls to exclude v1 from /v1/chat/completions.
The broken code is in (ln 457);
https://github.com/langchain-ai/langchain/blob/master/libs/community/langchain_community/llms/azureml_endpoint.py
Easy to fix by removing v1.
System Info
langchain==0.2.14 langchain-aws==0.1.6 langchain-community==0.2.12 langchain-core==0.2.34 langchain-openai==0.1.8 langchain-text-splitters==0.2.1
Python 3.11.4