Skip to content

Commit

Permalink
Reset default settings to use high_quality and remove truncation (#374)
Browse files Browse the repository at this point in the history
  • Loading branch information
mskarlin committed Sep 11, 2024
1 parent 8905157 commit 5ed7974
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
3 changes: 1 addition & 2 deletions paperqa/agents/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
)
Expand Down Expand Up @@ -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"
Expand Down
9 changes: 2 additions & 7 deletions paperqa/agents/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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(
{
Expand Down

0 comments on commit 5ed7974

Please sign in to comment.