Skip to content

🐛(backend) improve prompt to not use code blocks delimiter #1188

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

Merged
merged 1 commit into from
Jul 18, 2025

Conversation

AntoLC
Copy link
Collaborator

@AntoLC AntoLC commented Jul 16, 2025

Purpose

The AI answer was activating the code block feature in the editor, which was not desired.

Proposal

The prompt for AI actions has been updated to instruct the AI to return content directly without wrapping it in code blocks or markdown delimiters.

@AntoLC AntoLC self-assigned this Jul 16, 2025
@AntoLC AntoLC force-pushed the fix/ai-codeblock branch from 5b6ab5e to eb0ddd5 Compare July 16, 2025 14:24
@AntoLC AntoLC requested a review from Copilot July 16, 2025 14:26
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR updates the AI prompt to prevent wrapping responses in Markdown code block delimiters.

  • Revised the prompt text in the AI service to instruct responses without code fences
  • Updated two existing tests to match the new prompt wording
  • Added an entry in CHANGELOG for the backend fix

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
src/backend/core/services/ai_services.py Adjusted AI_ACTIONS prompt to remove code block delimiters
src/backend/core/tests/documents/test_api_documents_ai_transform.py Updated expected system prompts in two tests to match new wording
CHANGELOG.md Added “Fixed” note under Unreleased for this change

@AntoLC AntoLC requested review from lunika and virgile-dev July 16, 2025 14:28
The AI answer was activating the code block feature
in the editor, which was not desired.
The prompt for AI actions has been updated to
instruct the AI to return content directly
without wrapping it in code blocks or markdown
delimiters.
@AntoLC AntoLC force-pushed the fix/ai-codeblock branch from eb0ddd5 to 1c71e83 Compare July 18, 2025 10:04
@AntoLC AntoLC merged commit 1c71e83 into main Jul 18, 2025
20 of 21 checks passed
@AntoLC AntoLC deleted the fix/ai-codeblock branch July 18, 2025 10:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants