Repository navigation
Docs: update chat completions docs - #16100
Conversation
📝 WalkthroughWalkthroughThe HTTP API reference for Changeslegacy streaming parameter documentation
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested labels
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/references/http_api_reference.md`:
- Around line 4313-4328: The response example in the documentation shows the
final flag set to false when it should be true. This chunk is emitted from
final_answer, so the final flag must be set to true to correctly document the
API contract and prevent streaming clients from misinterpreting when the
response is complete. Change the final field value from false to true in the
example response JSON.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 782d646a-449c-4002-bc47-24125f63da87
📒 Files selected for processing (1)
docs/references/http_api_reference.md
| "code": 0, | ||
| "message": "", | ||
| "data": { | ||
| "answer": "<think>The user just said \"hello\". I should respond warmly and ask how I can help. Let's keep it short and friendly.</think>Hello! 👋 Welcome!", | ||
| "reference": { | ||
| "chunks": [] | ||
| }, | ||
| "audio_binary": null, | ||
| "prompt": "", | ||
| "created_at": 1781250171.5262048, | ||
| "final": false, | ||
| "id": "76961783-1523-43f7-8148-19da08247922", | ||
| "session_id": "4edfabd6663211f1943e217dfc5f0165", | ||
| "chat_id": "d90fd732646f11f1803d2fb3c77f9b23" | ||
| } | ||
| } |
There was a problem hiding this comment.
Mark the terminal legacy chunk as final.
This chunk is emitted from final_answer, so it should keep the upstream final flag. Showing final: false here documents the wrong contract and can mislead streaming clients about when the response is complete.
Suggested fix
- "final": false,
+ "final": true,📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| "code": 0, | |
| "message": "", | |
| "data": { | |
| "answer": "<think>The user just said \"hello\". I should respond warmly and ask how I can help. Let's keep it short and friendly.</think>Hello! 👋 Welcome!", | |
| "reference": { | |
| "chunks": [] | |
| }, | |
| "audio_binary": null, | |
| "prompt": "", | |
| "created_at": 1781250171.5262048, | |
| "final": false, | |
| "id": "76961783-1523-43f7-8148-19da08247922", | |
| "session_id": "4edfabd6663211f1943e217dfc5f0165", | |
| "chat_id": "d90fd732646f11f1803d2fb3c77f9b23" | |
| } | |
| } | |
| "code": 0, | |
| "message": "", | |
| "data": { | |
| "answer": "<think>The user just said \"hello\". I should respond warmly and ask how I can help. Let's keep it short and friendly.</think>Hello! 👋 Welcome!", | |
| "reference": { | |
| "chunks": [] | |
| }, | |
| "audio_binary": null, | |
| "prompt": "", | |
| "created_at": 1781250171.5262048, | |
| "final": true, | |
| "id": "76961783-1523-43f7-8148-19da08247922", | |
| "session_id": "4edfabd6663211f1943e217dfc5f0165", | |
| "chat_id": "d90fd732646f11f1803d2fb3c77f9b23" | |
| } | |
| } |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@docs/references/http_api_reference.md` around lines 4313 - 4328, The response
example in the documentation shows the final flag set to false when it should be
true. This chunk is emitted from final_answer, so the final flag must be set to
true to correctly document the API contract and prevent streaming clients from
misinterpreting when the response is complete. Change the final field value from
false to true in the example response JSON.
### What problem does this PR solve? Syncs the /api/v1/chat/completions docs with the current behavior, including the new legacy streaming mode. ### Type of change - [x] Documentation Update
What problem does this PR solve?
Syncs the /api/v1/chat/completions docs with the current behavior, including the new legacy streaming mode.
Type of change