Skip to content

Commit 717e620

Browse files
committed
Updated README for deprecations
1 parent c77daa7 commit 717e620

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

README.md

Lines changed: 11 additions & 8 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
```
@@ -772,9 +776,9 @@ for ... in my_docs:
772776
Indexes will be placed in the [home directory][home dir] by default.
773777
This can be controlled via the `PQA_HOME` environment variable.
774778

775-
Indexes are made by reading files in the `Settings.paper_directory`.
779+
Indexes are made by reading files in the `IndexSettings.paper_directory`.
776780
By default, we recursively read from subdirectories of the paper directory,
777-
unless disabled using `Settings.index_recursively`.
781+
unless disabled using `IndexSettings.recurse_subdirectories`.
778782
The paper directory is not modified in any way, it's just read from.
779783

780784
[home dir]: https://docs.python.org/3/library/pathlib.html#pathlib.Path.home
@@ -800,7 +804,7 @@ which also works when called on `DocDetails`.
800804
### Reusing Index
801805

802806
The local search indexes are built based on a hash of the current `Settings` object.
803-
So make sure you properly specify the `paper_directory` to your `Settings` object.
807+
So make sure you properly specify the `paper_directory` to your `IndexSettings` object.
804808
In general, it's advisable to:
805809

806810
1. Pre-build an index given a folder of papers (can take several minutes)
@@ -815,7 +819,7 @@ from paperqa.agents.search import get_directory_index
815819

816820

817821
async def amain(folder_of_papers: str | os.PathLike) -> None:
818-
settings = Settings(paper_directory=folder_of_papers)
822+
settings = Settings(agent={"index": {"paper_directory": folder_of_papers}})
819823

820824
# 1. Build the index. Note an index name is autogenerated when unspecified
821825
built_index = await get_directory_index(settings=settings)
@@ -947,7 +951,6 @@ will return much faster than the first query and we'll be certain the authors ma
947951
| `agent.return_paper_metadata` | `False` | Whether to include paper title/year in search tool results. |
948952
| `agent.search_count` | `8` | Search count. |
949953
| `agent.timeout` | `500.0` | Timeout on agent execution (seconds). |
950-
| `agent.should_pre_search` | `False` | Whether to run search tool before invoking agent. |
951954
| `agent.tool_names` | `None` | Optional override on tools to provide the agent. |
952955
| `agent.max_timesteps` | `None` | Optional upper limit on environment steps. |
953956
| `agent.index.name` | `None` | Optional name of the index. |

0 commit comments

Comments
 (0)