Skip to content

[fix][backend]Fix the issue where requesting the Azure API returns a 404 error#190

Merged
yyyhhl merged 2 commits into
mainfrom
fix/model_config
Sep 17, 2025
Merged

[fix][backend]Fix the issue where requesting the Azure API returns a 404 error#190
yyyhhl merged 2 commits into
mainfrom
fix/model_config

Conversation

@yyyhhl
Copy link
Copy Markdown
Collaborator

@yyyhhl yyyhhl commented Sep 17, 2025

What type of PR is this?

fix: A bug fix

Check the PR title.

Fix the issue where requesting the Azure API returns a 404 error

(Optional) Translate the PR title into Chinese.

修复请求azure api会报错404的问题

(Optional) Which issue(s) this PR fixes:

Fixes #189

@yyyhhl yyyhhl changed the title \[fix\]\[backend\]Fix the issue where requesting the Azure API returns a 404 error [fix][backend]Fix the issue where requesting the Azure API returns a 404 error Sep 17, 2025
Copy link
Copy Markdown
Collaborator

@CozeLoop CozeLoop left a comment

Choose a reason for hiding this comment

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

Reviewed the PR focusing strictly on modified backend files, excluding generated and frontend paths per scope. The changes address two issues:

  1. entity/manage.go: Align JSON/YAML/mapstructure tags for ProtocolConfigOpenAI from "protocol_config_open_ai" to "protocol_config_openai" to match IDL/config usage. This eliminates config unmarshalling mismatches and is consistent across the repo.

  2. eino/init.go (openAIBuilder): Scope the cfg.ResponseFormat assignment within the non-empty ResponseFormatJsonSchema branch. This prevents setting a response format with an empty schema, which can cause Azure OpenAI endpoints to reject requests (observed 404). The current logic sets ResponseFormat only when schema is present; otherwise, respects defaults.

No correctness, concurrency, performance, or security issues were found on the changed lines. Backward compatibility risk appears low since examples and IDL already use "protocol_config_openai"; if any external configs still use the deprecated "open_ai" key, they will need to migrate. Suggest adding a brief release note.

Approved.

lsy357
lsy357 previously approved these changes Sep 17, 2025
@codecov
Copy link
Copy Markdown

codecov Bot commented Sep 17, 2025

Codecov Report

❌ Patch coverage is 80.00000% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...nd/modules/llm/domain/service/llmimpl/eino/init.go 80.00% 0 Missing and 1 partial ⚠️

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #190      +/-   ##
==========================================
+ Coverage   58.80%   58.81%   +0.01%     
==========================================
  Files         512      512              
  Lines       53303    53303              
==========================================
+ Hits        31345    31352       +7     
+ Misses      19576    19570       -6     
+ Partials     2382     2381       -1     
Flag Coverage Δ
unittests 58.81% <80.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
backend/modules/llm/domain/entity/manage.go 84.96% <ø> (ø)
...nd/modules/llm/domain/service/llmimpl/eino/init.go 56.98% <80.00%> (+0.26%) ⬆️

... and 1 file with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 397e3a9...940a3fd. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@yyyhhl yyyhhl merged commit e6a0e0a into main Sep 17, 2025
15 checks passed
@yyyhhl yyyhhl deleted the fix/model_config branch September 17, 2025 15:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Azure Open AI 404 not found

3 participants