-
Notifications
You must be signed in to change notification settings - Fork 195
feat: updated system prompt for player link #183
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
WalkthroughAdded a new policy rule to the REASONING_SYSTEM_PROMPT in backend/director/core/reasoning.py requiring HLS (m3u8) links to be accompanied by a corresponding player link formatted as https://console.videodb.io/player?url={hls_url}. No code structure or control flow changes. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
backend/director/core/reasoning.py(1 hunks)
🔇 Additional comments (1)
backend/director/core/reasoning.py (1)
65-67: Add test coverage or manual validation for HLS Stream Display instruction
No existing tests reference.m3u8orplayer_url—add unit/integration tests (or manually verify) to ensure the LLM consistently outputshttps://console.videodb.io/player?url={hls_url}alongside HLS URLs across different query patterns.
| 9. **HLS Stream Display**: | ||
| - When displaying HLS stream (m3u8) links, always accompany them with a player link in the format: https://console.videodb.io/player?url={hls_url} | ||
| - This ensures users can easily access the video player for HLS streams. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clarify URL encoding requirement in the instruction.
The instruction should explicitly state that {hls_url} must be URL-encoded when inserted into the query parameter to handle HLS URLs containing special characters (e.g., ?, &, =). Without proper encoding, player links may break.
Apply this diff to make the encoding requirement explicit:
9. **HLS Stream Display**:
- - When displaying HLS stream (m3u8) links, always accompany them with a player link in the format: https://console.videodb.io/player?url={hls_url}
+ - When displaying HLS stream (m3u8) links, always accompany them with a player link in the format: https://console.videodb.io/player?url={url_encoded_hls_url}
+ - Ensure the HLS URL is properly URL-encoded before inserting it into the query parameter.
- This ensures users can easily access the video player for HLS streams.
📝 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.
| 9. **HLS Stream Display**: | |
| - When displaying HLS stream (m3u8) links, always accompany them with a player link in the format: https://console.videodb.io/player?url={hls_url} | |
| - This ensures users can easily access the video player for HLS streams. | |
| 9. **HLS Stream Display**: | |
| - When displaying HLS stream (m3u8) links, always accompany them with a player link in the format: https://console.videodb.io/player?url={url_encoded_hls_url} | |
| - Ensure the HLS URL is properly URL-encoded before inserting it into the query parameter. | |
| - This ensures users can easily access the video player for HLS streams. |
🤖 Prompt for AI Agents
In backend/director/core/reasoning.py around lines 65 to 67, the HLS player-link
guidance omits that the {hls_url} must be URL-encoded; update the instruction to
explicitly require URL-encoding (e.g., using percent-encoding) when inserting
the HLS URL into the query parameter so characters like ?, &, = are escaped
(resulting in links like
https://console.videodb.io/player?url={url_encoded_hls_url}); make the text
clear and concise, mention percent-encoding or use of standard URL-encoding
functions, and keep the example format showing the encoded placeholder.
Previous Behaviour
console.videodb.io/player?url=<stream_url>to be manually be visitedProposed Behaviour
Summary by CodeRabbit