curl --request GET \
--url https://api.botpress.cloud/v1/files/search \
--header 'Authorization: Bearer <token>' \
--header 'x-bot-id: <x-bot-id>'{
"passages": [
{
"content": "<string>",
"score": 123,
"meta": {
"type": "chunk",
"subtype": "title",
"pageNumber": 123,
"position": 123,
"sourceUrl": "<string>"
},
"file": {
"id": "<string>",
"key": "<string>",
"contentType": "<string>",
"metadata": {},
"tags": {},
"createdAt": "<string>",
"updatedAt": "<string>"
},
"context": [
{
"text": "<string>",
"type": "preceding",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"offset": 123
}
]
}
]
}Search files
curl --request GET \
--url https://api.botpress.cloud/v1/files/search \
--header 'Authorization: Bearer <token>' \
--header 'x-bot-id: <x-bot-id>'{
"passages": [
{
"content": "<string>",
"score": 123,
"meta": {
"type": "chunk",
"subtype": "title",
"pageNumber": 123,
"position": 123,
"sourceUrl": "<string>"
},
"file": {
"id": "<string>",
"key": "<string>",
"contentType": "<string>",
"metadata": {},
"tags": {},
"createdAt": "<string>",
"updatedAt": "<string>"
},
"context": [
{
"text": "<string>",
"type": "preceding",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"offset": 123
}
]
}
]
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Bot id
Integration id
Integration alias
Integration name
User Id
User Role
Query expressed in natural language to retrieve matching text passages within all indexed files in the bot using semantical search.
The number of neighbor passages to prepend and append as surrounding context to the content of each returned passage (default: 1, minimum: 0, maximum: 10).
The maximum number of passages to return.
Consolidate the results by merging matching passages from the same file into a single passage per file. The consolidated passage will include the matching passages ordered by their original position in the file (rather than by relevance score) and include hierarchical context such as the title/subtitle to which they belong.
Prepend a breadcrumb to each passage, containing the title and subtitle(s) the passage belongs to in the file. This option is ignored when the consolidate option is set to true.
Include the surrounding context with each passage in the context property of each passage. Not supported when consolidate is set to true.
Returns the text passages within all indexed files that matched the query.
Show child attributes
The content of the matching passage in the file including surrounding context, if any.
The score indicating the similarity of the passage to the query. A higher score indicates higher similarity.
The passage metadata.
Show child attributes
The type of passage
chunk, summary, consolidated, image The subtype of passage, if available.
title, subtitle, paragraph, blockquote, list, table, code, image, page Page number the passage is located on. Only applicable if the passage was extracted from a PDF file.
Position number of the passage in the file relative to the other passages, if available. Can be used to know the order of passages within a file.
The URL of the source file for the vector, if applicable (e.g. for image vectors).
Show child attributes
File ID
Unique key for the file. Must be unique across the bot (and the integration, when applicable).
MIME type of the file's content
File creation timestamp in ISO 8601 format
File last update timestamp in ISO 8601 format
Surrounding passages including the current passage, based on the requested contextDepth. Only returned if the withContext parameter is set to true. Not supported when using the consolidate option.
Show child attributes
The type of context passage
preceding, subsequent, current, breadcrumb The ID of the vector that the context passage belongs to. Omitted for breadcrumbs.
Position of the context passage relative to the current passage. Negative for preceding passages, positive for subsequent, ommited for breadcrumbs.
Was this page helpful?