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

Uploaded Source

Built Distribution

pqapi-6.7.1-py3-none-any.whl (9.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pqapi-6.7.1.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.7.1.tar.gz
Algorithm Hash digest
SHA256 f6de50595c77e97fec8f7a7d8ea9da60e2bf424b9742e1a86ef97788069f1428
MD5 fc9f5766a3ce7a7d58357e41e5a00d17
BLAKE2b-256 c7e003eae0c0ee92f02de79e0482a2c746e3953f3030a861ea09b438a2f84556

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pqapi-6.7.1-py3-none-any.whl
  • Upload date:
  • Size: 9.1 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.7.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e7654bcd645cdb42edb295e00573f1795d2b5e699245d1a6d46cdc72546589a1
MD5 d3f91a658440a210585f3f48cd05dd42
BLAKE2b-256 502fe7fe26c2ebab096c25f209946f2863c3e0b4a3ddeb1a143a29301dfb67d7

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