diff --git a/backend/danswer/llm/answering/prompts/citations_prompt.py b/backend/danswer/llm/answering/prompts/citations_prompt.py index 21a1edf9015..7dba38ffa45 100644 --- a/backend/danswer/llm/answering/prompts/citations_prompt.py +++ b/backend/danswer/llm/answering/prompts/citations_prompt.py @@ -5,29 +5,35 @@ from danswer.db.search_settings import get_multilingual_expansion from danswer.file_store.utils import InMemoryChatFile from danswer.llm.answering.models import PromptConfig -from danswer.llm.factory import get_llms_for_persona -from danswer.llm.factory import get_main_llm_from_tuple +from danswer.llm.factory import get_llms_for_persona, get_main_llm_from_tuple from danswer.llm.interfaces import LLMConfig -from danswer.llm.utils import build_content_with_imgs -from danswer.llm.utils import check_number_of_tokens -from danswer.llm.utils import get_max_input_tokens +from danswer.llm.utils import ( + build_content_with_imgs, + check_number_of_tokens, + get_max_input_tokens, +) from danswer.prompts.chat_prompts import REQUIRE_CITATION_STATEMENT from danswer.prompts.constants import DEFAULT_IGNORE_STATEMENT -from danswer.prompts.direct_qa_prompts import CITATIONS_PROMPT -from danswer.prompts.direct_qa_prompts import CITATIONS_PROMPT_FOR_TOOL_CALLING -from danswer.prompts.prompt_utils import add_date_time_to_prompt -from danswer.prompts.prompt_utils import add_employee_context_to_prompt -from danswer.prompts.prompt_utils import build_complete_context_str -from danswer.prompts.prompt_utils import build_task_prompt_reminders -from danswer.prompts.token_counts import ADDITIONAL_INFO_TOKEN_CNT -from danswer.prompts.token_counts import CHAT_USER_PROMPT_WITH_CONTEXT_OVERHEAD_TOKEN_CNT -from danswer.prompts.token_counts import CITATION_REMINDER_TOKEN_CNT -from danswer.prompts.token_counts import CITATION_STATEMENT_TOKEN_CNT -from danswer.prompts.token_counts import LANGUAGE_HINT_TOKEN_CNT +from danswer.prompts.direct_qa_prompts import ( + CITATIONS_PROMPT, + CITATIONS_PROMPT_FOR_TOOL_CALLING, +) +from danswer.prompts.prompt_utils import ( + add_date_time_to_prompt, + add_employee_context_to_prompt, + build_complete_context_str, + build_task_prompt_reminders, +) +from danswer.prompts.token_counts import ( + ADDITIONAL_INFO_TOKEN_CNT, + CHAT_USER_PROMPT_WITH_CONTEXT_OVERHEAD_TOKEN_CNT, + CITATION_REMINDER_TOKEN_CNT, + CITATION_STATEMENT_TOKEN_CNT, + LANGUAGE_HINT_TOKEN_CNT, +) from danswer.search.models import InferenceChunk from danswer.utils.logger import setup_logger -from langchain.schema.messages import HumanMessage -from langchain.schema.messages import SystemMessage +from langchain.schema.messages import HumanMessage, SystemMessage logger = setup_logger()