mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-05-08 15:22:39 +02:00
refactor: streamline language instruction handling across prompts
This commit is contained in:
parent
807f4055f9
commit
120d60465e
4 changed files with 18 additions and 31 deletions
|
|
@ -1,5 +1,5 @@
|
|||
import datetime
|
||||
|
||||
from ..prompts import _build_language_instruction
|
||||
|
||||
def get_qna_citation_system_prompt(chat_history: str | None = None, language: str | None = None):
|
||||
chat_history_section = (
|
||||
|
|
@ -17,10 +17,7 @@ NO CHAT HISTORY PROVIDED
|
|||
)
|
||||
|
||||
# Add language instruction if specified
|
||||
language_instruction = ""
|
||||
if language:
|
||||
language_instruction = f"\n\nIMPORTANT: Please respond in {language} language. All your responses, explanations, and analysis should be written in {language}."
|
||||
|
||||
language_instruction = _build_language_instruction(language)
|
||||
return f"""
|
||||
Today's date: {datetime.datetime.now().strftime("%Y-%m-%d")}
|
||||
You are SurfSense, an advanced AI research assistant that provides detailed, well-researched answers to user questions by synthesizing information from multiple personal knowledge sources.{language_instruction}
|
||||
|
|
@ -170,9 +167,7 @@ NO CHAT HISTORY PROVIDED
|
|||
)
|
||||
|
||||
# Add language instruction if specified
|
||||
language_instruction = ""
|
||||
if language:
|
||||
language_instruction = f"\n\nIMPORTANT: Please respond in {language} language. All your responses, explanations, and analysis should be written in {language}."
|
||||
language_instruction = _build_language_instruction(language)
|
||||
|
||||
return f"""
|
||||
Today's date: {datetime.datetime.now().strftime("%Y-%m-%d")}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue