Module chunk_api

Source

Enums§

AutocompleteError
struct for typed errors of method autocomplete
CountChunksError
struct for typed errors of method count_chunks
CreateChunkError
struct for typed errors of method create_chunk
DeleteChunkByTrackingIdError
struct for typed errors of method delete_chunk_by_tracking_id
DeleteChunkError
struct for typed errors of method delete_chunk
GenerateOffChunksError
struct for typed errors of method generate_off_chunks
GetChunkByIdError
struct for typed errors of method get_chunk_by_id
GetChunkByTrackingIdError
struct for typed errors of method get_chunk_by_tracking_id
GetChunksByIdsError
struct for typed errors of method get_chunks_by_ids
GetChunksByTrackingIdsError
struct for typed errors of method get_chunks_by_tracking_ids
GetRecommendedChunksError
struct for typed errors of method get_recommended_chunks
GetSuggestedQueriesError
struct for typed errors of method get_suggested_queries
ScrollDatasetChunksError
struct for typed errors of method scroll_dataset_chunks
SearchChunksError
struct for typed errors of method search_chunks
UpdateChunkByTrackingIdError
struct for typed errors of method update_chunk_by_tracking_id
UpdateChunkError
struct for typed errors of method update_chunk

Functions§

autocomplete
This route provides the primary autocomplete functionality for the API. This prioritize prefix matching with semantic or full-text search.
count_chunks
This route can be used to determine the number of chunk results that match a search query including score threshold and filters. It may be high latency for large limits. There is a dataset configuration imposed restriction on the maximum limit value (default 10,000) which is used to prevent DDOS attacks. Auth’ed user or api key must have an admin or owner role for the specified dataset’s organization.
create_chunk
Create new chunk(s). If the chunk has the same tracking_id as an existing chunk, the request will fail. Once a chunk is created, it can be searched for using the search endpoint. If uploading in bulk, the maximum amount of chunks that can be uploaded at once is 120 chunks. Auth’ed user or api key must have an admin or owner role for the specified dataset’s organization.
delete_chunk
Delete a chunk by its id. If deleting a root chunk which has a collision, the most recently created collision will become a new root chunk. Auth’ed user or api key must have an admin or owner role for the specified dataset’s organization.
delete_chunk_by_tracking_id
Delete a chunk by tracking_id. This is useful for when you are coordinating with an external system and want to use the tracking_id to identify the chunk. If deleting a root chunk which has a collision, the most recently created collision will become a new root chunk. Auth’ed user or api key must have an admin or owner role for the specified dataset’s organization.
generate_off_chunks
This endpoint exists as an alternative to the topic+message resource pattern where our Trieve handles chat memory. With this endpoint, the user is responsible for providing the context window and the prompt and the conversation is ephemeral.
get_chunk_by_id
Get a singular chunk by id.
get_chunk_by_tracking_id
Get a singular chunk by tracking_id. This is useful for when you are coordinating with an external system and want to use your own id as the primary reference for a chunk.
get_chunks_by_ids
Get multiple chunks by multiple ids.
get_chunks_by_tracking_ids
Get multiple chunks by ids.
get_recommended_chunks
Get recommendations of chunks similar to the positive samples in the request and dissimilar to the negative.
get_suggested_queries
This endpoint will generate 3 suggested queries based off a hybrid search using RAG with the query provided in the request body and return them as a JSON object.
scroll_dataset_chunks
Get paginated chunks from your dataset with filters and custom sorting. If sort by is not specified, the results will sort by the id’s of the chunks in ascending order. Sort by and offset_chunk_id cannot be used together; if you want to scroll with a sort by then you need to use a must_not filter with the ids you have already seen. There is a limit of 1000 id’s in a must_not filter at a time.
search_chunks
This route provides the primary search functionality for the API. It can be used to search for chunks by semantic similarity, full-text similarity, or a combination of both. Results’ chunk_html values will be modified with <b><mark> tags for sub-sentence highlighting.
update_chunk
Update a chunk. If you try to change the tracking_id of the chunk to have the same tracking_id as an existing chunk, the request will fail. Auth’ed user or api key must have an admin or owner role for the specified dataset’s organization.
update_chunk_by_tracking_id
Update a chunk by tracking_id. This is useful for when you are coordinating with an external system and want to use the tracking_id to identify the chunk. Auth’ed user or api key must have an admin or owner role for the specified dataset’s organization.