POST
/
compare-documents
curl --location 'https://document-query.pyqai.com/compare-documents' \
--header 'Authorization: ExampleAPIToken' \
--header 'Content-Type: application/json' \
--data '{"account_id" : ExampleAccountID, "index_name" : "ExampleIndexName", "document_1" : "ExampleDocument1", "document_2" : "ExampleDocument2", "input_sequence" : "Example comparative query"}'
{
    "response": {
        "answer": "Pyq's AI has answered your query.\n",
        "sources": "document_2, document_1",
        "source_documents": [
            {
                "page_content": "Some information from your documents.",
                "metadata": {
                    "source": "document_1"
                }
            },
            {
                "page_content": "Some information from your documents.",
                "metadata": {
                    "source": "document_2"
                }
            }
        ]
    }
}

Body Parameters

account_id
int
required

This is your account ID.

input_sequence
string
required

This is the query you wish to answer using documents from the given index.

document_1
string
required

This is the first document you want to consider.

document_2
string
required

This is the second document you want to consider.

index_name
string

This is the name of the index you wish to query with. This parameter is optional - if left blank will use auto indexing.

model
string

This is an optional parameter specifying if you would like to use Anthropic’s Claude instead of our default. The value “claude” will result in using that for your query.

Headers

Authorization
string
required

This is your API token associated with your account.

Response

answer
string

Pyq AI’s response to your query.

sources
list

List of sources consulted to get answer.

source_documents
list

Most relevant sections from the sources consulted to get the answer.