Skip to main content
POST
/
api
/
v2
/
files
/
{id}
/
ask-question
Generate an answer with a single document
curl --request POST \
  --url https://paradigm.lighton.ai/api/v2/files/{id}/ask-question \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "question": "example question"
}'
{
  "response": "<string>",
  "chunks": [
    {
      "id": 123,
      "uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "content_id": "<string>",
      "text": "<string>",
      "metadata": "<any>",
      "created_at": "2023-11-07T05:31:56Z",
      "updated_at": "2023-11-07T05:31:56Z",
      "chunk_type": "text",
      "document": 123
    }
  ]
}

Authorizations

Authorization
string
header
required

Bearer token authentication

Path Parameters

id
integer
required

Body

Request serializer for asking a question about a document.

question
string
required

The question to ask about the document

Maximum length: 2048

Response

Answer

Response serializer for the result of asking a question about a document.

response
string
required

The generated response to the question

chunks
object[]
required

Relevant document chunks used to generate the response

I