Skip to main content

API for interacting with paperqa.app

Project description

paperqa-api

Python client for interacting with paperqa app

Usage

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

export PQA_API_TOKEN=pqa-...

To query agent:

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

you can do it with async too:

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:

print(response.answer)

Development

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

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pqapi-7.0.1.tar.gz (1.6 MB view details)

Uploaded Source

Built Distribution

pqapi-7.0.1-py3-none-any.whl (12.0 kB view details)

Uploaded Python 3

File details

Details for the file pqapi-7.0.1.tar.gz.

File metadata

  • Download URL: pqapi-7.0.1.tar.gz
  • Upload date:
  • Size: 1.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for pqapi-7.0.1.tar.gz
Algorithm Hash digest
SHA256 b12e0839a97a2875757dafab0d8f3c89a92c690ca77eafa7a7fb6e7b35e0192a
MD5 d9d2b639ec4e78bb35b1202ede91df08
BLAKE2b-256 9abb9d77ba2295d6463d25d471a5b46ace9729f2481716a0a56f7b16a4c2e04c

See more details on using hashes here.

File details

Details for the file pqapi-7.0.1-py3-none-any.whl.

File metadata

  • Download URL: pqapi-7.0.1-py3-none-any.whl
  • Upload date:
  • Size: 12.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for pqapi-7.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 dc774d984ef74a043e0e5ce0cab1fd218b61d985b2017bb73e6b69f378ecf245
MD5 56bf0c81593a3bde72b5d25ac26976f8
BLAKE2b-256 b5544e68c702251a8bd759d81dd38183b761887c3f6c6ddf91a6038fd5ab5a20

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page