curl --location 'https://document-query.pyqai.com/ask' \ --header 'Authorization: ExmpleAPIToken' \ --header 'Content-Type: application/json' \ --data '{"account_id" : ExampleAccountId, "input_sequence" : "Example query", "index_name" : "ExampleIndex"}'
{ "response": { "question": "Your input sequence query!", "answer": "Pyq's AI has answered your query.\n", "sources": "source_1, source_2, source_3", "source_documents": [ { "page_content": "Some information from your documents.", "metadata": { "source": "source_1" } }, { "page_content": "Some information from your documents.", "metadata": { "source": "source_2" } }, { "page_content": "Some information from your documents.", "metadata": { "source": "source_3" } } ] } }
This endpoint answers a query using documents in an index.