Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions backend/director/core/reasoning.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@

8. **Context Awareness**:
- Adapt responses based on conversation context to maintain relevance.

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.
Comment on lines +65 to +67
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

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.

Suggested change
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.

""".strip()

SUMMARIZATION_PROMPT = """
Expand Down