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,6 +1,5 @@
|
|||
import datetime
|
||||
|
||||
|
||||
from ..prompts import _build_language_instruction
|
||||
def get_citation_system_prompt(chat_history: str | None = None, language: str | None = None):
|
||||
chat_history_section = (
|
||||
f"""
|
||||
|
|
@ -17,9 +16,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")}
|
||||
|
|
@ -177,9 +174,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