Skip to content

Commit d26c102

Browse files
authored
community: Update azureml endpoint (#28953)
- In this PR, I have updated the AzureML Endpoint with the latest endpoint. - **Description:** I have changed the existing `/chat/completions` to `/models/chat/completions` in libs/community/langchain_community/llms/azureml_endpoint.py - **Issue:** #25702 --------- Co-authored-by: = <=>
1 parent 7c28321 commit d26c102

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

libs/community/langchain_community/llms/azureml_endpoint.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,8 @@ def validate_endpoint_url(cls, field_value: Any) -> str:
434434
raise ValueError(
435435
"`endpoint_url` should contain the full invocation URL including "
436436
"`/score` for `endpoint_api_type='dedicated'` or `/completions` "
437-
"or `/chat/completions` for `endpoint_api_type='serverless'`"
437+
"or `/chat/completions` or `/models/chat/completions` "
438+
"for `endpoint_api_type='serverless'`"
438439
)
439440
return field_value
440441

@@ -455,16 +456,19 @@ def validate_endpoint_api_type(
455456
"Endpoints of type `dedicated` should follow the format "
456457
"`https://<your-endpoint>.<your_region>.inference.ml.azure.com/score`."
457458
" If your endpoint URL ends with `/completions` or"
458-
"`/chat/completions`, use `endpoint_api_type='serverless'` instead."
459+
"`/chat/completions` or `/models/chat/completions`,"
460+
"use `endpoint_api_type='serverless'` instead."
459461
)
460462
if field_value == AzureMLEndpointApiType.serverless and not (
461463
endpoint_url.endswith("/completions") # type: ignore[union-attr]
462464
or endpoint_url.endswith("/chat/completions") # type: ignore[union-attr]
465+
or endpoint_url.endswith("/models/chat/completions") # type: ignore[union-attr]
463466
):
464467
raise ValueError(
465468
"Endpoints of type `serverless` should follow the format "
466-
"`https://<your-endpoint>.<your_region>.inference.ml.azure.com/chat/completions`"
469+
"`https://<your-endpoint>.<your_region>.inference.ml.azure.com/completions`"
467470
" or `https://<your-endpoint>.<your_region>.inference.ml.azure.com/chat/completions`"
471+
" or `https://<your-endpoint>.<your_region>.inference.ml.azure.com/models/chat/completions`"
468472
)
469473

470474
return field_value

0 commit comments

Comments
 (0)