Skip to main content
POST
/
api
/
v2
/
filter
/
chunks
Filter most relevant chunks
curl --request POST \
  --url https://paradigm.lighton.ai/api/v2/filter/chunks \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "query": "<string>",
  "chunk_ids": [
    "<string>"
  ],
  "model": "<string>"
}'
{
  "query": "<string>",
  "chunks": [
    {
      "uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "text": "<string>",
      "metadata": {},
      "filter_score": 123
    }
  ]
}

Authorizations

Authorization
string
header
required

Bearer token authentication

Body

Request serializer for filtering document chunks based on a query.

query
string
required

The query string to filter document chunks against

chunk_ids
string[]
required

List of document chunk UUIDs to filter

model
string
required

Model to use for the filtering, must exist and be configured. If no model is given, will try to use the 'reranker' finetune.

n
integer | null

Maximum number of chunks to return (optional)

Response

Chunks retrieved

Response serializer for document chunk filtering results.

query
string
required

The original query used for filtering

chunks
object[]
required

List of filtered document chunks with their relevance scores

I