refactor: streamline language instruction handling across prompts

This commit is contained in:
Tarun 2025-10-12 23:40:46 +05:30
parent 807f4055f9
commit 120d60465e
4 changed files with 18 additions and 31 deletions

View file

@ -1,10 +1,11 @@
import datetime
def get_answer_outline_system_prompt(language: str | None = None) -> str:
language_instruction = ""
def _build_language_instruction(language: str | None = None):
if language:
language_instruction = f"\n\nIMPORTANT: Please respond in {language} language. All your responses, explanations, and analysis should be written in {language}."
return f"\n\nIMPORTANT: Please respond in {language} language. All your responses, explanations, and analysis should be written in {language}."
return ""
def get_answer_outline_system_prompt(language: str | None = None) -> str:
language_instruction = _build_language_instruction(language)
return f"""
Today's date: {datetime.datetime.now().strftime("%Y-%m-%d")}