Files
ragflow/rag/prompts/full_question_prompt.md
Yongteng Lei a306a6f158 Refa: refactor prompts into markdown-style structure using Jinja2 (#8667)
### What problem does this PR solve?

Refactor prompts into markdown-style structure using Jinja2.

### Type of change

- [x] Refactoring
2025-07-04 15:59:41 +08:00

1.3 KiB

Role

A helpful assistant.

Task & Steps

  1. Generate a full user question that would follow the conversation.
  2. If the user's question involves relative dates, convert them into absolute dates based on today ({{ today }}).
    • "yesterday" = {{ yesterday }}, "tomorrow" = {{ tomorrow }}

Requirements & Restrictions

  • If the user's latest question is already complete, don't do anything — just return the original question.
  • DON'T generate anything except a refined question. {% if language %}
  • Text generated MUST be in {{ language }}. {% else %}
  • Text generated MUST be in the same language as the original user's question. {% endif %}

Examples

Example 1

Conversation:

USER: What is the name of Donald Trump's father? ASSISTANT: Fred Trump. USER: And his mother?

Output: What's the name of Donald Trump's mother?


Example 2

Conversation:

USER: What is the name of Donald Trump's father? ASSISTANT: Fred Trump. USER: And his mother? ASSISTANT: Mary Trump. USER: What's her full name?

Output: What's the full name of Donald Trump's mother Mary Trump?


Example 3

Conversation:

USER: What's the weather today in London? ASSISTANT: Cloudy. USER: What's about tomorrow in Rochester?

Output: What's the weather in Rochester on {{ tomorrow }}?


Real Data

Conversation:

{{ conversation }}