Skip to content

Fix Azure embedding endpoint handling - #16993

Merged
JinHai-CN merged 1 commit into
infiniflow:mainfrom
zcxGGmu:fix/issue-16968-azure-embedding-endpoint
Aug 28, 2026
Merged

JinHai-CN merged 1 commit into
infiniflow:mainfrom
zcxGGmu:fix/issue-16968-azure-embedding-endpoint

Conversation

@zcxGGmu

@zcxGGmu zcxGGmu commented Jul 16, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fixes #16968.

Azure embedding clients should receive the Azure OpenAI resource endpoint, not an OpenAI-compatible /v1 endpoint. This PR stops appending /v1 when initializing AzureEmbed, while still trimming whitespace and a trailing slash from the configured endpoint.

Changes

  • Preserve the configured Azure resource endpoint for AzureOpenAI(azure_endpoint=...).
  • Keep Azure API key and API version parsing unchanged.
  • Add a regression test that verifies the Azure endpoint passed to the SDK does not gain an /v1 suffix.

Tests

  • uv sync --python 3.13 --group test --frozen
  • uv run python -m pytest test/unit_test/rag/llm/test_embedding_model.py::TestAzureEmbeddingEndpoint::test_uses_azure_resource_endpoint_without_openai_v1_suffix -q
  • uv run python -m pytest test/unit_test/rag/llm/test_embedding_model.py -q
  • uv run ruff check rag/llm/embedding_model.py test/unit_test/rag/llm/test_embedding_model.py
  • git diff --check

@dosubot dosubot Bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Jul 16, 2026
@yuzhichang
yuzhichang requested a review from Lynn-Inf July 18, 2026 10:37

@Lynn-Inf Lynn-Inf left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@JinHai-CN JinHai-CN added the ci Continue Integration label Aug 27, 2026
@JinHai-CN
JinHai-CN merged commit 3f0cf5a into infiniflow:main Aug 28, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci Continue Integration size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Azure openai embedding model CAN NOT be added

4 participants