From 59dd4a7cf528de0c5087b20de635062b5070db22 Mon Sep 17 00:00:00 2001 From: James Braza Date: Wed, 13 Nov 2024 15:12:30 -0800 Subject: [PATCH] Fixed agent prompt names and contents after #681 mess up (#683) --- paperqa/prompts.py | 6 +++--- paperqa/settings.py | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/paperqa/prompts.py b/paperqa/prompts.py index 0f333010..b7bb8e68 100644 --- a/paperqa/prompts.py +++ b/paperqa/prompts.py @@ -77,11 +77,11 @@ where `summary` is relevant information from text - {summary_length} words and `relevance_score` is the relevance of `summary` to answer question (out of 10). """ # noqa: E501 -agent_system_prompt = ( +env_system_prompt = ( # Matching https://github.com/langchain-ai/langchain/blob/langchain%3D%3D0.2.3/libs/langchain/langchain/agents/openai_functions_agent/base.py#L213-L215 - "Optional system prompt message to precede the below agent_prompt." + "You are a helpful AI assistant." ) -agent_env_prompt = ( +env_reset_prompt = ( "Use the tools to answer the question: {question}" "\n\nThe {gen_answer_tool_name} tool output is visible to the user," " so you do not need to restate the answer" diff --git a/paperqa/settings.py b/paperqa/settings.py index 2f40f855..910ac368 100644 --- a/paperqa/settings.py +++ b/paperqa/settings.py @@ -44,10 +44,10 @@ from paperqa.prompts import ( CONTEXT_INNER_PROMPT, CONTEXT_OUTER_PROMPT, - agent_env_prompt, - agent_system_prompt, citation_prompt, default_system_prompt, + env_reset_prompt, + env_system_prompt, qa_prompt, select_paper_prompt, structured_citation_prompt, @@ -446,10 +446,10 @@ class AgentSettings(BaseModel): description="Optional kwarg for AGENT constructor", ) agent_system_prompt: str | None = Field( - default=agent_system_prompt, + default=env_system_prompt, description="Optional system prompt message to precede the below agent_prompt.", ) - agent_prompt: str = agent_env_prompt + agent_prompt: str = env_reset_prompt return_paper_metadata: bool = Field( default=False, description=(