-
Notifications
You must be signed in to change notification settings - Fork 770
Usable "getting started" docs in README
, both interpreter and Jupyter
#953
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@@ -190,13 +192,13 @@ search over that index, then break the files into chunked evidence contexts, ran | |||
All prior answers will be indexed and stored, you can view them by querying via the `search` subcommand, or access them yourself in your `PQA_HOME` directory, which defaults to `~/.pqa/`. | |||
|
|||
```bash | |||
$ pqa search -i 'answers' 'antibodies' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This didn't run earlier regardless
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR improves usability by adding a run_or_ensure function to support both synchronous interpreter and asynchronous Jupyter notebook environments. It also updates the CLI usage in the README and adjusts agent functions to leverage the new utility.
- Introduces run_or_ensure for coroutine handling.
- Modifies several agent functions in init.py to use run_or_ensure instead of directly calling get_loop().
- Updates README snippets to reflect the changes and enhance usability.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
File | Description |
---|---|
paperqa/utils.py | Adds the run_or_ensure function and updates imports. |
paperqa/agents/init.py | Updates function implementations to use run_or_ensure for async handling. |
README.md | Revises CLI examples to match the updated functionality. |
Comments suppressed due to low confidence (1)
paperqa/utils.py:218
- Ensure that the generic type 'T' is imported or defined (e.g., from typing import TypeVar; T = TypeVar('T')) to support generics in the run_or_ensure function.
def run_or_ensure(coro: Awaitable[T]) -> T | asyncio.Task[T]:
faee3ab
to
aaeb64d
Compare
aaeb64d
to
faf8df3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
@@ -190,13 +192,13 @@ search over that index, then break the files into chunked evidence contexts, ran | |||
All prior answers will be indexed and stored, you can view them by querying via the `search` subcommand, or access them yourself in your `PQA_HOME` directory, which defaults to `~/.pqa/`. | |||
|
|||
```bash | |||
$ pqa search -i 'answers' 'antibodies' | |||
pqa -i 'answers' search 'ranking and contextual summarization' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we know how many people uses the cli? Based on the issues, there are a few people who use it mainly for ollama queries.
I'm curious if we should focus on addressing those ~10 people comments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah let's address them, just in another PR if it's cool 😈
@maykcaldas made a good comment here: #925 (comment)
This PR:
run_or_ensure
function to allow both interpreter and Jupyter usageREADME
snippets