LCORE-1262: Updated responses examples#1375
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
WalkthroughAdded token-detail fields to example Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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: 3
🧹 Nitpick comments (1)
src/models/responses.py (1)
1646-1646: Prefer an SSE-valid placeholder for omitted events.Using raw
...is not a valid SSE line format. Consider an SSE comment line (e.g.,: ...) or adata:placeholder to keep the sample syntactically consistent.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/models/responses.py` at line 1646, The placeholder string "...\n\n" is not valid SSE; replace that literal with an SSE-valid placeholder such as a comment line ": ...\n\n" or a data field "data: ...\n\n" wherever the "...\n\n" token appears (search for the exact string "...\n\n" in the responses definitions) so emitted samples are syntactically valid SSE.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@docs/openapi.json`:
- Line 4290: The SSE example mixes event: "response.created" with a payload
whose "type" is "response.in_progress"; update the SSE frames so the event name
matches the payload type (change the first frame's event from "response.created"
to "response.in_progress") in both occurrences (the example block containing the
string "event: response.created" and the JSON payload with
"\"type\":\"response.in_progress\""); ensure the corresponding later example
stays consistent as well (the final "response.completed" frame already matches
"type":"response.completed").
- Line 4290: The SSE transcript example in the "example" string includes a
literal "...\n\n" placeholder which breaks parseability; replace that
placeholder with a valid SSE-safe omission (for example a comment line starting
with ":" like ": omitted events\n\n") or remove the placeholder entirely so the
stream remains valid, ensuring the example still flows from the earlier events
(e.g., the block containing "event: response.in_progress" and "event:
response.output_item.added") to the later "event: response.completed" entry;
apply the same replacement for the other occurrence referenced in this file.
In `@src/models/responses.py`:
- Around line 1634-1640: The SSE example's event header "event:
response.created" is inconsistent with the JSON payload field
`"type":"response.in_progress"`; update the payload `type` to
`"response.created"` to match the event and the producer behavior (see the
emitter in endpoints/responses.py), i.e., change the `"type"` value in the JSON
block that currently reads `"response.in_progress"` to `"response.created"` so
the event name and payload are consistent.
---
Nitpick comments:
In `@src/models/responses.py`:
- Line 1646: The placeholder string "...\n\n" is not valid SSE; replace that
literal with an SSE-valid placeholder such as a comment line ": ...\n\n" or a
data field "data: ...\n\n" wherever the "...\n\n" token appears (search for the
exact string "...\n\n" in the responses definitions) so emitted samples are
syntactically valid SSE.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: f7417fba-7ce8-4a71-8fe1-b75fee5ecb91
📒 Files selected for processing (2)
docs/openapi.jsonsrc/models/responses.py
e2c3035 to
a3f6235
Compare
Description
This PR updates examples for v1/responses endpoint. Namely enriches non-streaming example by adding additional fields and fixes rendering of streaming example.
Type of change
Tools used to create PR
Identify any AI code assistants used in this PR (for transparency and review context)
Related Tickets & Documents
Checklist before requesting a review
Testing
Summary by CodeRabbit