Metadata-Version: 2.1
Name: pqapi
Version: 7.0.1
Summary: API for interacting with paperqa.app
Author-email: Andrew White <andrew@futurehouse.org>
Maintainer-email: Andrew White <andrew@futurehouse.org>, James Braza <james@futurehouse.org>, Michael Skarlinski <mskarlinski@futurehouse.org>
License: MIT License
        
        Copyright (c) 2023 Future House
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: issues, https://github.com/Future-House/paperqa-api/issues
Project-URL: repository, https://github.com/Future-House/paperqa-api
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python
Requires-Python: >=3.11.0rc1
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: aiohttp
Requires-Dist: paper-qa>=5
Requires-Dist: pydantic~=2.0
Requires-Dist: requests
Requires-Dist: tenacity

# paperqa-api

Python client for interacting with paperqa app

# Usage

Make sure to set the environment variable `PQA_API_KEY` to your API token.

```sh
export PQA_API_TOKEN=pqa-...
```

To query agent:

```py
import pqapi
response = pqapi.agent_query(
    "Are COVID-19 vaccines effective?"
)
```

you can do it with async too:

```py
import pqapi
response = await async_agent_query(query, "default")
```

The response object contains information about the sources, cost, and other details. To get just the answer:

```py
print(response.answer)
```

# Development

If developing, you can change the server URL endpoint to a local PQA server with

```sh
export PQA_URL="http://localhost:8080"
```
