Skip to content

Commit 3410f13

Browse files
committed
Updated README for deprecations
1 parent 4e0e6c2 commit 3410f13

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

README.md

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,9 @@ from paperqa import Settings, ask
362362

363363
answer_response = ask(
364364
"What is PaperQA2?",
365-
settings=Settings(temperature=0.5, paper_directory="my_papers"),
365+
settings=Settings(
366+
temperature=0.5, agent={"index": {"paper_directory": "my_papers"}}
367+
),
366368
)
367369
```
368370

@@ -374,7 +376,9 @@ from paperqa import Settings, agent_query
374376

375377
answer_response = await agent_query(
376378
query="What is PaperQA2?",
377-
settings=Settings(temperature=0.5, paper_directory="my_papers"),
379+
settings=Settings(
380+
temperature=0.5, agent={"index": {"paper_directory": "my_papers"}}
381+
),
378382
)
379383
```
380384

@@ -469,7 +473,7 @@ from paperqa import Settings, ask
469473
answer_response = ask(
470474
"What is PaperQA2?",
471475
settings=Settings(
472-
llm="gpt-4o-mini", summary_llm="gpt-4o-mini", paper_directory="my_papers"
476+
llm="gpt-4o-mini", summary_llm="gpt-4o-mini", agent={"index": {"paper_directory": "my_papers"}}
473477
),
474478
)
475479
```
@@ -796,9 +800,9 @@ for ... in my_docs:
796800
Indexes will be placed in the [home directory][home dir] by default.
797801
This can be controlled via the `PQA_HOME` environment variable.
798802

799-
Indexes are made by reading files in the `Settings.paper_directory`.
803+
Indexes are made by reading files in the `IndexSettings.paper_directory`.
800804
By default, we recursively read from subdirectories of the paper directory,
801-
unless disabled using `Settings.index_recursively`.
805+
unless disabled using `IndexSettings.recurse_subdirectories`.
802806
The paper directory is not modified in any way, it's just read from.
803807

804808
[home dir]: https://docs.python.org/3/library/pathlib.html#pathlib.Path.home
@@ -824,7 +828,7 @@ which also works when called on `DocDetails`.
824828
### Reusing Index
825829

826830
The local search indexes are built based on a hash of the current `Settings` object.
827-
So make sure you properly specify the `paper_directory` to your `Settings` object.
831+
So make sure you properly specify the `paper_directory` to your `IndexSettings` object.
828832
In general, it's advisable to:
829833

830834
1. Pre-build an index given a folder of papers (can take several minutes)
@@ -839,7 +843,7 @@ from paperqa.agents.search import get_directory_index
839843

840844

841845
async def amain(folder_of_papers: str | os.PathLike) -> None:
842-
settings = Settings(paper_directory=folder_of_papers)
846+
settings = Settings(agent={"index": {"paper_directory": folder_of_papers}})
843847

844848
# 1. Build the index. Note an index name is autogenerated when unspecified
845849
built_index = await get_directory_index(settings=settings)
@@ -939,17 +943,13 @@ will return much faster than the first query and we'll be certain the authors ma
939943
| `answer.group_contexts_by_question` | `False` | Groups the final contexts by the underlying `gather_evidence` question in the final context prompt. |
940944
| `answer.evidence_relevance_score_cutoff` | `1` | Cutoff evidence relevance score to include in the answer context (inclusive) |
941945
| `answer.skip_evidence_citation_strip` | `False` | Skip removal of citations from the `gather_evidence` contexts |
942-
| `parsing.chunk_size` | `5000` | Characters per chunk (0 for no chunking). |
943946
| `parsing.page_size_limit` | `1,280,000` | Character limit per page. |
944-
| `parsing.pdfs_use_block_parsing` | `False` | Opt-in flag for block-based PDF parsing over text-based PDF parsing. |
945947
| `parsing.use_doc_details` | `True` | Whether to get metadata details for docs. |
946-
| `parsing.overlap` | `250` | Characters to overlap chunks. |
947948
| `parsing.reader_config` | `dict` | Optional keyword arguments for the document reader. |
948949
| `parsing.multimodal` | `True` | Control to parse both text and media from applicable documents, as well as potentially enriching them with text descriptions. |
949950
| `parsing.defer_embedding` | `False` | Whether to defer embedding until summarization. |
950951
| `parsing.parse_pdf` | `paperqa_pypdf.parse_pdf_to_pages` | Function to parse PDF files. |
951952
| `parsing.configure_pdf_parser` | No-op | Callable to configure the PDF parser within `parse_pdf`, useful for behaviors such as enabling logging. |
952-
| `parsing.chunking_algorithm` | `ChunkingOptions.SIMPLE_OVERLAP` | Algorithm for chunking. |
953953
| `parsing.doc_filters` | `None` | Optional filters for allowed documents. |
954954
| `parsing.use_human_readable_clinical_trials` | `False` | Parse clinical trial JSONs into readable text. |
955955
| `parsing.enrichment_llm` | `"gpt-4o-2024-11-20"` | LLM for media enrichment. |
@@ -976,7 +976,6 @@ will return much faster than the first query and we'll be certain the authors ma
976976
| `agent.return_paper_metadata` | `False` | Whether to include paper title/year in search tool results. |
977977
| `agent.search_count` | `8` | Search count. |
978978
| `agent.timeout` | `500.0` | Timeout on agent execution (seconds). |
979-
| `agent.should_pre_search` | `False` | Whether to run search tool before invoking agent. |
980979
| `agent.tool_names` | `None` | Optional override on tools to provide the agent. |
981980
| `agent.max_timesteps` | `None` | Optional upper limit on environment steps. |
982981
| `agent.index.name` | `None` | Optional name of the index. |

0 commit comments

Comments
 (0)