curl --location 'https://document-query.pyqai.com/ask-formatted' \ --header 'Authorization: ExampleAPIToken' \ --header 'Content-Type: application/json' \ --data '{"account_id" : ExampleAccountID, "index_name" : "ExampleIndexName", "input_sequence" : "Example query", "description" : "Description of field to populate", "response_type" : "list[str]", "name" : "list of query results"}'
{ "formatted_response": { "sample_str_list_field_name": ["sample str output 1", "sample str output 2"] }, "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, and gives the output in a user-specified format.