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-6.8.0.tar.gz (1.5 MB view details)

Uploaded Source

Built Distribution

pqapi-6.8.0-py3-none-any.whl (10.2 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for pqapi-6.8.0.tar.gz
Algorithm Hash digest
SHA256 10d08715fdc25b4b5bdf60e0cf0c54dbfc82c4e71487fddf40fa7bc94cd96d5d
MD5 3cd493f4f6304c29159a37b86ddfcc94
BLAKE2b-256 b7ac95cb530e05a3529c4d98249f613b804a9f39db6e2244db18492074e00ef8

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for pqapi-6.8.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d87cab55138e0193aadc3a9da71e3e009e5fcf026057e6c348a6e806c5670320
MD5 b7f872d272340bb9a3bcd8873c5dbc12
BLAKE2b-256 6d5e6716f52463760f6c6cdc2139674cac0b11acaf8d08818276b639088df184

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