Skip to main content

API for interacting with paperqa.app

Project description

peperqa-api

Python UI for interacting with paperqa app

Usage

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

export PAPERQA_API_TOKEN=pqa-...

To upload files:

import pqapi
files = [open("paper.pdf", "rb"), open("paper2.pdf", "rb")]
metadatas = [
    pqapi.UploadMetadata(filename="paper.pdf", citation="Test Citation"),
    pqapi.UploadMetadata(filename="paper2.pdf", citation="Test Citation 2"),
]
response = pqapi.upload_files(
    "default",
    files
    metadatas
)

To query agent:

import pqapi
response = pqapi.query_agent(
    "default",
    "Are COVID-19 vaccines effective?"
)

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-0.0.1.tar.gz (4.1 kB view hashes)

Uploaded Source

Built Distribution

pqapi-0.0.1-py3-none-any.whl (4.5 kB view hashes)

Uploaded Python 3

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