[fix][backend]Fix the issue where requesting the Azure API returns a 404 error#190
Conversation
CozeLoop
left a comment
There was a problem hiding this comment.
Reviewed the PR focusing strictly on modified backend files, excluding generated and frontend paths per scope. The changes address two issues:
-
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.
-
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.
Codecov Report❌ Patch coverage is
@@ 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
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 1 file with indirect coverage changes Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
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