Skip to main content
POST
/
api
/
v2
/
chat
/
document-search
Generate an answer with text documents
curl --request POST \
  --url https://paradigm.lighton.ai/api/v2/chat/document-search \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "query": "<string>",
  "workspace_ids": [
    123
  ],
  "file_ids": [
    123
  ],
  "chat_session_id": 123,
  "model": "<string>",
  "company_scope": true,
  "private_scope": true,
  "private": false,
  "tool": "VisionDocumentSearch",
  "generation_instructions": "",
  "extra_body": "<unknown>",
  "rewrite_query": true
}
'
{
  "chat_session_id": 123,
  "answer": "<string>",
  "user_instructions": "<string>",
  "chat_settings": {
    "company": "<string>",
    "instruction": "<string>"
  },
  "model": "<string>",
  "documents": [
    {
      "id": 123,
      "name": "<string>",
      "document_extracts": [
        {
          "id": 123,
          "metadata": {
            "ID": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
            "pages": "<string>",
            "total_pages": "<string>"
          },
          "text": "<string>"
        }
      ]
    }
  ]
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

Request serializer for document search endpoint.

query
string
required

Search query to find relevant documents

workspace_ids
integer[]

List of workspace IDs whose documents will be added to scope

file_ids
integer[]

List of document IDs that will be added to scope

chat_session_id
integer

ID of the chat session for context

model
string

Model to use for document search

company_scope
boolean

Include documents from company scope

private_scope
boolean

Include documents from private scope

private
boolean
default:false

Private search flag

tool
enum<string>

Tool type for document search

  • VisionDocumentSearch - VisionDocumentSearch
  • DocumentSearch - DocumentSearch
Available options:
VisionDocumentSearch,
DocumentSearch
generation_instructions
string
default:""

Additional instructions to concatenate with the prompt for generation

extra_body
any

Additional parameters for VLLM structured output. Only 'guided_*' parameters are allowed (guided_choice, guided_regex, guided_json, guided_grammar, guided_whitespace_pattern, guided_decoding_backend). Standard generation parameters like temperature and max_tokens should not be included as they will be overridden by the generation config.

rewrite_query
boolean
default:true

Rewrite query flag, if True the query will be rewritten to improve the search results

Response

200 - application/json

Response serializer for document search results.

chat_session_id
integer
required
answer
string
required
user_instructions
string
required
chat_settings
object
required

Response serializer for light chat settings.

model
string
required
documents
object[]
required