From 5ed797453ddb47600b361de145173c3a504cfecc Mon Sep 17 00:00:00 2001 From: mskarlin <12701035+mskarlin@users.noreply.github.com> Date: Wed, 11 Sep 2024 15:50:38 -0700 Subject: [PATCH] Reset default settings to use high_quality and remove truncation (#374) --- paperqa/agents/__init__.py | 3 +-- paperqa/agents/main.py | 9 ++------- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/paperqa/agents/__init__.py b/paperqa/agents/__init__.py index be31fd96..389b4ba7 100644 --- a/paperqa/agents/__init__.py +++ b/paperqa/agents/__init__.py @@ -92,7 +92,6 @@ def ask(query: str, settings: Settings) -> AnswerResponse: return get_loop().run_until_complete( agent_query( QueryRequest(query=query, settings=settings), - verbosity=settings.verbosity, agent_type=settings.agent.agent_type, ) ) @@ -162,7 +161,7 @@ def main() -> None: parser.add_argument( "--settings", "-s", - default="default", + default="high_quality", help=( "Named settings to use. Will search in local, pqa directory, and package" " last" diff --git a/paperqa/agents/main.py b/paperqa/agents/main.py index 885156ea..ec4e510a 100644 --- a/paperqa/agents/main.py +++ b/paperqa/agents/main.py @@ -64,7 +64,6 @@ async def agent_query( query: str | QueryRequest, docs: Docs | None = None, agent_type: str | type = DEFAULT_AGENT_TYPE, - verbosity: int = 0, **env_kwargs, ) -> AnswerResponse: if isinstance(query, str): @@ -81,12 +80,8 @@ async def agent_query( response = await run_agent(docs, query, agent_type, **env_kwargs) agent_logger.debug(f"agent_response: {response}") - truncation_chars = 1_000_000 if verbosity > 1 else 1500 * (verbosity + 1) - agent_logger.info( - f"[bold blue]Answer: {response.answer.answer[:truncation_chars]}" - f"{'...(truncated)' if len(response.answer.answer) > truncation_chars else ''}" - "[/bold blue]" - ) + + agent_logger.info(f"[bold blue]Answer: {response.answer.answer}[/bold blue]") await search_index.add_document( {