Filter most relevant chunks
curl --request POST \
--url https://api.lighton.ai/api/v2/filter/chunks \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"query": "<string>",
"chunk_ids": [
"<string>"
],
"model": "<string>"
}
'import requests
url = "https://api.lighton.ai/api/v2/filter/chunks"
payload = {
"query": "<string>",
"chunk_ids": ["<string>"],
"model": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({query: '<string>', chunk_ids: ['<string>'], model: '<string>'})
};
fetch('https://api.lighton.ai/api/v2/filter/chunks', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"query": "<string>",
"chunks": [
{
"uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"text": "<string>",
"metadata": {},
"filter_score": 123
}
]
}Files Search
Filter most relevant chunks
deprecated
Deprecated — this endpoint will be removed in a future release. Use POST /api/v3/search instead, which handles retrieval and reranking in a single call.
This endpoint can be used to filter document chunks based on a given query.
The query should be a single string.
Chunk ids should be a list of strings. Each string should be the UUID of an existing document chunk.
The model field should be the name of the model to use for filtering.
An optional integer n can be provided, which can be used to return the first n chunks that pass the filter.
POST
/
api
/
v2
/
filter
/
chunks
Filter most relevant chunks
curl --request POST \
--url https://api.lighton.ai/api/v2/filter/chunks \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"query": "<string>",
"chunk_ids": [
"<string>"
],
"model": "<string>"
}
'import requests
url = "https://api.lighton.ai/api/v2/filter/chunks"
payload = {
"query": "<string>",
"chunk_ids": ["<string>"],
"model": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({query: '<string>', chunk_ids: ['<string>'], model: '<string>'})
};
fetch('https://api.lighton.ai/api/v2/filter/chunks', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"query": "<string>",
"chunks": [
{
"uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"text": "<string>",
"metadata": {},
"filter_score": 123
}
]
}Authorizations
Body
application/jsonapplication/x-www-form-urlencodedmultipart/form-data
Request serializer for filtering document chunks based on a query.