paper-qa


Namepaper-qa JSON
Version 4.6.0 PyPI version JSON
download
home_pageNone
SummaryLLM Chain for answering questions from docs
upload_time2024-04-27 01:40:36
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseApache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
keywords question answering
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # PaperQA

[![GitHub](https://img.shields.io/badge/github-%23121011.svg?style=for-the-badge&logo=github&logoColor=white)](https://github.com/whitead/paper-qa)
[![tests](https://github.com/whitead/paper-qa/actions/workflows/tests.yml/badge.svg)](https://github.com/whitead/paper-qa)
[![PyPI version](https://badge.fury.io/py/paper-qa.svg)](https://badge.fury.io/py/paper-qa)

This is a minimal package for doing question and answering from
PDFs or text files (which can be raw HTML). It strives to give very good answers, with no hallucinations, by grounding responses with in-text citations.

By default, it uses [OpenAI Embeddings](https://platform.openai.com/docs/guides/embeddings) with a simple numpy vector DB to embed and search documents. However, via [langchain](https://github.com/hwchase17/langchain) you can use open-source models or embeddings (see details below).

paper-qa uses the process shown below:

1. embed docs into vectors
2. embed query into vector
3. search for top k passages in docs
4. create summary of each passage relevant to query
5. score and select only relevant summaries
6. put summaries into prompt
7. generate answer with prompt

See our paper for more details:

```bibtex
@article{lala2023paperqa,
  title={PaperQA: Retrieval-Augmented Generative Agent for Scientific Research},
  author={L{\'a}la, Jakub and O'Donoghue, Odhran and Shtedritski, Aleksandar and Cox, Sam and Rodriques, Samuel G and White, Andrew D},
  journal={arXiv preprint arXiv:2312.07559},
  year={2023}
}
```

## Output Example

Question: How can carbon nanotubes be manufactured at a large scale?

Carbon nanotubes can be manufactured at a large scale using the electric-arc technique (Journet6644). This technique involves creating an arc between two electrodes in a reactor under a helium atmosphere and using a mixture of a metallic catalyst and graphite powder in the anode. Yields of 80% of entangled carbon filaments can be achieved, which consist of smaller aligned SWNTs self-organized into bundle-like crystallites (Journet6644). Additionally, carbon nanotubes can be synthesized and self-assembled using various methods such as DNA-mediated self-assembly, nanoparticle-assisted alignment, chemical self-assembly, and electro-addressed functionalization (Tulevski2007). These methods have been used to fabricate large-area nanostructured arrays, high-density integration, and freestanding networks (Tulevski2007). 98% semiconducting CNT network solution can also be used and is separated from metallic nanotubes using a density gradient ultracentrifugation approach (Chen2014). The substrate is incubated in the solution and then rinsed with deionized water and dried with N2 air gun, leaving a uniform carbon network (Chen2014).

### References

Journet6644: Journet, Catherine, et al. "Large-scale production of single-walled carbon nanotubes by the electric-arc technique." nature 388.6644 (1997): 756-758.

Tulevski2007: Tulevski, George S., et al. "Chemically assisted directed assembly of carbon nanotubes for the fabrication of large-scale device arrays." Journal of the American Chemical Society 129.39 (2007): 11964-11968.

Chen2014: Chen, Haitian, et al. "Large-scale complementary macroelectronics using hybrid integration of carbon nanotubes and IGZO thin-film transistors." Nature communications 5.1 (2014): 4097.

## What's New?

Version 4 removed langchain from the package because it no longer supports pickling. This also simplifies the package a bit - especially prompts. Langchain can still be used, but it's not required. You can use any LLMs from langchain, but you will need to use the `LangchainLLMModel` class to wrap the model.

## Install

Install with pip:

```bash
pip install paper-qa
```

You need to have an LLM to use paper-qa. You can use OpenAI, llama.cpp (via Server), or any LLMs from langchain. OpenAI just works, as long as you have set your OpenAI API key (`export OPENAI_API_KEY=sk-...`). See instructions below for other LLMs.

## Usage

To use paper-qa, you need to have a list of paths/files/urls (valid extensions include: .pdf, .txt). You can then use the `Docs` class to add the documents and then query them. `Docs` will try to guess citation formats from the content of the files, but you can also provide them yourself.

```python

from paperqa import Docs

my_docs = ...# get a list of paths

docs = Docs()
for d in my_docs:
    docs.add(d)

answer = docs.query("What manufacturing challenges are unique to bispecific antibodies?")
print(answer.formatted_answer)
```

The answer object has the following attributes: `formatted_answer`, `answer` (answer alone), `question` , and `context` (the summaries of passages found for answer).

### Async

paper-qa is written to be used asynchronously. The synchronous API is just a wrapper around the async. Here are the methods and their async equivalents:

| Sync                | Async                |
| ------------------- | -------------------- |
| `Docs.add`          | `Docs.aadd`          |
| `Docs.add_file`     | `Docs.aadd_file`     |
| `Docs.add_url`      | `Docs.add_url`       |
| `Docs.get_evidence` | `Docs.aget_evidence` |
| `Docs.query`        | `Docs.aquery`        |

The synchronous version just call the async version in a loop. Most modern python environments support async natively (including Jupyter notebooks!). So you can do this in a Jupyter Notebook:

```py
from paperqa import Docs

my_docs = ...# get a list of paths

docs = Docs()
for d in my_docs:
    await docs.aadd(d)

answer = await docs.aquery("What manufacturing challenges are unique to bispecific antibodies?")
```

### Adding Documents

`add` will add from paths. You can also use `add_file` (expects a file object) or `add_url` to work with other sources.

### Choosing Model

By default, it uses a hybrid of `gpt-3.5-turbo` and `gpt-4-turbo`. You can adjust this:

```py
docs = Docs(llm='gpt-3.5-turbo')
```

or you can use any other model available in [langchain](https://github.com/hwchase17/langchain):

```py
from paperqa import Docs
from langchain_community.chat_models import ChatAnthropic
docs = Docs(llm="langchain",
            client=ChatAnthropic())
```

Note we split the model into the wrapper and `client`, which is `ChatAnthropic` here. This is because `client` stores the non-pickleable part and langchain LLMs are only sometimes serializable/pickleable. The paper-qa `Docs` must always serializable. Thus, we split the model into two parts.

```py
import pickle
docs = Docs(llm="langchain",
            client=ChatAnthropic())
model_str = pickle.dumps(docs)
docs = pickle.loads(model_str)
# but you have to set the client after loading
docs.set_client(ChatAnthropic())
```

#### Locally Hosted

You can use llama.cpp to be the LLM. Note that you should be using relatively large models, because paper-qa requires following a lot of instructions. You won't get good performance with 7B models.

The easiest way to get set-up is to download a [llama file](https://github.com/Mozilla-Ocho/llamafile) and execute it with `-cb -np 4 -a my-llm-model --embedding` which will enable continuous batching and embeddings.

```py
from paperqa import Docs, LlamaEmbeddingModel
from openai import AsyncOpenAI

# start llamap.cpp client with

local_client = AsyncOpenAI(
    base_url="http://localhost:8080/v1",
    api_key = "sk-no-key-required"
)

docs = Docs(client=local_client,
            embedding_model=LlamaEmbeddingModel(),
            llm_model=OpenAILLMModel(config=dict(model="my-llm-model", temperature=0.1, frequency_penalty=1.5, max_tokens=512)))
```

### Changing Embedding Model

You can use langchain embedding models, or the [SentenceTransformer](https://www.sbert.net/) models. For example

```py
from paperqa import Docs, SentenceTransformerEmbeddingModel
from openai import AsyncOpenAI

# start llamap.cpp client with

local_client = AsyncOpenAI(
    base_url="http://localhost:8080/v1",
    api_key = "sk-no-key-required"
)

docs = Docs(client=local_client,
            embedding_model=SentenceTransformerEmbeddingModel(),
            llm_model=OpenAILLMModel(config=dict(model="my-llm-model", temperature=0.1, frequency_penalty=1.5, max_tokens=512)))
```

Just like in the above examples, we have to split the Langchain model into a client and model to keep `Docs` serializable.

```py

from paperqa import Docs, LangchainEmbeddingModel

docs = Docs(embedding_model=LangchainEmbeddingModel(), embedding_client=OpenAIEmbeddings())
```

### Adjusting number of sources

You can adjust the numbers of sources (passages of text) to reduce token usage or add more context. `k` refers to the top k most relevant and diverse (may from different sources) passages. Each passage is sent to the LLM to summarize, or determine if it is irrelevant. After this step, a limit of `max_sources` is applied so that the final answer can fit into the LLM context window. Thus, `k` > `max_sources` and `max_sources` is the number of sources used in the final answer.

```py
docs.query("What manufacturing challenges are unique to bispecific antibodies?", k = 5, max_sources = 2)
```

### Using Code or HTML

You do not need to use papers -- you can use code or raw HTML. Note that this tool is focused on answering questions, so it won't do well at writing code. One note is that the tool cannot infer citations from code, so you will need to provide them yourself.

```python

import glob

source_files = glob.glob('**/*.js')

docs = Docs()
for f in source_files:
    # this assumes the file names are unique in code
    docs.add(f, citation='File ' + os.path.name(f), docname=os.path.name(f))
answer = docs.query("Where is the search bar in the header defined?")
print(answer)
```

### Using External DB/Vector DB and Caching

You may want to cache parsed texts and embeddings in an external database or file. You can then build a Docs object from those directly:

```py

docs = Docs()

for ... in my_docs:
    doc = Doc(docname=...,  citation=..., dockey=..., citation=...)
    texts = [Text(text=..., name=..., doc=doc) for ... in my_texts]
    docs.add_texts(texts, doc)
```

If you want to use an external vector store, you can also do that directly via langchain. For example, to use the [FAISS](https://ai.meta.com/tools/faiss/) vector store from langchain:

```py
from paperqa import LangchainVectorStore, Docs
from langchain_community.vector_store import FAISS
from langchain_openai import OpenAIEmbeddings

my_index = LangchainVectorStore(cls=FAISS, embedding_model=OpenAIEmbeddings())
docs = Docs(texts_index=my_index)

```

## Where do I get papers?

Well that's a really good question! It's probably best to just download PDFs of papers you think will help answer your question and start from there.

### Zotero

If you use [Zotero](https://www.zotero.org/) to organize your personal bibliography,
you can use the `paperqa.contrib.ZoteroDB` to query papers from your library,
which relies on [pyzotero](https://github.com/urschrei/pyzotero).

Install `pyzotero` to use this feature:

```bash
pip install pyzotero
```

First, note that `paperqa` parses the PDFs of papers to store in the database,
so all relevant papers should have PDFs stored inside your database.
You can get Zotero to automatically do this by highlighting the references
you wish to retrieve, right clicking, and selecting _"Find Available PDFs"_.
You can also manually drag-and-drop PDFs onto each reference.

To download papers, you need to get an API key for your account.

1. Get your library ID, and set it as the environment variable `ZOTERO_USER_ID`.
   - For personal libraries, this ID is given [here](https://www.zotero.org/settings/keys) at the part "_Your userID for use in API calls is XXXXXX_".
   - For group libraries, go to your group page `https://www.zotero.org/groups/groupname`, and hover over the settings link. The ID is the integer after /groups/. (_h/t pyzotero!_)
2. Create a new API key [here](https://www.zotero.org/settings/keys/new) and set it as the environment variable `ZOTERO_API_KEY`.
   - The key will need read access to the library.

With this, we can download papers from our library and add them to `paperqa`:

```py
from paperqa.contrib import ZoteroDB

docs = paperqa.Docs()
zotero = ZoteroDB(library_type="user")  # "group" if group library

for item in zotero.iterate(limit=20):
    if item.num_pages > 30:
        continue  # skip long papers
    docs.add(item.pdf, docname=item.key)
```

which will download the first 20 papers in your Zotero database and add
them to the `Docs` object.

We can also do specific queries of our Zotero library and iterate over the results:

```py
for item in zotero.iterate(
        q="large language models",
        qmode="everything",
        sort="date",
        direction="desc",
        limit=100,
):
    print("Adding", item.title)
    docs.add(item.pdf, docname=item.key)
```

You can read more about the search syntax by typing `zotero.iterate?` in IPython.

### Paper Scraper

If you want to search for papers outside of your own collection, I've found an unrelated project called [paper-scraper](https://github.com/blackadad/paper-scraper) that looks
like it might help. But beware, this project looks like it uses some scraping tools that may violate publisher's rights or be in a gray area of legality.

```py
keyword_search = 'bispecific antibody manufacture'
papers = paperscraper.search_papers(keyword_search)
docs = paperqa.Docs()
for path,data in papers.items():
    try:
        docs.add(path)
    except ValueError as e:
        # sometimes this happens if PDFs aren't downloaded or readable
        print('Could not read', path, e)
answer = docs.query("What manufacturing challenges are unique to bispecific antibodies?")
print(answer)
```

## PDF Reading Options

By default [PyPDF](https://pypi.org/project/pypdf/) is used since it's pure python and easy to install. For faster PDF reading, paper-qa will detect and use [PymuPDF (fitz)](https://pymupdf.readthedocs.io/en/latest/):

```sh
pip install pymupdf
```

## Callbacks Factory

To execute a function on each chunk of LLM completions, you need to provide a function that when called with the name of the step produces a list of functions to execute on each chunk. For example, to get a typewriter view of the completions, you can do:

```python
def make_typewriter(step_name):
    def typewriter(chunk):
        print(chunk, end="")
    return [typewriter] # <- note that this is a list of functions
...
docs.query("What manufacturing challenges are unique to bispecific antibodies?", get_callbacks=make_typewriter)
```

### Caching Embeddings

In general, embeddings are cached when you pickle a `Docs` regardless of what vector store you use. See above for details on more explicit management of them.

## Customizing Prompts

You can customize any of the prompts, using the `PromptCollection` class. For example, if you want to change the prompt for the question, you can do:

```python
from paperqa import Docs, Answer, PromptCollection

my_qaprompt = "Answer the question '{question}' "
    "Use the context below if helpful. "
    "You can cite the context using the key "
    "like (Example2012). "
    "If there is insufficient context, write a poem "
    "about how you cannot answer.\n\n"
    "Context: {context}\n\n"
prompts=PromptCollection(qa=my_qaprompt)
docs = Docs(prompts=prompts)
```

### Pre and Post Prompts

Following the syntax above, you can also include prompts that
are executed after the query and before the query. For example, you can use this to critique the answer.

## FAQ

### How is this different from LlamaIndex?

It's not that different! This is similar to the tree response method in LlamaIndex. I just have included some prompts I find useful, readers that give page numbers/line numbers, and am focused on one task - answering technical questions with cited sources.

### How is this different from LangChain?

There has been some great work on retrievers in langchain and you could say this is an example of a retriever.

### Can I save or load?

The `Docs` class can be pickled and unpickled. This is useful if you want to save the embeddings of the documents and then load them later.

```python
import pickle

# save
with open("my_docs.pkl", "wb") as f:
    pickle.dump(docs, f)

# load
with open("my_docs.pkl", "rb") as f:
    docs = pickle.load(f)

docs.set_client() #defaults to OpenAI
```

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "paper-qa",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "James Braza <jamesbraza@gmail.com>, Andrew White <white.d.andrew@gmail.com>",
    "keywords": "question answering",
    "author": null,
    "author_email": "Andrew White <white.d.andrew@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/9e/0e/2955b3831630526b4ac7849e4ecfa437b1a035927042d60b8491ad200866/paper_qa-4.6.0.tar.gz",
    "platform": null,
    "description": "# PaperQA\n\n[![GitHub](https://img.shields.io/badge/github-%23121011.svg?style=for-the-badge&logo=github&logoColor=white)](https://github.com/whitead/paper-qa)\n[![tests](https://github.com/whitead/paper-qa/actions/workflows/tests.yml/badge.svg)](https://github.com/whitead/paper-qa)\n[![PyPI version](https://badge.fury.io/py/paper-qa.svg)](https://badge.fury.io/py/paper-qa)\n\nThis is a minimal package for doing question and answering from\nPDFs or text files (which can be raw HTML). It strives to give very good answers, with no hallucinations, by grounding responses with in-text citations.\n\nBy default, it uses [OpenAI Embeddings](https://platform.openai.com/docs/guides/embeddings) with a simple numpy vector DB to embed and search documents. However, via [langchain](https://github.com/hwchase17/langchain) you can use open-source models or embeddings (see details below).\n\npaper-qa uses the process shown below:\n\n1. embed docs into vectors\n2. embed query into vector\n3. search for top k passages in docs\n4. create summary of each passage relevant to query\n5. score and select only relevant summaries\n6. put summaries into prompt\n7. generate answer with prompt\n\nSee our paper for more details:\n\n```bibtex\n@article{lala2023paperqa,\n  title={PaperQA: Retrieval-Augmented Generative Agent for Scientific Research},\n  author={L{\\'a}la, Jakub and O'Donoghue, Odhran and Shtedritski, Aleksandar and Cox, Sam and Rodriques, Samuel G and White, Andrew D},\n  journal={arXiv preprint arXiv:2312.07559},\n  year={2023}\n}\n```\n\n## Output Example\n\nQuestion: How can carbon nanotubes be manufactured at a large scale?\n\nCarbon nanotubes can be manufactured at a large scale using the electric-arc technique (Journet6644). This technique involves creating an arc between two electrodes in a reactor under a helium atmosphere and using a mixture of a metallic catalyst and graphite powder in the anode. Yields of 80% of entangled carbon filaments can be achieved, which consist of smaller aligned SWNTs self-organized into bundle-like crystallites (Journet6644). Additionally, carbon nanotubes can be synthesized and self-assembled using various methods such as DNA-mediated self-assembly, nanoparticle-assisted alignment, chemical self-assembly, and electro-addressed functionalization (Tulevski2007). These methods have been used to fabricate large-area nanostructured arrays, high-density integration, and freestanding networks (Tulevski2007). 98% semiconducting CNT network solution can also be used and is separated from metallic nanotubes using a density gradient ultracentrifugation approach (Chen2014). The substrate is incubated in the solution and then rinsed with deionized water and dried with N2 air gun, leaving a uniform carbon network (Chen2014).\n\n### References\n\nJournet6644: Journet, Catherine, et al. \"Large-scale production of single-walled carbon nanotubes by the electric-arc technique.\" nature 388.6644 (1997): 756-758.\n\nTulevski2007: Tulevski, George S., et al. \"Chemically assisted directed assembly of carbon nanotubes for the fabrication of large-scale device arrays.\" Journal of the American Chemical Society 129.39 (2007): 11964-11968.\n\nChen2014: Chen, Haitian, et al. \"Large-scale complementary macroelectronics using hybrid integration of carbon nanotubes and IGZO thin-film transistors.\" Nature communications 5.1 (2014): 4097.\n\n## What's New?\n\nVersion 4 removed langchain from the package because it no longer supports pickling. This also simplifies the package a bit - especially prompts. Langchain can still be used, but it's not required. You can use any LLMs from langchain, but you will need to use the `LangchainLLMModel` class to wrap the model.\n\n## Install\n\nInstall with pip:\n\n```bash\npip install paper-qa\n```\n\nYou need to have an LLM to use paper-qa. You can use OpenAI, llama.cpp (via Server), or any LLMs from langchain. OpenAI just works, as long as you have set your OpenAI API key (`export OPENAI_API_KEY=sk-...`). See instructions below for other LLMs.\n\n## Usage\n\nTo use paper-qa, you need to have a list of paths/files/urls (valid extensions include: .pdf, .txt). You can then use the `Docs` class to add the documents and then query them. `Docs` will try to guess citation formats from the content of the files, but you can also provide them yourself.\n\n```python\n\nfrom paperqa import Docs\n\nmy_docs = ...# get a list of paths\n\ndocs = Docs()\nfor d in my_docs:\n    docs.add(d)\n\nanswer = docs.query(\"What manufacturing challenges are unique to bispecific antibodies?\")\nprint(answer.formatted_answer)\n```\n\nThe answer object has the following attributes: `formatted_answer`, `answer` (answer alone), `question` , and `context` (the summaries of passages found for answer).\n\n### Async\n\npaper-qa is written to be used asynchronously. The synchronous API is just a wrapper around the async. Here are the methods and their async equivalents:\n\n| Sync                | Async                |\n| ------------------- | -------------------- |\n| `Docs.add`          | `Docs.aadd`          |\n| `Docs.add_file`     | `Docs.aadd_file`     |\n| `Docs.add_url`      | `Docs.add_url`       |\n| `Docs.get_evidence` | `Docs.aget_evidence` |\n| `Docs.query`        | `Docs.aquery`        |\n\nThe synchronous version just call the async version in a loop. Most modern python environments support async natively (including Jupyter notebooks!). So you can do this in a Jupyter Notebook:\n\n```py\nfrom paperqa import Docs\n\nmy_docs = ...# get a list of paths\n\ndocs = Docs()\nfor d in my_docs:\n    await docs.aadd(d)\n\nanswer = await docs.aquery(\"What manufacturing challenges are unique to bispecific antibodies?\")\n```\n\n### Adding Documents\n\n`add` will add from paths. You can also use `add_file` (expects a file object) or `add_url` to work with other sources.\n\n### Choosing Model\n\nBy default, it uses a hybrid of `gpt-3.5-turbo` and `gpt-4-turbo`. You can adjust this:\n\n```py\ndocs = Docs(llm='gpt-3.5-turbo')\n```\n\nor you can use any other model available in [langchain](https://github.com/hwchase17/langchain):\n\n```py\nfrom paperqa import Docs\nfrom langchain_community.chat_models import ChatAnthropic\ndocs = Docs(llm=\"langchain\",\n            client=ChatAnthropic())\n```\n\nNote we split the model into the wrapper and `client`, which is `ChatAnthropic` here. This is because `client` stores the non-pickleable part and langchain LLMs are only sometimes serializable/pickleable. The paper-qa `Docs` must always serializable. Thus, we split the model into two parts.\n\n```py\nimport pickle\ndocs = Docs(llm=\"langchain\",\n            client=ChatAnthropic())\nmodel_str = pickle.dumps(docs)\ndocs = pickle.loads(model_str)\n# but you have to set the client after loading\ndocs.set_client(ChatAnthropic())\n```\n\n#### Locally Hosted\n\nYou can use llama.cpp to be the LLM. Note that you should be using relatively large models, because paper-qa requires following a lot of instructions. You won't get good performance with 7B models.\n\nThe easiest way to get set-up is to download a [llama file](https://github.com/Mozilla-Ocho/llamafile) and execute it with `-cb -np 4 -a my-llm-model --embedding` which will enable continuous batching and embeddings.\n\n```py\nfrom paperqa import Docs, LlamaEmbeddingModel\nfrom openai import AsyncOpenAI\n\n# start llamap.cpp client with\n\nlocal_client = AsyncOpenAI(\n    base_url=\"http://localhost:8080/v1\",\n    api_key = \"sk-no-key-required\"\n)\n\ndocs = Docs(client=local_client,\n            embedding_model=LlamaEmbeddingModel(),\n            llm_model=OpenAILLMModel(config=dict(model=\"my-llm-model\", temperature=0.1, frequency_penalty=1.5, max_tokens=512)))\n```\n\n### Changing Embedding Model\n\nYou can use langchain embedding models, or the [SentenceTransformer](https://www.sbert.net/) models. For example\n\n```py\nfrom paperqa import Docs, SentenceTransformerEmbeddingModel\nfrom openai import AsyncOpenAI\n\n# start llamap.cpp client with\n\nlocal_client = AsyncOpenAI(\n    base_url=\"http://localhost:8080/v1\",\n    api_key = \"sk-no-key-required\"\n)\n\ndocs = Docs(client=local_client,\n            embedding_model=SentenceTransformerEmbeddingModel(),\n            llm_model=OpenAILLMModel(config=dict(model=\"my-llm-model\", temperature=0.1, frequency_penalty=1.5, max_tokens=512)))\n```\n\nJust like in the above examples, we have to split the Langchain model into a client and model to keep `Docs` serializable.\n\n```py\n\nfrom paperqa import Docs, LangchainEmbeddingModel\n\ndocs = Docs(embedding_model=LangchainEmbeddingModel(), embedding_client=OpenAIEmbeddings())\n```\n\n### Adjusting number of sources\n\nYou can adjust the numbers of sources (passages of text) to reduce token usage or add more context. `k` refers to the top k most relevant and diverse (may from different sources) passages. Each passage is sent to the LLM to summarize, or determine if it is irrelevant. After this step, a limit of `max_sources` is applied so that the final answer can fit into the LLM context window. Thus, `k` > `max_sources` and `max_sources` is the number of sources used in the final answer.\n\n```py\ndocs.query(\"What manufacturing challenges are unique to bispecific antibodies?\", k = 5, max_sources = 2)\n```\n\n### Using Code or HTML\n\nYou do not need to use papers -- you can use code or raw HTML. Note that this tool is focused on answering questions, so it won't do well at writing code. One note is that the tool cannot infer citations from code, so you will need to provide them yourself.\n\n```python\n\nimport glob\n\nsource_files = glob.glob('**/*.js')\n\ndocs = Docs()\nfor f in source_files:\n    # this assumes the file names are unique in code\n    docs.add(f, citation='File ' + os.path.name(f), docname=os.path.name(f))\nanswer = docs.query(\"Where is the search bar in the header defined?\")\nprint(answer)\n```\n\n### Using External DB/Vector DB and Caching\n\nYou may want to cache parsed texts and embeddings in an external database or file. You can then build a Docs object from those directly:\n\n```py\n\ndocs = Docs()\n\nfor ... in my_docs:\n    doc = Doc(docname=...,  citation=..., dockey=..., citation=...)\n    texts = [Text(text=..., name=..., doc=doc) for ... in my_texts]\n    docs.add_texts(texts, doc)\n```\n\nIf you want to use an external vector store, you can also do that directly via langchain. For example, to use the [FAISS](https://ai.meta.com/tools/faiss/) vector store from langchain:\n\n```py\nfrom paperqa import LangchainVectorStore, Docs\nfrom langchain_community.vector_store import FAISS\nfrom langchain_openai import OpenAIEmbeddings\n\nmy_index = LangchainVectorStore(cls=FAISS, embedding_model=OpenAIEmbeddings())\ndocs = Docs(texts_index=my_index)\n\n```\n\n## Where do I get papers?\n\nWell that's a really good question! It's probably best to just download PDFs of papers you think will help answer your question and start from there.\n\n### Zotero\n\nIf you use [Zotero](https://www.zotero.org/) to organize your personal bibliography,\nyou can use the `paperqa.contrib.ZoteroDB` to query papers from your library,\nwhich relies on [pyzotero](https://github.com/urschrei/pyzotero).\n\nInstall `pyzotero` to use this feature:\n\n```bash\npip install pyzotero\n```\n\nFirst, note that `paperqa` parses the PDFs of papers to store in the database,\nso all relevant papers should have PDFs stored inside your database.\nYou can get Zotero to automatically do this by highlighting the references\nyou wish to retrieve, right clicking, and selecting _\"Find Available PDFs\"_.\nYou can also manually drag-and-drop PDFs onto each reference.\n\nTo download papers, you need to get an API key for your account.\n\n1. Get your library ID, and set it as the environment variable `ZOTERO_USER_ID`.\n   - For personal libraries, this ID is given [here](https://www.zotero.org/settings/keys) at the part \"_Your userID for use in API calls is XXXXXX_\".\n   - For group libraries, go to your group page `https://www.zotero.org/groups/groupname`, and hover over the settings link. The ID is the integer after /groups/. (_h/t pyzotero!_)\n2. Create a new API key [here](https://www.zotero.org/settings/keys/new) and set it as the environment variable `ZOTERO_API_KEY`.\n   - The key will need read access to the library.\n\nWith this, we can download papers from our library and add them to `paperqa`:\n\n```py\nfrom paperqa.contrib import ZoteroDB\n\ndocs = paperqa.Docs()\nzotero = ZoteroDB(library_type=\"user\")  # \"group\" if group library\n\nfor item in zotero.iterate(limit=20):\n    if item.num_pages > 30:\n        continue  # skip long papers\n    docs.add(item.pdf, docname=item.key)\n```\n\nwhich will download the first 20 papers in your Zotero database and add\nthem to the `Docs` object.\n\nWe can also do specific queries of our Zotero library and iterate over the results:\n\n```py\nfor item in zotero.iterate(\n        q=\"large language models\",\n        qmode=\"everything\",\n        sort=\"date\",\n        direction=\"desc\",\n        limit=100,\n):\n    print(\"Adding\", item.title)\n    docs.add(item.pdf, docname=item.key)\n```\n\nYou can read more about the search syntax by typing `zotero.iterate?` in IPython.\n\n### Paper Scraper\n\nIf you want to search for papers outside of your own collection, I've found an unrelated project called [paper-scraper](https://github.com/blackadad/paper-scraper) that looks\nlike it might help. But beware, this project looks like it uses some scraping tools that may violate publisher's rights or be in a gray area of legality.\n\n```py\nkeyword_search = 'bispecific antibody manufacture'\npapers = paperscraper.search_papers(keyword_search)\ndocs = paperqa.Docs()\nfor path,data in papers.items():\n    try:\n        docs.add(path)\n    except ValueError as e:\n        # sometimes this happens if PDFs aren't downloaded or readable\n        print('Could not read', path, e)\nanswer = docs.query(\"What manufacturing challenges are unique to bispecific antibodies?\")\nprint(answer)\n```\n\n## PDF Reading Options\n\nBy default [PyPDF](https://pypi.org/project/pypdf/) is used since it's pure python and easy to install. For faster PDF reading, paper-qa will detect and use [PymuPDF (fitz)](https://pymupdf.readthedocs.io/en/latest/):\n\n```sh\npip install pymupdf\n```\n\n## Callbacks Factory\n\nTo execute a function on each chunk of LLM completions, you need to provide a function that when called with the name of the step produces a list of functions to execute on each chunk. For example, to get a typewriter view of the completions, you can do:\n\n```python\ndef make_typewriter(step_name):\n    def typewriter(chunk):\n        print(chunk, end=\"\")\n    return [typewriter] # <- note that this is a list of functions\n...\ndocs.query(\"What manufacturing challenges are unique to bispecific antibodies?\", get_callbacks=make_typewriter)\n```\n\n### Caching Embeddings\n\nIn general, embeddings are cached when you pickle a `Docs` regardless of what vector store you use. See above for details on more explicit management of them.\n\n## Customizing Prompts\n\nYou can customize any of the prompts, using the `PromptCollection` class. For example, if you want to change the prompt for the question, you can do:\n\n```python\nfrom paperqa import Docs, Answer, PromptCollection\n\nmy_qaprompt = \"Answer the question '{question}' \"\n    \"Use the context below if helpful. \"\n    \"You can cite the context using the key \"\n    \"like (Example2012). \"\n    \"If there is insufficient context, write a poem \"\n    \"about how you cannot answer.\\n\\n\"\n    \"Context: {context}\\n\\n\"\nprompts=PromptCollection(qa=my_qaprompt)\ndocs = Docs(prompts=prompts)\n```\n\n### Pre and Post Prompts\n\nFollowing the syntax above, you can also include prompts that\nare executed after the query and before the query. For example, you can use this to critique the answer.\n\n## FAQ\n\n### How is this different from LlamaIndex?\n\nIt's not that different! This is similar to the tree response method in LlamaIndex. I just have included some prompts I find useful, readers that give page numbers/line numbers, and am focused on one task - answering technical questions with cited sources.\n\n### How is this different from LangChain?\n\nThere has been some great work on retrievers in langchain and you could say this is an example of a retriever.\n\n### Can I save or load?\n\nThe `Docs` class can be pickled and unpickled. This is useful if you want to save the embeddings of the documents and then load them later.\n\n```python\nimport pickle\n\n# save\nwith open(\"my_docs.pkl\", \"wb\") as f:\n    pickle.dump(docs, f)\n\n# load\nwith open(\"my_docs.pkl\", \"rb\") as f:\n    docs = pickle.load(f)\n\ndocs.set_client() #defaults to OpenAI\n```\n",
    "bugtrack_url": null,
    "license": "Apache License Version 2.0, January 2004 http://www.apache.org/licenses/  TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION  1. Definitions.  \"License\" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.  \"Licensor\" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.  \"Legal Entity\" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, \"control\" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.  \"You\" (or \"Your\") shall mean an individual or Legal Entity exercising permissions granted by this License.  \"Source\" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.  \"Object\" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.  \"Work\" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).  \"Derivative Works\" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.  \"Contribution\" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, \"submitted\" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as \"Not a Contribution.\"  \"Contributor\" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.  2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.  3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.  4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:  (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and  (b) You must cause any modified files to carry prominent notices stating that You changed the files; and  (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and  (d) If the Work includes a \"NOTICE\" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.  You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.  5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.  6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.  7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.  8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.  9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.  END OF TERMS AND CONDITIONS  APPENDIX: How to apply the Apache License to your work.  To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets \"[]\" replaced with your own identifying information. (Don't include the brackets!)  The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same \"printed page\" as the copyright notice for easier identification within third-party archives.  Copyright [yyyy] [name of copyright owner]  Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at  http://www.apache.org/licenses/LICENSE-2.0  Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ",
    "summary": "LLM Chain for answering questions from docs",
    "version": "4.6.0",
    "project_urls": {
        "repository": "https://github.com/whitead/paper-qa"
    },
    "split_keywords": [
        "question",
        "answering"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ca707e758333f179a00fd72e127fdbaf123aaa84bb181951a7e99050125359fa",
                "md5": "2a56ee47276632c51924514b6bef3508",
                "sha256": "7e7e18d5c5c95e9ad6cb2854616e3b84d8cdf40b39712475a763e51a72830c3f"
            },
            "downloads": -1,
            "filename": "paper_qa-4.6.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "2a56ee47276632c51924514b6bef3508",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 45243,
            "upload_time": "2024-04-27T01:40:34",
            "upload_time_iso_8601": "2024-04-27T01:40:34.239736Z",
            "url": "https://files.pythonhosted.org/packages/ca/70/7e758333f179a00fd72e127fdbaf123aaa84bb181951a7e99050125359fa/paper_qa-4.6.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "9e0e2955b3831630526b4ac7849e4ecfa437b1a035927042d60b8491ad200866",
                "md5": "207130bbef12aad4a195a70597cbe09c",
                "sha256": "12ad4b666be1593f078bf7b5b88c1ae311ce84a6dc88358cc0829a726f90d64d"
            },
            "downloads": -1,
            "filename": "paper_qa-4.6.0.tar.gz",
            "has_sig": false,
            "md5_digest": "207130bbef12aad4a195a70597cbe09c",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 64148,
            "upload_time": "2024-04-27T01:40:36",
            "upload_time_iso_8601": "2024-04-27T01:40:36.717391Z",
            "url": "https://files.pythonhosted.org/packages/9e/0e/2955b3831630526b4ac7849e4ecfa437b1a035927042d60b8491ad200866/paper_qa-4.6.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-27 01:40:36",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "whitead",
    "github_project": "paper-qa",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "paper-qa"
}
        
Elapsed time: 0.58055s