/
openapi.json
1 lines (1 loc) · 151 KB
/
openapi.json
1
{"openapi":"3.0.3","info":{"title":"Trieve API","description":"Trieve OpenAPI Specification. This document describes all of the operations available through the Trieve API.","contact":{"name":"Trieve Team","url":"https://trieve.ai","email":"developers@trieve.ai"},"license":{"name":"BSL","url":"https://github.com/devflowinc/trieve/blob/main/LICENSE.txt"},"version":"0.8.5"},"servers":[{"url":"https://api.trieve.ai","description":"Production server"},{"url":"http://localhost:8090","description":"Local development server"}],"paths":{"/api/auth":{"get":{"tags":["auth"],"summary":"Login","description":"Login\n\nThis will redirect you to the OAuth provider for authentication with email/pass, SSO, Google, Github, etc.","operationId":"login","parameters":[{"name":"organization_id","in":"query","description":"ID of organization to authenticate into","required":false,"schema":{"type":"string","format":"uuid","nullable":true}},{"name":"redirect_uri","in":"query","description":"URL to redirect to after successful login","required":false,"schema":{"type":"string","nullable":true}},{"name":"inv_code","in":"query","description":"Code sent via email as a result of successful call to send_invitation","required":false,"schema":{"type":"string","format":"uuid","nullable":true}}],"responses":{"303":{"description":"Response that redirects to OAuth provider through a Location header to be handled by browser."},"400":{"description":"OAuth error likely with OIDC provider.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseBody"}}}}}},"delete":{"tags":["auth"],"summary":"Logout","description":"Logout\n\nInvalidate your current auth credential stored typically stored in a cookie. This does not invalidate your API key.","operationId":"logout","responses":{"204":{"description":"Confirmation that your current auth token has been invalidated. This does not invalidate your API key."}}}},"/api/auth/callback":{"get":{"tags":["auth"],"summary":"OpenID Connect callback","description":"OpenID Connect callback\n\nThis is the callback route for the OAuth provider, it should not be called directly. Redirects to browser with set-cookie header.","operationId":"callback","responses":{"200":{"description":"Response that returns with set-cookie header","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SlimUser"}}}},"400":{"description":"Email or password empty or incorrect","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseBody"}}}}}}},"/api/auth/me":{"get":{"tags":["auth"],"summary":"Get Me","description":"Get Me\n\nGet the user corresponding to your current auth credentials.","operationId":"get_me","responses":{"200":{"description":"The user corresponding to your current auth credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SlimUser"}}}},"400":{"description":"Error message indicitating you are not currently signed in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseBody"}}}}},"security":[{"ApiKey":["readonly"]}]}},"/api/chunk":{"post":{"tags":["chunk"],"summary":"Create or Upsert Chunk or Chunks","description":"Create or Upsert Chunk or Chunks\n\nCreate a new chunk. 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.\nIf uploading in bulk, the maximum amount of chunks that can be uploaded at once is 120 chunks.","operationId":"create_chunk","parameters":[{"name":"TR-Dataset","in":"header","description":"The dataset id to use for the request","required":true,"schema":{"type":"string"}}],"requestBody":{"description":"JSON request payload to create a new chunk (chunk)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateChunkData"}}},"required":true},"responses":{"200":{"description":"JSON response payload containing the created chunk","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReturnQueuedChunk"}}}},"400":{"description":"Error typically due to deserialization issues","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseBody"}}}},"426":{"description":"Error when upgrade is needed to process more chunks","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseBody"}}}}},"security":[{"ApiKey":["admin"]}]},"put":{"tags":["chunk"],"summary":"Update Chunk","description":"Update Chunk\n\nUpdate 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.","operationId":"update_chunk","parameters":[{"name":"TR-Dataset","in":"header","description":"The dataset id to use for the request","required":true,"schema":{"type":"string"}}],"requestBody":{"description":"JSON request payload to update a chunk (chunk)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateChunkData"}}},"required":true},"responses":{"204":{"description":"No content Ok response indicating the chunk was updated as requested"},"400":{"description":"Service error relating to to updating chunk, likely due to conflicting tracking_id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseBody"}}}}},"security":[{"ApiKey":["admin"]}]}},"/api/chunk/autocomplete":{"post":{"tags":["chunk"],"summary":"Autocomplete","description":"Autocomplete\n\nThis route provides the primary autocomplete functionality for the API. This prioritize prefix matching with semantic or full-text search.","operationId":"autocomplete","parameters":[{"name":"TR-Dataset","in":"header","description":"The dataset id to use for the request","required":true,"schema":{"type":"string"}}],"requestBody":{"description":"JSON request payload to semantically search for chunks (chunks)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutocompleteData"}}},"required":true},"responses":{"200":{"description":"Chunks with embedding vectors which are similar to those in the request body","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchChunkQueryResponseBody"}}}},"400":{"description":"Service error relating to searching","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseBody"}}}}},"security":[{"ApiKey":["readonly"]}]}},"/api/chunk/gen_suggestions":{"post":{"tags":["chunk"],"summary":"Generate suggested queries","description":"Generate suggested queries\n\nThis endpoint will generate 3 suggested queries based off the query provided in the request body and return them as a JSON object.","operationId":"create_suggested_queries_handler","parameters":[{"name":"TR-Dataset","in":"header","description":"The dataset id to use for the request","required":true,"schema":{"type":"string"}}],"requestBody":{"description":"JSON request payload to get alternative suggested queries","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuggestedQueriesRequest"}}},"required":true},"responses":{"200":{"description":"A JSON object containing a list of alternative suggested queries","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuggestedQueriesResponse"}}}},"400":{"description":"Service error relating to to updating chunk, likely due to conflicting tracking_id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseBody"}}}}},"security":[{"ApiKey":["readonly"]}]}},"/api/chunk/generate":{"post":{"tags":["chunk"],"summary":"RAG on Specified Chunks","description":"RAG on Specified Chunks\n\nThis endpoint exists as an alternative to the topic+message concept where our API handles chat memory. With this endpoint, the user is responsible for providing the context window and the prompt. See more in the \"search before generate\" page at docs.trieve.ai.","operationId":"generate_off_chunks","parameters":[{"name":"TR-Dataset","in":"header","description":"The dataset id to use for the request","required":true,"schema":{"type":"string"}}],"requestBody":{"description":"JSON request payload to perform RAG on some chunks (chunks)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerateChunksRequest"}}},"required":true},"responses":{"200":{"description":"This will be a JSON response of a string containing the LLM's generated inference. Response if not streaming.","content":{"text/plain":{"schema":{"type":"string"}}}},"400":{"description":"Service error relating to to updating chunk, likely due to conflicting tracking_id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseBody"}}}}},"security":[{"ApiKey":["readonly"]}]}},"/api/chunk/recommend":{"post":{"tags":["chunk"],"summary":"Get Recommended Chunks","description":"Get Recommended Chunks\n\nGet recommendations of chunks similar to the chunks in the request. Think about this as a feature similar to the \"add to playlist\" recommendation feature on Spotify. This request pairs especially well with our groups endpoint.","operationId":"get_recommended_chunks","parameters":[{"name":"TR-Dataset","in":"header","description":"The dataset id to use for the request","required":true,"schema":{"type":"string"}}],"requestBody":{"description":"JSON request payload to get recommendations of chunks similar to the chunks in the request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecommendChunksRequest"}}},"required":true},"responses":{"200":{"description":"Chunks with embedding vectors which are similar to positives and dissimilar to negatives","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ChunkMetadataWithScore"}}}}},"400":{"description":"Service error relating to to getting similar chunks","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseBody"}}}}},"security":[{"ApiKey":["readonly"]}]}},"/api/chunk/search":{"post":{"tags":["chunk"],"summary":"Search","description":"Search\n\nThis 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.","operationId":"search_chunks","parameters":[{"name":"TR-Dataset","in":"header","description":"The dataset id to use for the request","required":true,"schema":{"type":"string"}}],"requestBody":{"description":"JSON request payload to semantically search for chunks (chunks)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchChunkData"}}},"required":true},"responses":{"200":{"description":"Chunks with embedding vectors which are similar to those in the request body","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchChunkQueryResponseBody"}}}},"400":{"description":"Service error relating to searching","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseBody"}}}}},"security":[{"ApiKey":["readonly"]}]}},"/api/chunk/tracking_id/update":{"put":{"tags":["chunk"],"summary":"Update Chunk By Tracking Id","description":"Update Chunk By Tracking Id\n\nUpdate 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.","operationId":"update_chunk_by_tracking_id","parameters":[{"name":"TR-Dataset","in":"header","description":"The dataset id to use for the request","required":true,"schema":{"type":"string"}}],"requestBody":{"description":"JSON request payload to update a chunk by tracking_id (chunks)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateChunkByTrackingIdData"}}},"required":true},"responses":{"204":{"description":"Confirmation that the chunk has been updated as per your request"},"400":{"description":"Service error relating to to updating chunk","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseBody"}}}}},"deprecated":true,"security":[{"ApiKey":["admin"]}]}},"/api/chunk/tracking_id/{tracking_id}":{"get":{"tags":["chunk"],"summary":"Get Chunk By Tracking Id","description":"Get Chunk By Tracking Id\n\nGet 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.","operationId":"get_chunk_by_tracking_id","parameters":[{"name":"TR-Dataset","in":"header","description":"The dataset id to use for the request","required":true,"schema":{"type":"string"}},{"name":"tracking_id","in":"path","description":"tracking_id of the chunk you want to fetch","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"chunk with the tracking_id that you were searching for","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChunkMetadata"}}}},"400":{"description":"Service error relating to fidning a chunk by tracking_id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseBody"}}}},"404":{"description":"Chunk not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseBody"}}}}},"security":[{"ApiKey":["readonly"]}]},"delete":{"tags":["chunk"],"summary":"Delete Chunk By Tracking Id","description":"Delete Chunk By Tracking Id\n\nDelete 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.","operationId":"delete_chunk_by_tracking_id","parameters":[{"name":"TR-Dataset","in":"header","description":"The dataset id to use for the request","required":true,"schema":{"type":"string"}},{"name":"tracking_id","in":"path","description":"tracking_id of the chunk you want to delete","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Confirmation that the chunk with the tracking_id specified was deleted"},"400":{"description":"Service error relating to finding a chunk by tracking_id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseBody"}}}}},"security":[{"ApiKey":["admin"]}]}},"/api/chunk/{chunk_id}":{"get":{"tags":["chunk"],"summary":"Get Chunk By Id","description":"Get Chunk By Id\n\nGet a singular chunk by id.","operationId":"get_chunk_by_id","parameters":[{"name":"TR-Dataset","in":"header","description":"The dataset id to use for the request","required":true,"schema":{"type":"string"}},{"name":"chunk_id","in":"path","description":"Id of the chunk you want to fetch.","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"chunk with the id that you were searching for","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChunkMetadata"}}}},"400":{"description":"Service error relating to fidning a chunk by tracking_id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseBody"}}}},"404":{"description":"Chunk not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseBody"}}}}},"security":[{"ApiKey":["readonly"]}]},"delete":{"tags":["chunk"],"summary":"Delete Chunk","description":"Delete Chunk\n\nDelete 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.","operationId":"delete_chunk","parameters":[{"name":"TR-Dataset","in":"header","description":"The dataset id to use for the request","required":true,"schema":{"type":"string"}},{"name":"chunk_id","in":"path","description":"Id of the chunk you want to fetch.","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"204":{"description":"Confirmation that the chunk with the id specified was deleted"},"400":{"description":"Service error relating to finding a chunk by tracking_id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseBody"}}}}},"security":[{"ApiKey":["admin"]}]}},"/api/chunk_group":{"post":{"tags":["chunk_group"],"summary":"Create Chunk Group","description":"Create Chunk Group\n\nCreate a new chunk_group. This is a way to group chunks together. If you try to create a chunk_group with the same tracking_id as an existing chunk_group, this operation will fail.","operationId":"create_chunk_group","parameters":[{"name":"TR-Dataset","in":"header","description":"The dataset id to use for the request","required":true,"schema":{"type":"string"}}],"requestBody":{"description":"JSON request payload to cretea a chunkGroup","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateChunkGroupData"}}},"required":true},"responses":{"200":{"description":"Returns the created chunkGroup","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChunkGroup"}}}},"400":{"description":"Service error relating to creating the chunkGroup","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseBody"}}}}},"security":[{"ApiKey":["admin"]}]},"put":{"tags":["chunk_group"],"summary":"Update Group","description":"Update Group\n\nUpdate a chunk_group. If you try to change the tracking_id to one that already exists, this operation will fail.","operationId":"update_chunk_group","parameters":[{"name":"TR-Dataset","in":"header","description":"The dataset id to use for the request","required":true,"schema":{"type":"string"}}],"requestBody":{"description":"JSON request payload to update a chunkGroup","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateChunkGroupData"}}},"required":true},"responses":{"204":{"description":"Confirmation that the chunkGroup was updated"},"400":{"description":"Service error relating to updating the chunkGroup","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseBody"}}}}},"security":[{"ApiKey":["admin"]}]}},"/api/chunk_group/chunk/{group_id}":{"post":{"tags":["chunk_group"],"summary":"Add Chunk to Group","description":"Add Chunk to Group\n\nRoute to add a chunk to a group.","operationId":"add_chunk_to_group","parameters":[{"name":"TR-Dataset","in":"header","description":"The dataset id to use for the request","required":true,"schema":{"type":"string"}},{"name":"group_id","in":"path","description":"Id of the group to add the chunk to as a bookmark","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"description":"JSON request payload to add a chunk to a group (bookmark it)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddChunkToGroupData"}}},"required":true},"responses":{"204":{"description":"Confirmation that the chunk was added to the group (bookmark'ed)."},"400":{"description":"Service error relating to getting the groups that the chunk is in.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseBody"}}}}},"security":[{"ApiKey":["admin"]}]},"delete":{"tags":["chunk_group"],"summary":"Remove Chunk from Group","description":"Remove Chunk from Group\n\nRoute to remove a chunk from a group.","operationId":"remove_chunk_from_group","parameters":[{"name":"TR-Dataset","in":"header","description":"The dataset id to use for the request","required":true,"schema":{"type":"string"}},{"name":"group_id","in":"path","description":"Id of the group to remove the bookmark'ed chunk from","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"description":"JSON request payload to cretea a chunkGroup","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateChunkGroupData"}}},"required":true},"responses":{"204":{"description":"Confirmation that the chunk was removed to the group"},"400":{"description":"Service error relating to removing the chunk from the group","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseBody"}}}}},"security":[{"ApiKey":["admin"]}]}},"/api/chunk_group/chunks":{"post":{"tags":["chunk_group"],"summary":"Get Groups for Chunks","description":"Get Groups for Chunks\n\nRoute to get the groups that a chunk is in.","operationId":"get_groups_chunk_is_in","parameters":[{"name":"TR-Dataset","in":"header","description":"The dataset id to use for the request","required":true,"schema":{"type":"string"}}],"requestBody":{"description":"JSON request payload to get the groups that a chunk is in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetGroupsForChunksData"}}},"required":true},"responses":{"200":{"description":"JSON body representing the groups that the chunk is in","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/BookmarkGroupResult"}}}}},"400":{"description":"Service error relating to getting the groups that the chunk is in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseBody"}}}}},"security":[{"ApiKey":["readonly"]}]}},"/api/chunk_group/group_oriented_search":{"post":{"tags":["chunk_group"],"summary":"Search Over Groups","description":"Search Over Groups\n\nThis route allows you to get groups as results instead of chunks. Each group returned will have the matching chunks sorted by similarity within the group. This is useful for when you want to get groups of chunks which are similar to the search query. If choosing hybrid search, the results will be re-ranked using BAAI/bge-reranker-large. Compatible with semantic, fulltext, or hybrid search modes.","operationId":"search_over_groups","parameters":[{"name":"TR-Dataset","in":"header","description":"The dataset id to use for the request","required":true,"schema":{"type":"string"}}],"requestBody":{"description":"JSON request payload to semantically search over groups","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchOverGroupsData"}}},"required":true},"responses":{"200":{"description":"Group chunks which are similar to the embedding vector of the search query","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchOverGroupsResults"}}}},"400":{"description":"Service error relating to searching over groups","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseBody"}}}}},"security":[{"ApiKey":["readonly"]}]}},"/api/chunk_group/recommend":{"post":{"tags":["chunk_group"],"summary":"Get Recommended Groups","description":"Get Recommended Groups\n\nRoute to get recommended groups. This route will return groups which are similar to the groups in the request body.","operationId":"get_recommended_groups","parameters":[{"name":"TR-Dataset","in":"header","description":"The dataset id to use for the request","required":true,"schema":{"type":"string"}}],"requestBody":{"description":"JSON request payload to get recommendations of chunks similar to the chunks in the request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecommendGroupChunksRequest"}}},"required":true},"responses":{"200":{"description":"JSON body representing the groups which are similar to the positive groups and dissimilar to the negative ones","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/GroupScoreChunk"}}}}},"400":{"description":"Service error relating to to getting similar chunks","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseBody"}}}}},"security":[{"ApiKey":["readonly"]}]}},"/api/chunk_group/search":{"post":{"tags":["chunk_group"],"summary":"Search Within Group","description":"Search Within Group\n\nThis route allows you to search only within a group. This is useful for when you only want search results to contain chunks which are members of a specific group. If choosing hybrid search, the results will be re-ranked using BAAI/bge-reranker-large.","operationId":"search_within_group","parameters":[{"name":"TR-Dataset","in":"header","description":"The dataset id to use for the request","required":true,"schema":{"type":"string"}}],"requestBody":{"description":"JSON request payload to semantically search a group","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchWithinGroupData"}}},"required":true},"responses":{"200":{"description":"Group chunks which are similar to the embedding vector of the search query","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchWithinGroupResults"}}}},"400":{"description":"Service error relating to getting the groups that the chunk is in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseBody"}}}}},"security":[{"ApiKey":["readonly"]}]}},"/api/chunk_group/tracking_id/{group_tracking_id}/{page}":{"get":{"tags":["chunk_group"],"summary":"Get Chunks in Group by Tracking ID","description":"Get Chunks in Group by Tracking ID\n\nRoute to get all chunks for a group. The response is paginated, with each page containing 10 chunks. Support for custom page size is coming soon. Page is 1-indexed.","operationId":"get_chunks_in_group_by_tracking_id","parameters":[{"name":"TR-Dataset","in":"header","description":"The dataset id to use for the request","required":true,"schema":{"type":"string"}},{"name":"group_tracking_id","in":"path","description":"The id of the group to get the chunks from","required":true,"schema":{"type":"string"}},{"name":"page","in":"path","description":"The page of chunks to get from the group","required":true,"schema":{"type":"integer","format":"int64","minimum":0}}],"responses":{"200":{"description":"Chunks present within the specified group","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BookmarkData"}}}},"400":{"description":"Service error relating to getting the groups that the chunk is in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseBody"}}}},"404":{"description":"Group not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseBody"}}}}},"security":[{"ApiKey":["readonly"]}]}},"/api/chunk_group/tracking_id/{tracking_id}":{"get":{"tags":["chunk_group"],"summary":"Get Group by Tracking ID","description":"Get Group by Tracking ID\n\nFetch the group with the given tracking id.\nget_group_by_tracking_id","operationId":"get_group_by_tracking_id","parameters":[{"name":"TR-Dataset","in":"header","description":"The dataset id to use for the request","required":true,"schema":{"type":"string"}},{"name":"tracking_id","in":"path","description":"The tracking id of the group to fetch.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"JSON body representing the group with the given tracking id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChunkGroup"}}}},"400":{"description":"Service error relating to getting the group with the given tracking id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseBody"}}}},"404":{"description":"Group not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseBody"}}}}},"security":[{"ApiKey":["readonly"]}]},"post":{"tags":["chunk_group"],"summary":"Add Chunk to Group by Tracking ID","description":"Add Chunk to Group by Tracking ID\n\nRoute to add a chunk to a group by tracking id.","operationId":"add_chunk_to_group_by_tracking_id","parameters":[{"name":"TR-Dataset","in":"header","description":"The dataset id to use for the request","required":true,"schema":{"type":"string"}},{"name":"tracking_id","in":"path","description":"Id of the group to add the chunk to as a bookmark","required":true,"schema":{"type":"string"}}],"requestBody":{"description":"JSON request payload to add a chunk to a group (bookmark it)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddChunkToGroupData"}}},"required":true},"responses":{"204":{"description":"Confirmation that the chunk was added to the group (bookmark'ed)."},"400":{"description":"Service error relating to getting the groups that the chunk is in.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseBody"}}}}},"deprecated":true,"security":[{"ApiKey":["admin"]}]},"put":{"tags":["chunk_group"],"summary":"Update Group by Tracking ID","description":"Update Group by Tracking ID\n\nUpdate a chunk_group with the given tracking id.","operationId":"update_group_by_tracking_id","parameters":[{"name":"TR-Dataset","in":"header","description":"The dataset id to use for the request","required":true,"schema":{"type":"string"}},{"name":"tracking_id","in":"path","description":"Tracking id of the chunk_group to update","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"description":"JSON request payload to update a chunkGroup","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateGroupByTrackingIDData"}}},"required":true},"responses":{"204":{"description":"Confirmation that the chunkGroup was updated"},"400":{"description":"Service error relating to updating the chunkGroup","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseBody"}}}}},"deprecated":true,"security":[{"ApiKey":["admin"]}]},"delete":{"tags":["chunk_group"],"summary":"Delete Group by Tracking ID","description":"Delete Group by Tracking ID\n\nDelete a chunk_group with the given tracking id.","operationId":"delete_group_by_tracking_id","parameters":[{"name":"TR-Dataset","in":"header","description":"The dataset id to use for the request","required":true,"schema":{"type":"string"}},{"name":"tracking_id","in":"path","description":"Tracking id of the chunk_group to delete","required":true,"schema":{"type":"string"}},{"name":"delete_chunks","in":"query","description":"Delete the chunks within the group","required":true,"schema":{"type":"boolean"}}],"responses":{"204":{"description":"Confirmation that the chunkGroup was deleted"},"400":{"description":"Service error relating to deleting the chunkGroup","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseBody"}}}}},"security":[{"ApiKey":["admin"]}]}},"/api/chunk_group/{group_id}":{"get":{"tags":["chunk_group"],"summary":"Get Group","description":"Get Group\n\nFetch the group with the given id.\nget_group","operationId":"get_chunk_group","parameters":[{"name":"TR-Dataset","in":"header","description":"The dataset id to use for the request","required":true,"schema":{"type":"string"}},{"name":"group_id","in":"path","description":"Id of the group you want to fetch.","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"JSON body representing the group with the given tracking id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChunkGroup"}}}},"400":{"description":"Service error relating to getting the group with the given tracking id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseBody"}}}},"404":{"description":"Group not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseBody"}}}}},"security":[{"ApiKey":["readonly"]}]},"delete":{"tags":["chunk_group"],"summary":"Delete Group","description":"Delete Group\n\nThis will delete a chunk_group. If you set delete_chunks to true, it will also delete the chunks within the group.","operationId":"delete_chunk_group","parameters":[{"name":"TR-Dataset","in":"header","description":"The dataset id to use for the request","required":true,"schema":{"type":"string"}},{"name":"group_id","in":"path","description":"Id of the group you want to fetch.","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"delete_chunks","in":"query","description":"Delete the chunks within the group","required":true,"schema":{"type":"boolean"}}],"responses":{"204":{"description":"Confirmation that the chunkGroup was deleted"},"400":{"description":"Service error relating to deleting the chunkGroup","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseBody"}}}}},"security":[{"ApiKey":["admin"]}]}},"/api/chunk_group/{group_id}/{page}":{"get":{"tags":["chunk_group"],"summary":"Get Chunks in Group","description":"Get Chunks in Group\n\nRoute to get all chunks for a group. The response is paginated, with each page containing 10 chunks. Page is 1-indexed.","operationId":"get_chunks_in_group","parameters":[{"name":"TR-Dataset","in":"header","description":"The dataset id to use for the request","required":true,"schema":{"type":"string"}},{"name":"group_id","in":"path","description":"Id of the group you want to fetch.","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"page","in":"path","description":"The page of chunks to get from the group","required":true,"schema":{"type":"integer","format":"int64","nullable":true,"minimum":0}}],"responses":{"200":{"description":"Chunks present within the specified group","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BookmarkData"}}}},"400":{"description":"Service error relating to getting the groups that the chunk is in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseBody"}}}},"404":{"description":"Group not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseBody"}}}}},"security":[{"ApiKey":["readonly"]}]}},"/api/chunks":{"post":{"tags":["chunk"],"summary":"Get Chunks By Ids","description":"Get Chunks By Ids\n\nGet multiple chunks by multiple ids.","operationId":"get_chunks_by_ids","parameters":[{"name":"TR-Dataset","in":"header","description":"The dataset id to use for the request","required":true,"schema":{"type":"string"}}],"requestBody":{"description":"JSON request payload to get the chunks in the request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetChunksData"}}},"required":true},"responses":{"200":{"description":"chunks with the id that you were searching for","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ChunkMetadata"}}}}},"400":{"description":"Service error relating to fidning a chunk by tracking_id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseBody"}}}},"404":{"description":"Any one of the specified chunks not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseBody"}}}}},"security":[{"ApiKey":["readonly"]}]}},"/api/chunks/tracking":{"post":{"tags":["chunk"],"summary":"Get Chunks By TrackingIds","description":"Get Chunks By TrackingIds\n\nGet multiple chunks by ids.","operationId":"get_chunks_by_tracking_ids","parameters":[{"name":"TR-Dataset","in":"header","description":"The dataset id to use for the request","required":true,"schema":{"type":"string"}}],"requestBody":{"description":"JSON request payload to get the chunks in the request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetTrackingChunksData"}}},"required":true},"responses":{"200":{"description":"chunk with the id that you were searching for","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChunkMetadata"}}}},"400":{"description":"Service error relating to fidning a chunk by tracking_id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseBody"}}}},"404":{"description":"Any one of the specified chunks not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseBody"}}}}},"security":[{"ApiKey":["readonly"]}]}},"/api/dataset":{"post":{"tags":["dataset"],"summary":"Create dataset","description":"Create dataset\n\nCreate a new dataset. The auth'ed user must be an owner of the organization to create a dataset.","operationId":"create_dataset","parameters":[{"name":"TR-Organization","in":"header","description":"The organization id to use for the request","required":true,"schema":{"type":"string"}}],"requestBody":{"description":"JSON request payload to create a new dataset","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateDatasetRequest"}}},"required":true},"responses":{"200":{"description":"Dataset created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Dataset"}}}},"400":{"description":"Service error relating to creating the dataset","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseBody"}}}}},"security":[{"ApiKey":["owner"]}]},"put":{"tags":["dataset"],"summary":"Update Dataset","description":"Update Dataset\n\nUpdate a dataset. The auth'ed user must be an owner of the organization to update a dataset.","operationId":"update_dataset","parameters":[{"name":"TR-Organization","in":"header","description":"The organization id to use for the request","required":true,"schema":{"type":"string"}}],"requestBody":{"description":"JSON request payload to update a dataset","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateDatasetRequest"}}},"required":true},"responses":{"200":{"description":"Dataset updated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Dataset"}}}},"400":{"description":"Service error relating to updating the dataset","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseBody"}}}}},"security":[{"ApiKey":["owner"]}]}},"/api/dataset/envs":{"get":{"tags":["dataset"],"summary":"Get Client Configuration","description":"Get Client Configuration\n\nGet the client configuration for a dataset. Will use the TR-D","operationId":"get_client_dataset_config","parameters":[{"name":"TR-Dataset","in":"header","description":"The dataset id to use for the request","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Dataset environment variables","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientDatasetConfiguration"}}}},"400":{"description":"Service error relating to retrieving the dataset. Typically this only happens when your auth credentials are invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseBody"}}}}},"security":[{"ApiKey":["readonly"]}]}},"/api/dataset/files/{dataset_id}/{page}":{"get":{"tags":["file"],"summary":"Get Files for Dataset","description":"Get Files for Dataset\n\nGet all files which belong to a given dataset specified by the dataset_id parameter. 10 files are returned per page.","operationId":"get_dataset_files_handler","parameters":[{"name":"TR-Dataset","in":"header","description":"The dataset id to use for the request","required":true,"schema":{"type":"string"}},{"name":"dataset_id","in":"path","description":"The id of the dataset to fetch files for.","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"page","in":"path","description":"The page number of files you wish to fetch. Each page contains at most 10 files.","required":true,"schema":{"type":"integer","format":"int64","minimum":0}}],"responses":{"200":{"description":"JSON body representing the files in the current dataset","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/File"}}}}},"400":{"description":"Service error relating to getting the files in the current datase","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseBody"}}}}},"security":[{"ApiKey":["readonly"]}]}},"/api/dataset/groups/{dataset_id}/{page}":{"get":{"tags":["chunk_group"],"summary":"Get Groups for Dataset","description":"Get Groups for Dataset\n\nFetch the groups which belong to a dataset specified by its id.","operationId":"get_specific_dataset_chunk_groups","parameters":[{"name":"TR-Dataset","in":"header","description":"The dataset id to use for the request","required":true,"schema":{"type":"string"}},{"name":"dataset_id","in":"path","description":"The id of the dataset to fetch groups for.","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"page","in":"path","description":"The page of groups to fetch. Page is 1-indexed.","required":true,"schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"description":"JSON body representing the groups created by the given dataset","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GroupData"}}}},"400":{"description":"Service error relating to getting the groups created by the given dataset","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseBody"}}}}},"security":[{"ApiKey":["readonly"]}]}},"/api/dataset/organization/{organization_id}":{"get":{"tags":["dataset"],"summary":"Get Datasets from Organization","description":"Get Datasets from Organization\n\nGet all datasets for an organization. The auth'ed user must be an admin or owner of the organization to get its datasets.","operationId":"get_datasets_from_organization","parameters":[{"name":"TR-Organization","in":"header","description":"The organization id to use for the request","required":true,"schema":{"type":"string"}},{"name":"organization_id","in":"path","description":"id of the organization you want to retrieve datasets for","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Datasets retrieved successfully","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/DatasetAndUsage"}}}}},"400":{"description":"Service error relating to retrieving the dataset","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseBody"}}}}},"security":[{"ApiKey":["admin"]}]}},"/api/dataset/{dataset_id}":{"get":{"tags":["dataset"],"summary":"Get Dataset","description":"Get Dataset\n\nGet a dataset by id. The auth'ed user must be an admin or owner of the organization to get a dataset.","operationId":"get_dataset","parameters":[{"name":"TR-Organization","in":"header","description":"The organization id to use for the request","required":true,"schema":{"type":"string"}},{"name":"TR-Dataset","in":"header","description":"The dataset id to use for the request","required":true,"schema":{"type":"string"}},{"name":"dataset_id","in":"path","description":"The id of the dataset you want to retrieve.","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Dataset retrieved successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Dataset"}}}},"400":{"description":"Service error relating to retrieving the dataset","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseBody"}}}}},"security":[{"ApiKey":["admin"]}]},"delete":{"tags":["dataset"],"summary":"Delete Dataset","description":"Delete Dataset\n\nDelete a dataset. The auth'ed user must be an owner of the organization to delete a dataset.","operationId":"delete_dataset","parameters":[{"name":"TR-Dataset","in":"header","description":"The dataset id to use for the request","required":true,"schema":{"type":"string"}},{"name":"dataset_id","in":"path","description":"The id of the dataset you want to delete.","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"204":{"description":"Dataset deleted successfully"},"400":{"description":"Service error relating to deleting the dataset","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseBody"}}}}},"security":[{"ApiKey":["owner"]}]}},"/api/events":{"post":{"tags":["events"],"summary":"Get events for the dataset","description":"Get events for the dataset\n\nGet events for the dataset specified by the TR-Dataset header.","operationId":"get_events","parameters":[{"name":"TR-Dataset","in":"header","description":"The dataset id to use for the request","required":true,"schema":{"type":"string"}}],"requestBody":{"description":"JSON request payload to get events for a dataset","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetEventsData"}}},"required":true},"responses":{"200":{"description":"Events for the dataset","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EventReturn"}}}},"400":{"description":"Service error relating to getting events for the dataset","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseBody"}}}}},"security":[{"ApiKey":["readonly"]}]}},"/api/file":{"post":{"tags":["file"],"summary":"Upload File","description":"Upload File\n\nUpload a file to S3 attached to the server. The file will be converted to HTML with tika and chunked algorithmically, images will be OCR'ed with tesseract. The resulting chunks will be indexed and searchable. Optionally, you can only upload the file and manually create chunks associated to the file after. See docs.trieve.ai and/or contact us for more details and tips. Auth'ed user must be an admin or owner of the dataset's organization to upload a file.","operationId":"upload_file_handler","parameters":[{"name":"TR-Dataset","in":"header","description":"The dataset id to use for the request","required":true,"schema":{"type":"string"}}],"requestBody":{"description":"JSON request payload to upload a file","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UploadFileData"}}},"required":true},"responses":{"200":{"description":"Confirmation that the file is uploading","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UploadFileResult"}}}},"400":{"description":"Service error relating to uploading the file","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseBody"}}}}},"security":[{"ApiKey":["admin"]}]}},"/api/file/{file_id}":{"get":{"tags":["file"],"summary":"Get File","description":"Get File\n\nDownload a file based on its id.","operationId":"get_file_handler","parameters":[{"name":"TR-Dataset","in":"header","description":"The dataset id to use for the request","required":true,"schema":{"type":"string"}},{"name":"file_id","in":"path","description":"The id of the file to fetch","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"The signed s3 url corresponding to the file_id requested","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FileDTO"}}}},"400":{"description":"Service error relating to finding the file","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseBody"}}}},"404":{"description":"File not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseBody"}}}}},"security":[{"ApiKey":["readonly"]}]},"delete":{"tags":["file"],"summary":"Delete File","description":"Delete File\n\nDelete a file from S3 attached to the server based on its id. This will disassociate chunks from the file, but only delete them all together if you specify delete_chunks to be true. Auth'ed user must be an admin or owner of the dataset's organization to delete a file.","operationId":"delete_file_handler","parameters":[{"name":"TR-Dataset","in":"header","description":"The dataset id to use for the request","required":true,"schema":{"type":"string"}},{"name":"file_id","in":"path","description":"The id of the file to delete","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"204":{"description":"Confirmation that the file has been deleted"},"400":{"description":"Service error relating to finding or deleting the file","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseBody"}}}}},"security":[{"ApiKey":["admin"]}]}},"/api/health":{"get":{"tags":["health"],"summary":"Health Check","description":"Health Check\n\nConfirmation that the service is healthy and can make embedding vectors","operationId":"health_check","responses":{"200":{"description":"Confirmation that the service is healthy and can make embedding vectors"},"400":{"description":"Service error relating to making an embedding or overall service health","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseBody"}}}}}}},"/api/invitation":{"post":{"tags":["invitation"],"summary":"Send Invitation","description":"Send Invitation\n\nInvitations act as a way to invite users to join an organization. After a user is invited, they will automatically be added to the organization with the role specified in the invitation once they set their.","operationId":"post_invitation","parameters":[{"name":"TR-Organization","in":"header","description":"The organization id to use for the request","required":true,"schema":{"type":"string"}}],"requestBody":{"description":"JSON request payload to send an invitation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvitationData"}}},"required":true},"responses":{"204":{"description":"Ok response. Indicates that invitation email was sent correctly."},"400":{"description":"Invalid email or some other error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseBody"}}}}},"security":[{"ApiKey":["admin"]}]}},"/api/message":{"post":{"tags":["message"],"summary":"Create a message","description":"Create a message\n\nCreate a message. Messages are attached to topics in order to coordinate memory of gen-AI chat sessions. We are considering refactoring this resource of the API soon. Currently, you can only send user messages. If the topic is a RAG topic then the response will include Chunks first on the stream. The structure will look like `[chunks]||mesage`. See docs.trieve.ai for more information.","operationId":"create_message_completion_handler","parameters":[{"name":"TR-Dataset","in":"header","description":"The dataset id to use for the request","required":true,"schema":{"type":"string"}}],"requestBody":{"description":"JSON request payload to create a message completion","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateMessageData"}}},"required":true},"responses":{"200":{"description":"This will be a JSON response of a string containing the LLM's generated inference. Response if not streaming.","content":{"text/plain":{"schema":{"type":"string"}}}},"400":{"description":"Service error relating to getting a chat completion","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseBody"}}}}},"security":[{"ApiKey":["readonly"]}]},"put":{"tags":["message"],"summary":"Edit a message","description":"Edit a message\n\nEdit a message which exists within the topic's chat history. This will delete the message and replace it with a new message. The new message will be generated by the AI based on the new content provided in the request body. The response will include Chunks first on the stream if the topic is using RAG. The structure will look like `[chunks]||mesage`. See docs.trieve.ai for more information.","operationId":"edit_message_handler","parameters":[{"name":"TR-Dataset","in":"header","description":"The dataset id to use for the request","required":true,"schema":{"type":"string"}}],"requestBody":{"description":"JSON request payload to edit a message and get a new stream","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EditMessageData"}}},"required":true},"responses":{"200":{"description":"This will be a HTTP stream, check the chat or search UI for an example how to process this"},"400":{"description":"Service error relating to getting a chat completion","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseBody"}}}}},"security":[{"ApiKey":["readonly"]}]},"delete":{"tags":["message"],"summary":"Regenerate message","description":"Regenerate message\n\nRegenerate the assistant response to the last user message of a topic. This will delete the last message and replace it with a new message. The response will include Chunks first on the stream if the topic is using RAG. The structure will look like `[chunks]||mesage`. See docs.trieve.ai for more information.","operationId":"regenerate_message_handler","parameters":[{"name":"TR-Dataset","in":"header","description":"The dataset id to use for the request","required":true,"schema":{"type":"string"}}],"requestBody":{"description":"JSON request payload to delete an agent message then regenerate it in a strem","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegenerateMessageData"}}},"required":true},"responses":{"200":{"description":"This will be a JSON response of a string containing the LLM's generated inference. Response if not streaming.","content":{"text/plain":{"schema":{"type":"string"}}}},"400":{"description":"Service error relating to getting a chat completion","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseBody"}}}}},"security":[{"ApiKey":["readonly"]}]}},"/api/messages/{messages_topic_id}":{"get":{"tags":["message"],"summary":"Get all messages for a given topic","description":"Get all messages for a given topic\n\nGet all messages for a given topic. If the topic is a RAG topic then the response will include Chunks first on each message. The structure will look like `[chunks]||mesage`. See docs.trieve.ai for more information.","operationId":"get_all_topic_messages","parameters":[{"name":"TR-Dataset","in":"header","description":"The dataset id to use for the request","required":true,"schema":{"type":"string"}},{"name":"messages_topic_id","in":"path","description":"The ID of the topic to get messages for.","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"All messages relating to the topic with the given ID","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Message"}}}}},"400":{"description":"Service error relating to getting the messages","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseBody"}}}}},"security":[{"ApiKey":["readonly"]}]}},"/api/organization":{"post":{"tags":["organization"],"summary":"Create Organization","description":"Create Organization\n\nCreate a new organization. The auth'ed user who creates the organization will be the default owner of the organization.","operationId":"create_organization","requestBody":{"description":"The organization data that you want to create","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateOrganizationData"}}},"required":true},"responses":{"200":{"description":"Created organization object","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Organization"}}}},"400":{"description":"Service error relating to creating the organization","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseBody"}}}}},"security":[{"ApiKey":["readonly"]}]},"put":{"tags":["organization"],"summary":"Update Organization","description":"Update Organization\n\nUpdate an organization. Only the owner of the organization can update it.","operationId":"update_organization","parameters":[{"name":"TR-Organization","in":"header","description":"The organization id to use for the request","required":true,"schema":{"type":"string"}}],"requestBody":{"description":"The organization data that you want to update","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateOrganizationData"}}},"required":true},"responses":{"200":{"description":"Updated organization object","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Organization"}}}},"400":{"description":"Service error relating to updating the organization","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseBody"}}}}},"security":[{"ApiKey":["owner"]}]}},"/api/organization/usage/{organization_id}":{"get":{"tags":["organization"],"summary":"Get Organization Usage","description":"Get Organization Usage\n\nFetch the current usage specification of an organization by its id. The auth'ed user must be an admin or owner of the organization to fetch it.","operationId":"get_organization_usage","parameters":[{"name":"TR-Organization","in":"header","description":"The organization id to use for the request","required":true,"schema":{"type":"string"}},{"name":"organization_id","in":"path","description":"The id of the organization you want to fetch the usage of.","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"The current usage of the specified organization","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrganizationUsageCount"}}}},"400":{"description":"Service error relating to finding the organization's usage by id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseBody"}}}}},"security":[{"ApiKey":["admin"]}]}},"/api/organization/users/{organization_id}":{"get":{"tags":["organization"],"summary":"Get Organization Users","description":"Get Organization Users\n\nFetch the users of an organization by its id. The auth'ed user must be an admin or owner of the organization to fetch it.","operationId":"get_organization_users","parameters":[{"name":"TR-Organization","in":"header","description":"The organization id to use for the request","required":true,"schema":{"type":"string"}},{"name":"organization_id","in":"path","description":"The id of the organization you want to fetch the users of.","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Array of users who belong to the specified by organization","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SlimUser"}}}}},"400":{"description":"Service error relating to finding the organization's users by id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseBody"}}}}},"security":[{"ApiKey":["admin"]}]}},"/api/organization/{organization_id}":{"get":{"tags":["organization"],"summary":"Get Organization","description":"Get Organization\n\nFetch the details of an organization by its id. The auth'ed user must be an admin or owner of the organization to fetch it.","operationId":"get_organization_by_id","parameters":[{"name":"TR-Organization","in":"header","description":"The organization id to use for the request","required":true,"schema":{"type":"string"}},{"name":"organization_id","in":"path","description":"The id of the organization you want to fetch.","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Organization with the id that was requested","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Organization"}}}},"400":{"description":"Service error relating to finding the organization by id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseBody"}}}},"404":{"description":"Organization not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseBody"}}}}},"security":[{"ApiKey":["admin"]}]},"delete":{"tags":["organization"],"summary":"Delete Organization","description":"Delete Organization\n\nDelete an organization by its id. The auth'ed user must be an owner of the organization to delete it.","operationId":"delete_organization_by_id","parameters":[{"name":"TR-Organization","in":"header","description":"The organization id to use for the request","required":true,"schema":{"type":"string"}},{"name":"organization_id","in":"path","description":"The id of the organization you want to fetch.","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Confirmation that the organization was deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Organization"}}}},"400":{"description":"Service error relating to deleting the organization by id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseBody"}}}}},"security":[{"ApiKey":["admin"]}]}},"/api/stripe/payment_link/{plan_id}/{organization_id}":{"get":{"tags":["stripe"],"summary":"Checkout","description":"Checkout\n\nGet a direct link to the stripe checkout page for the plan and organization","operationId":"direct_to_payment_link","parameters":[{"name":"plan_id","in":"path","description":"id of the plan you want to subscribe to","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"organization_id","in":"path","description":"id of the organization you want to subscribe to the plan","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"303":{"description":"SeeOther response redirecting user to stripe checkout page"},"400":{"description":"Service error relating to creating a URL for a stripe checkout page","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseBody"}}}}}}},"/api/stripe/plans":{"get":{"tags":["stripe"],"summary":"Get All Plans","description":"Get All Plans\n\nGet a list of all plans","operationId":"get_all_plans","responses":{"200":{"description":"List of all plans","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/StripePlan"}}}}},"400":{"description":"Service error relating to getting all plans","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseBody"}}}}}}},"/api/stripe/subscription/{subscription_id}":{"delete":{"tags":["stripe"],"summary":"Cancel Subscription","description":"Cancel Subscription\n\nCancel a subscription by its id","operationId":"cancel_subscription","parameters":[{"name":"TR-Organization","in":"header","description":"The organization id to use for the request","required":true,"schema":{"type":"string"}},{"name":"subscription_id","in":"path","description":"id of the subscription you want to cancel","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Confirmation that the subscription was cancelled"},"400":{"description":"Service error relating to creating a URL for a stripe checkout page","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseBody"}}}}},"security":[{"ApiKey":["owner"]}]}},"/api/stripe/subscription_plan/{subscription_id}/{plan_id}":{"patch":{"tags":["stripe"],"summary":"Update Subscription Plan","description":"Update Subscription Plan\n\nUpdate a subscription to a new plan","operationId":"update_subscription_plan","parameters":[{"name":"TR-Organization","in":"header","description":"The organization id to use for the request","required":true,"schema":{"type":"string"}},{"name":"subscription_id","in":"path","description":"id of the subscription you want to update","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"plan_id","in":"path","description":"id of the plan you want to subscribe to","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Confirmation that the subscription was updated to the new plan"},"400":{"description":"Service error relating to updating the subscription to the new plan","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseBody"}}}}},"security":[{"ApiKey":["readonly"]}]}},"/api/topic":{"post":{"tags":["topic"],"summary":"Create Topic","description":"Create Topic\n\nCreate a new chat topic. Topics are attached to a owner_id's and act as a coordinator for conversation message history of gen-AI chat sessions.","operationId":"create_topic","parameters":[{"name":"TR-Dataset","in":"header","description":"The dataset id to use for the request","required":true,"schema":{"type":"string"}}],"requestBody":{"description":"JSON request payload to create chat topic","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateTopicData"}}},"required":true},"responses":{"200":{"description":"The JSON response payload containing the created topic","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Topic"}}}},"400":{"description":"Topic name empty or a service error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseBody"}}}}},"security":[{"ApiKey":["readonly"]}]},"put":{"tags":["topic"],"summary":"Update Topic","description":"Update Topic\n\nUpdate an existing chat topic. Currently, only the name of the topic can be updated.","operationId":"update_topic","parameters":[{"name":"TR-Dataset","in":"header","description":"The dataset id to use for the request","required":true,"schema":{"type":"string"}}],"requestBody":{"description":"JSON request payload to update a chat topic","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateTopicData"}}},"required":true},"responses":{"204":{"description":"Confirmation that the topic was updated"},"400":{"description":"Service error relating to topic update","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseBody"}}}}},"security":[{"ApiKey":["readonly"]}]}},"/api/topic/owner/{owner_id}":{"get":{"tags":["topic"],"summary":"Get All Topics for Owner ID","description":"Get All Topics for Owner ID\n\nGet all topics belonging to an arbitary owner_id. This is useful for managing message history and chat sessions. It is common to use a browser fingerprint or your user's id as the owner_id.","operationId":"get_all_topics_for_owner_id","parameters":[{"name":"owner_id","in":"path","description":"The owner_id to get topics of; A common approach is to use a browser fingerprint or your user's id","required":true,"schema":{"type":"string"}},{"name":"TR-Dataset","in":"header","description":"The dataset id to use for the request","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"All topics belonging to a given owner_id","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Topic"}}}}},"400":{"description":"Service error relating to getting topics for the owner_id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseBody"}}}}},"security":[{"ApiKey":["readonly"]}]}},"/api/topic/{topic_id}":{"delete":{"tags":["topic"],"summary":"Delete Topic","description":"Delete Topic\n\nDelete an existing chat topic. When a topic is deleted, all associated chat messages are also deleted.","operationId":"delete_topic","parameters":[{"name":"TR-Dataset","in":"header","description":"The dataset id to use for the request","required":true,"schema":{"type":"string"}},{"name":"topic_id","in":"path","description":"The id of the topic you want to delete.","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"204":{"description":"Confirmation that the topic was deleted"},"400":{"description":"Service error relating to topic deletion","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseBody"}}}}},"security":[{"ApiKey":["readonly"]}]}},"/api/user":{"put":{"tags":["user"],"summary":"Update User","description":"Update User\n\nUpdate a user's information. If the user_id is not provided, the auth'ed user will be updated. If the user_id is provided, the auth'ed user must be an admin (1) or owner (2) of the organization.","operationId":"update_user","requestBody":{"description":"JSON request payload to update user information for the auth'ed user","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateUserOrgRoleData"}}},"required":true},"responses":{"204":{"description":"Confirmation that the user's role was updated"},"400":{"description":"Service error relating to updating the user","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseBody"}}}}},"security":[{"ApiKey":["readonly"]}]}},"/api/user/api_key":{"post":{"tags":["user"],"summary":"Set User Api Key","description":"Set User Api Key\n\nCreate a new api key for the auth'ed user. Successful response will contain the newly created api key. If a write role is assigned the api key will have permission level of the auth'ed user who calls this endpoint.","operationId":"set_user_api_key","requestBody":{"description":"JSON request payload to create a new user api key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetUserApiKeyRequest"}}},"required":true},"responses":{"200":{"description":"JSON body representing the api_key for the user","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetUserApiKeyResponse"}}}},"400":{"description":"Service error relating to creating api_key for the user","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseBody"}}}}},"security":[{"ApiKey":["readonly"]}]}},"/api/user/api_key/{api_key_id}":{"delete":{"tags":["user"],"summary":"Delete User Api Key","description":"Delete User Api Key\n\nDelete an api key for the auth'ed user.","operationId":"delete_user_api_key","parameters":[{"name":"api_key_id","in":"path","description":"The id of the api key to delete","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"JSON body representing the api_key for the user","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ApiKeyDTO"}}}}},"400":{"description":"Service error relating to creating api_key for the user","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseBody"}}}}},"security":[{"ApiKey":["readonly"]}]}}},"components":{"schemas":{"AddChunkToGroupData":{"type":"object","properties":{"chunk_id":{"type":"string","format":"uuid","description":"Id of the chunk to make a member of the group.","nullable":true},"tracking_id":{"type":"string","description":"Tracking Id of the chunk to make a member of the group.","nullable":true}}},"ApiKeyDTO":{"type":"object","required":["id","user_id","name","role","created_at","updated_at"],"properties":{"created_at":{"type":"string","format":"date-time"},"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"role":{"type":"integer","format":"int32"},"updated_at":{"type":"string","format":"date-time"},"user_id":{"type":"string","format":"uuid"}},"example":{"created_at":"2021-01-01T00:00:00","id":"e3e3e3e3-e3e3-e3e3-e3e3-e3e3e3e3e3e3","name":"Trieve","role":1,"updated_at":"2021-01-01T00:00:00","user_id":"e3e3e3e3-e3e3-e3e3-e3e3-e3e3e3e3e3e3"}},"AuthQuery":{"type":"object","properties":{"inv_code":{"type":"string","format":"uuid","description":"Code sent via email as a result of successful call to send_invitation","nullable":true},"organization_id":{"type":"string","format":"uuid","description":"ID of organization to authenticate into","nullable":true},"redirect_uri":{"type":"string","description":"URL to redirect to after successful login","nullable":true}},"example":{"inv_code":"00000000-0000-0000-0000-000000000000","organization_id":"00000000-0000-0000-0000-000000000000","redirect_uri":"https://api.trieve.ai"}},"AutocompleteData":{"type":"object","required":["search_type","query"],"properties":{"content_only":{"type":"boolean","description":"Set content_only to true to only returning the chunk_html of the chunks. This is useful for when you want to reduce amount of data over the wire for latency improvement (typically 10-50ms). Default is false.","nullable":true},"filters":{"allOf":[{"$ref":"#/components/schemas/ChunkFilter"}],"nullable":true},"highlight_delimiters":{"type":"array","items":{"type":"string"},"description":"Set highlight_delimiters to a list of strings to use as delimiters for highlighting. If not specified, this defaults to [\"?\", \",\", \".\", \"!\"].","nullable":true},"highlight_results":{"type":"boolean","description":"Set highlight_results to false for a slight latency improvement (1-10ms). If not specified, this defaults to true. This will add `<b><mark>` tags to the chunk_html of the chunks to highlight matching sub-sentences.","nullable":true},"highlight_threshold":{"type":"number","format":"double","description":"Set highlight_threshold to a lower or higher value to adjust the sensitivity of the highlights applied to the chunk html. If not specified, this defaults to 0.8. The range is 0.0 to 1.0.","nullable":true},"page_size":{"type":"integer","format":"int64","description":"Page size is the number of chunks to fetch. This can be used to fetch more than 10 chunks at a time.","nullable":true,"minimum":0},"query":{"type":"string","description":"Query is the search query. This can be any string. The query will be used to create an embedding vector and/or SPLADE vector which will be used to find the result set."},"recency_bias":{"type":"number","format":"float","description":"Recency Bias lets you determine how much of an effect the recency of chunks will have on the search results. If not specified, this defaults to 0.0. We recommend setting this to 1.0 for a gentle reranking of the results, >3.0 for a strong reranking of the results.","nullable":true},"score_threshold":{"type":"number","format":"float","description":"Set score_threshold to a float to filter out chunks with a score below the threshold.","nullable":true},"search_type":{"type":"string","description":"Can be either \"semantic\", or \"fulltext\". \"semantic\" will pull in one page (10 chunks) of the nearest cosine distant vectors. \"fulltext\" will pull in one page (10 chunks) of full-text results based on SPLADE."},"slim_chunks":{"type":"boolean","description":"Set slim_chunks to true to avoid returning the content and chunk_html of the chunks. This is useful for when you want to reduce amount of data over the wire for latency improvement (typically 10-50ms). Default is false.","nullable":true},"tag_weights":{"type":"object","description":"Tag weights is a JSON object which can be used to boost the ranking of chunks with certain tags. This is useful for when you want to be able to bias towards chunks with a certain tag on the fly. The keys are the tag names and the values are the weights.","additionalProperties":{"type":"number","format":"float"},"nullable":true},"use_weights":{"type":"boolean","description":"Set use_weights to true to use the weights of the chunks in the result set in order to sort them. If not specified, this defaults to true.","nullable":true}},"example":{"date_bias":true,"filters":{"must":[{"field":"metadata.key2","match":["value3","value4"],"range":{"gt":0.0,"gte":0.0,"lt":1.0,"lte":1.0}}],"must_not":[{"field":"metadata.key3","match":["value5","value6"],"range":{"gt":0.0,"gte":0.0,"lt":1.0,"lte":1.0}}],"should":[{"field":"metadata.key1","match":["value1","value2"],"range":{"gt":0.0,"gte":0.0,"lt":1.0,"lte":1.0}}]},"get_collisions":true,"highlight_delimiters":["?",",",".","!"],"highlight_results":true,"page":1,"page_size":10,"query":"Some search query","score_threshold":0.5,"search_type":"semantic","use_weights":true}},"BatchQueuedChunkResponse":{"type":"object","required":["chunk_metadata","pos_in_queue"],"properties":{"chunk_metadata":{"type":"array","items":{"$ref":"#/components/schemas/ChunkMetadata"}},"pos_in_queue":{"type":"integer","format":"int32","description":"The current position the last access item is in the queue"}},"example":{"chunk_metadata":[{"chunk_vector":[0.1,0.2,0.3],"content":"Some content","file_id":"d290f1ee-6c54-4b01-90e6-d701748f0851","link":"https://example.com","metadata":{"key1":"value1","key2":"value2"},"tag_set":["tag1","tag2"],"time_stamp":"2021-01-01T00:00:00","tracking_id":"tracking_id","weight":0.5},{"chunk_vector":[0.1,0.2,0.3],"content":"Some content","file_id":"d290f1ee-6c54-4b01-90e6-d701748f0851","link":"https://example.com","metadata":{"key1":"value1","key2":"value2"},"tag_set":["tag1","tag2"],"time_stamp":"2021-01-01T00:00:00","tracking_id":"tracking_id","weight":0.5}],"pos_in_queue":2}},"BookmarkData":{"type":"object","required":["chunks","group","total_pages"],"properties":{"chunks":{"type":"array","items":{"$ref":"#/components/schemas/ChunkMetadata"}},"group":{"$ref":"#/components/schemas/ChunkGroup"},"total_pages":{"type":"integer","format":"int64"}}},"BookmarkGroupResult":{"type":"object","required":["chunk_uuid","slim_groups"],"properties":{"chunk_uuid":{"type":"string","format":"uuid"},"slim_groups":{"type":"array","items":{"$ref":"#/components/schemas/SlimGroup"}}}},"ChatMessageProxy":{"type":"object","required":["role","content"],"properties":{"content":{"type":"string"},"role":{"type":"string"}},"example":{"content":"Hello, world!","role":"user"}},"ChunkData":{"type":"object","properties":{"chunk_html":{"type":"string","description":"HTML content of the chunk. This can also be plaintext. The innerText of the HTML will be used to create the embedding vector. The point of using HTML is for convienience, as some users have applications where users submit HTML content.","nullable":true},"chunk_vector":{"type":"array","items":{"type":"number","format":"float"},"description":"Chunk_vector is a vector of floats which can be used instead of generating a new embedding. This is useful for when you are using a pre-embedded dataset. If this is not provided, the innerText of the chunk_html will be used to create the embedding.","nullable":true},"convert_html_to_text":{"type":"boolean","description":"Convert HTML to raw text before processing to avoid adding noise to the vector embeddings. By default this is true. If you are using HTML content that you want to be included in the vector embeddings, set this to false.","nullable":true},"group_ids":{"type":"array","items":{"type":"string","format":"uuid"},"description":"Group ids are the ids of the groups that the chunk should be placed into. This is useful for when you want to create a chunk and add it to a group or multiple groups in one request. Necessary because this route queues the chunk for ingestion and the chunk may not exist yet immediately after response.","nullable":true},"group_tracking_ids":{"type":"array","items":{"type":"string"},"description":"Group tracking_ids are the tracking_ids of the groups that the chunk should be placed into. This is useful for when you want to create a chunk and add it to a group or multiple groups in one request. Necessary because this route queues the chunk for ingestion and the chunk may not exist yet immediately after response.","nullable":true},"image_urls":{"type":"array","items":{"type":"string"},"description":"Image urls are a list of urls to images that are associated with the chunk. This is useful for when you want to associate images with a chunk.","nullable":true},"link":{"type":"string","description":"Link to the chunk. This can also be any string. Frequently, this is a link to the source of the chunk. The link value will not affect the embedding creation.","nullable":true},"location":{"allOf":[{"$ref":"#/components/schemas/GeoInfo"}],"nullable":true},"metadata":{"description":"Metadata is a JSON object which can be used to filter chunks. This is useful for when you want to filter chunks by arbitrary metadata. Unlike with tag filtering, there is a performance hit for filtering on metadata.","nullable":true},"split_avg":{"type":"boolean","description":"Split avg is a boolean which tells the server to split the text in the chunk_html into smaller chunks and average their resulting vectors. This is useful for when you want to create a chunk from a large piece of text and want to split it into smaller chunks to create a more fuzzy average dense vector. The sparse vector will be generated normally with no averaging. By default this is false.","nullable":true},"tag_set":{"type":"array","items":{"type":"string"},"description":"Tag set is a list of tags. This can be used to filter chunks by tag. Unlike with metadata filtering, HNSW indices will exist for each tag such that there is not a performance hit for filtering on them.","nullable":true},"time_stamp":{"type":"string","description":"Time_stamp should be an ISO 8601 combined date and time without timezone. It is used for time window filtering and recency-biasing search results.","nullable":true},"tracking_id":{"type":"string","description":"Tracking_id is a string which can be used to identify a chunk. This is useful for when you are coordinating with an external system and want to use the tracking_id to identify the chunk.","nullable":true},"upsert_by_tracking_id":{"type":"boolean","description":"Upsert when a chunk with the same tracking_id exists. By default this is false, and the request will fail if a chunk with the same tracking_id exists. If this is true, the chunk will be updated if a chunk with the same tracking_id exists.","nullable":true},"weight":{"type":"number","format":"double","description":"Weight is a float which can be used to bias search results. This is useful for when you want to bias search results for a chunk. The magnitude only matters relative to other chunks in the chunk's dataset dataset.","nullable":true}},"example":{"chunk_html":"<p>Some HTML content</p>","chunk_vector":[0.1,0.2,0.3],"file_id":"d290f1ee-6c54-4b01-90e6-d701748f0851","group_ids":["d290f1ee-6c54-4b01-90e6-d701748f0851"],"group_tracking_ids":["group_tracking_id"],"link":"https://example.com","metadata":{"key1":"value1","key2":"value2"},"split_avg":false,"tag_set":["tag1","tag2"],"time_stamp":"2021-01-01T00:00:00","tracking_id":"tracking_id","upsert_by_tracking_id":true,"weight":0.5}},"ChunkFilter":{"type":"object","properties":{"must":{"type":"array","items":{"$ref":"#/components/schemas/FieldCondition"},"description":"All of these field conditions have to match for the chunk to be included in the result set.","nullable":true},"must_not":{"type":"array","items":{"$ref":"#/components/schemas/FieldCondition"},"description":"None of these field conditions can match for the chunk to be included in the result set.","nullable":true},"should":{"type":"array","items":{"$ref":"#/components/schemas/FieldCondition"},"description":"Only one of these field conditions has to match for the chunk to be included in the result set.","nullable":true}},"example":{"must":[{"field":"metadata.key2","match":["value3","value4"],"range":{"gt":0.0,"gte":0.0,"lt":1.0,"lte":1.0}}],"must_not":[{"field":"metadata.key3","match":["value5","value6"],"range":{"gt":0.0,"gte":0.0,"lt":1.0,"lte":1.0}}],"should":[{"field":"metadata.key1","match":["value1","value2"],"range":{"gt":0.0,"gte":0.0,"lt":1.0,"lte":1.0}}]}},"ChunkGroup":{"type":"object","required":["id","name","description","created_at","updated_at","dataset_id"],"properties":{"created_at":{"type":"string","format":"date-time"},"dataset_id":{"type":"string","format":"uuid"},"description":{"type":"string"},"id":{"type":"string","format":"uuid"},"metadata":{"nullable":true},"name":{"type":"string"},"tag_set":{"type":"string","nullable":true},"tracking_id":{"type":"string","nullable":true},"updated_at":{"type":"string","format":"date-time"}},"example":{"created_at":"2021-01-01T00:00:00","dataset_id":"e3e3e3e3-e3e3-e3e3-e3e3-e3e3e3e3e3e3","id":"e3e3e3e3-e3e3-e3e3-e3e3-e3e3e3e3e3e3","name":"Trieve","tracking_id":"3","updated_at":"2021-01-01T00:00:00"}},"ChunkGroupAndFile":{"type":"object","required":["id","dataset_id","name","description","created_at","updated_at"],"properties":{"created_at":{"type":"string","format":"date-time"},"dataset_id":{"type":"string","format":"uuid"},"description":{"type":"string"},"file_id":{"type":"string","format":"uuid","nullable":true},"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"tracking_id":{"type":"string","nullable":true},"updated_at":{"type":"string","format":"date-time"}},"example":{"created_at":"2021-01-01T00:00:00","dataset_id":"e3e3e3e3-e3e3-e3e3-e3e3-e3e3e3e3e3e3","description":"A group of chunks","file_id":"e3e3e3e3-e3e3-e3e3-e3e3-e3e3e3e3e3e3","id":"e3e3e3e3-e3e3-e3e3-e3e3-e3e3e3e3e3e3","name":"Trieve","tracking_id":"3","updated_at":"2021-01-01T00:00:00"}},"ChunkMetadata":{"type":"object","required":["id","created_at","updated_at","dataset_id","weight"],"properties":{"chunk_html":{"type":"string","nullable":true},"created_at":{"type":"string","format":"date-time"},"dataset_id":{"type":"string","format":"uuid"},"id":{"type":"string","format":"uuid"},"image_urls":{"type":"array","items":{"type":"string","nullable":true},"nullable":true},"link":{"type":"string","nullable":true},"location":{"allOf":[{"$ref":"#/components/schemas/GeoInfo"}],"nullable":true},"metadata":{"nullable":true},"qdrant_point_id":{"type":"string","format":"uuid","nullable":true},"tag_set":{"type":"string","nullable":true},"time_stamp":{"type":"string","format":"date-time","nullable":true},"tracking_id":{"type":"string","nullable":true},"updated_at":{"type":"string","format":"date-time"},"weight":{"type":"number","format":"double"}},"example":{"chunk_html":"<p>Hello, world!</p>","created_at":"2021-01-01T00:00:00","dataset_id":"e3e3e3e3-e3e3-e3e3-e3e3-e3e3e3e3e3e3","id":"e3e3e3e3-e3e3-e3e3-e3e3-e3e3e3e3e3e3","link":"https://trieve.ai","metadata":{"key":"value"},"qdrant_point_id":"e3e3e3e3-e3e3-e3e3-e3e3-e3e3e3e3e3e3","tag_set":"tag1,tag2","time_stamp":"2021-01-01T00:00:00","tracking_id":"e3e3e3e3-e3e3-e3e3-e3e3-e3e3e3e3e3e3","updated_at":"2021-01-01T00:00:00","weight":0.5}},"ChunkMetadataTypes":{"oneOf":[{"$ref":"#/components/schemas/SlimChunkMetadata"},{"$ref":"#/components/schemas/ChunkMetadata"},{"$ref":"#/components/schemas/ContentChunkMetadata"}]},"ChunkMetadataWithScore":{"type":"object","required":["id","created_at","updated_at","dataset_id","weight","score"],"properties":{"chunk_html":{"type":"string","nullable":true},"created_at":{"type":"string","format":"date-time"},"dataset_id":{"type":"string","format":"uuid"},"id":{"type":"string","format":"uuid"},"link":{"type":"string","nullable":true},"metadata":{"nullable":true},"qdrant_point_id":{"type":"string","format":"uuid","nullable":true},"score":{"type":"number","format":"float"},"tag_set":{"type":"string","nullable":true},"time_stamp":{"type":"string","format":"date-time","nullable":true},"tracking_id":{"type":"string","nullable":true},"updated_at":{"type":"string","format":"date-time"},"weight":{"type":"number","format":"double"}},"example":{"chunk_html":"<p>Hello, world!</p>","content":"Hello, world!","created_at":"2021-01-01T00:00:00","dataset_id":"e3e3e3e3-e3e3-e3e3-e3e3-e3e3e3e3e3e3","id":"e3e3e3e3-e3e3-e3e3-e3e3-e3e3e3e3e3e3","link":"https://trieve.ai","metadata":{"key":"value"},"qdrant_point_id":"e3e3e3e3-e3e3-e3e3-e3e3-e3e3e3e3e3e3","score":0.9,"tag_set":"tag1,tag2","time_stamp":"2021-01-01T00:00:00","tracking_id":"e3e3e3e3-e3e3-e3e3-e3e3-e3e3e3e3e3e3","updated_at":"2021-01-01T00:00:00","weight":0.5}},"ClientDatasetConfiguration":{"type":"object","required":["FILE_NAME_KEY"],"properties":{"CREATE_CHUNK_FEATURE":{"type":"boolean","nullable":true},"DATE_RANGE_VALUE":{"type":"string","nullable":true},"DOCUMENT_UPLOAD_FEATURE":{"type":"boolean","nullable":true},"FILE_NAME_KEY":{"type":"string"},"FILTER_ITEMS":{"nullable":true},"FRONTMATTER_VALS":{"type":"string","nullable":true},"IMAGE_RANGE_END_KEY":{"type":"string","nullable":true},"IMAGE_RANGE_START_KEY":{"type":"string","nullable":true},"LINES_BEFORE_SHOW_MORE":{"type":"integer","nullable":true,"minimum":0},"SEARCH_QUERIES":{"type":"string","nullable":true},"SUGGESTED_QUERIES":{"type":"string","nullable":true}},"example":{"CREATE_CHUNK_FEATURE":true,"DATE_RANGE_VALUE":"date range value","DOCUMENT_UPLOAD_FEATURE":true,"FILE_NAME_KEY":"file_name_key","FILTER_ITEMS":[],"FRONTMATTER_VALS":"frontmatter vals","IMAGE_RANGE_END_KEY":"image range end key","IMAGE_RANGE_START_KEY":"image range start key","LINES_BEFORE_SHOW_MORE":10,"SEARCH_QUERIES":"search queries","SUGGESTED_QUERIES":"suggested queries"}},"ContentChunkMetadata":{"type":"object","required":["id","weight"],"properties":{"chunk_html":{"type":"string","nullable":true},"id":{"type":"string","format":"uuid"},"image_urls":{"type":"array","items":{"type":"string","nullable":true},"nullable":true},"qdrant_point_id":{"type":"string","format":"uuid","nullable":true},"time_stamp":{"type":"string","format":"date-time","nullable":true},"tracking_id":{"type":"string","nullable":true},"weight":{"type":"number","format":"double"}},"example":{"created_at":"2021-01-01T00:00:00","dataset_id":"e3e3e3e3-e3e3-e3e3-e3e3-e3e3e3e3e3e3","id":"e3e3e3e3-e3e3-e3e3-e3e3-e3e3e3e3e3e3","link":"https://trieve.ai","metadata":{"key":"value"},"qdrant_point_id":"e3e3e3e3-e3e3-e3e3-e3e3-e3e3e3e3e3e3","tag_set":"tag1,tag2","time_stamp":"2021-01-01T00:00:00","tracking_id":"e3e3e3e3-e3e3-e3e3-e3e3-e3e3e3e3e3e3","updated_at":"2021-01-01T00:00:00","weight":0.5}},"CreateBatchChunkData":{"type":"array","items":{"$ref":"#/components/schemas/ChunkData"},"example":[{"chunk_html":"<p>Some HTML content</p>","chunk_vector":[0.1,0.2,0.3],"file_id":"d290f1ee-6c54-4b01-90e6-d701748f0851","group_ids":["d290f1ee-6c54-4b01-90e6-d701748f0851"],"group_tracking_ids":["group_tracking_id"],"link":"https://example.com","metadata":{"key1":"value1","key2":"value2"},"split_avg":false,"tag_set":["tag1","tag2"],"time_stamp":"2021-01-01T00:00:00","tracking_id":"tracking_id","upsert_by_tracking_id":true,"weight":0.5},{"chunk_html":"<p>Some more HTML content</p>","chunk_vector":[0.1,0.2,0.3],"file_id":"d290f1ee-6c54-4b01-90e6-d701748f0851","group_ids":["d290f1ee-6c54-4b01-90e6-d701748f0851"],"group_tracking_ids":["group_tracking_id"],"link":"https://explain.com","metadata":{"key1":"value1","key2":"value2"},"split_avg":false,"tag_set":["tag3","tag4"],"time_stamp":"2021-01-01T00:00:00","tracking_id":"tracking_id","upsert_by_tracking_id":true,"weight":0.5}]},"CreateChunkData":{"oneOf":[{"$ref":"#/components/schemas/CreateSingleChunkData"},{"$ref":"#/components/schemas/CreateBatchChunkData"}]},"CreateChunkGroupData":{"type":"object","required":["name"],"properties":{"description":{"type":"string","description":"Description to assign to the chunk_group. Convenience field for you to avoid having to remember what the group is for.","nullable":true},"metadata":{"description":"Optional metadata to assign to the chunk_group. This is a JSON object that can store any additional information you want to associate with the chunks inside of the chunk_group.","nullable":true},"name":{"type":"string","description":"Name to assign to the chunk_group. Does not need to be unique."},"tag_set":{"type":"array","items":{"type":"string"},"description":"Optional tags to assign to the chunk_group. This is a list of strings that can be used to categorize the chunks inside the chunk_group.","nullable":true},"tracking_id":{"type":"string","description":"Optional tracking id to assign to the chunk_group. This is a unique identifier for the chunk_group.","nullable":true},"upsert_by_tracking_id":{"type":"boolean","description":"Upsert when a chunk_group with the same tracking_id exists. By default this is false, and the request will fail if a chunk_group with the same tracking_id exists. If this is true, the chunk_group will be updated if a chunk_group with the same tracking_id exists.","nullable":true}}},"CreateDatasetRequest":{"type":"object","required":["dataset_name","organization_id","server_configuration","client_configuration"],"properties":{"client_configuration":{"description":"Client configuration for the dataset, can be arbitrary JSON. We recommend setting to `{}` to start. See docs.trieve.ai for more information or adjust with the admin dashboard."},"dataset_name":{"type":"string","description":"Name of the dataset. Must be unique within the organization."},"organization_id":{"type":"string","format":"uuid","description":"Organization ID that the dataset will belong to."},"server_configuration":{"description":"Server configuration for the dataset, can be arbitrary JSON. We recommend setting to `{}` to start. See docs.trieve.ai for more information or adjust with the admin dashboard."},"tracking_id":{"type":"string","description":"Optional tracking ID for the dataset. Can be used to track the dataset in external systems.","nullable":true}},"example":{"client_configuration":{},"dataset_name":"My Dataset","organization_id":"00000000-0000-0000-0000-000000000000","server_configuration":{}}},"CreateMessageData":{"type":"object","required":["new_message_content","topic_id"],"properties":{"highlight_delimiters":{"type":"array","items":{"type":"string"},"description":"The delimiters to use for highlighting the citations. If this is not included, the default delimiters will be used. Default is `[\".\", \"!\", \"?\", \"\\n\", \"\\t\", \",\"]`.","nullable":true},"highlight_results":{"type":"boolean","description":"Set highlight_results to false for a slight latency improvement (1-10ms). If not specified, this defaults to true. This will add `<b><mark>` tags to the chunk_html of the chunks to highlight matching sub-sentences.","nullable":true},"new_message_content":{"type":"string","description":"The content of the user message to attach to the topic and then generate an assistant message in response to."},"stream_response":{"type":"boolean","description":"Whether or not to stream the response. If this is set to true or not included, the response will be a stream. If this is set to false, the response will be a normal JSON response. Default is true.","nullable":true},"topic_id":{"type":"string","format":"uuid","description":"The ID of the topic to attach the message to."}}},"CreateOrganizationData":{"type":"object","required":["name"],"properties":{"name":{"type":"string","description":"The arbitrary name which will be used to identify the organization. This name must be unique."}}},"CreateSingleChunkData":{"$ref":"#/components/schemas/ChunkData"},"CreateTopicData":{"type":"object","required":["owner_id"],"properties":{"first_user_message":{"type":"string","description":"The first message which will belong to the topic. The topic name is generated based on this message similar to how it works in the OpenAI chat UX if a name is not explicitly provided on the name request body key.","nullable":true},"name":{"type":"string","description":"The name of the topic. If this is not provided, the topic name is generated from the first_user_message.","nullable":true},"owner_id":{"type":"string","description":"The owner_id of the topic. This is typically a browser fingerprint or your user's id. It is used to group topics together for a user."}}},"Dataset":{"type":"object","required":["id","name","created_at","updated_at","organization_id","server_configuration","client_configuration"],"properties":{"client_configuration":{},"created_at":{"type":"string","format":"date-time"},"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"organization_id":{"type":"string","format":"uuid"},"server_configuration":{},"tracking_id":{"type":"string","nullable":true},"updated_at":{"type":"string","format":"date-time"}},"example":{"client_configuration":{"key":"value"},"created_at":"2021-01-01T00:00:00","id":"e3e3e3e3-e3e3-e3e3-e3e3-e3e3e3e3e3e3","name":"Trieve","organization_id":"e3e3e3e3-e3e3-e3e3-e3e3-e3e3e3e3e3e3","server_configuration":{"key":"value"},"tracking_id":"3","updated_at":"2021-01-01T00:00:00"}},"DatasetAndUsage":{"type":"object","required":["dataset","dataset_usage"],"properties":{"dataset":{"$ref":"#/components/schemas/DatasetDTO"},"dataset_usage":{"$ref":"#/components/schemas/DatasetUsageCount"}},"example":{"dataset":{"client_configuration":{"key":"value"},"created_at":"2021-01-01T00:00:00","id":"e3e3e3e3-e3e3-e3e3-e3e3-e3e3e3e3e3e3","name":"Trieve","organization_id":"e3e3e3e3-e3e3-e3e3-e3e3-e3e3e3e3e3e3","updated_at":"2021-01-01T00:00:00"},"dataset_usage":{"chunk_count":100,"dataset_id":"e3e3e3e3-e3e3-e3e3-e3e3-e3e3e3e3e3e3","id":"e3e3e3e3-e3e3-e3e3-e3e3-e3e3e3e3e3e3"}}},"DatasetDTO":{"type":"object","required":["id","name","created_at","updated_at","organization_id","client_configuration"],"properties":{"client_configuration":{},"created_at":{"type":"string","format":"date-time"},"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"organization_id":{"type":"string","format":"uuid"},"tracking_id":{"type":"string","nullable":true},"updated_at":{"type":"string","format":"date-time"}},"example":{"client_configuration":{"key":"value"},"created_at":"2021-01-01T00:00:00","id":"e3e3e3e3-e3e3-e3e3-e3e3-e3e3e3e3e3e3","name":"Trieve","organization_id":"e3e3e3e3-e3e3-e3e3-e3e3-e3e3e3e3e3e3","tracking_id":"3","updated_at":"2021-01-01T00:00:00"}},"DatasetUsageCount":{"type":"object","required":["id","dataset_id","chunk_count"],"properties":{"chunk_count":{"type":"integer","format":"int32"},"dataset_id":{"type":"string","format":"uuid"},"id":{"type":"string","format":"uuid"}},"example":{"chunk_count":100,"dataset_id":"e3e3e3e3-e3e3-e3e3-e3e3-e3e3e3e3e3e3","id":"e3e3e3e3-e3e3-e3e3-e3e3-e3e3e3e3e3e3"}},"DateRange":{"type":"object","properties":{"gt":{"type":"string","nullable":true},"gte":{"type":"string","nullable":true},"lt":{"type":"string","nullable":true},"lte":{"type":"string","nullable":true}},"example":{"gt":"2021-01-01T00:00:00","gte":"2021-01-01T00:00:00","lt":"2021-01-01T00:00:00","lte":"2021-01-01T00:00:00"}},"DeleteTopicData":{"type":"object","required":["topic_id"],"properties":{"topic_id":{"type":"string","format":"uuid","description":"The id of the topic to target."}}},"DeleteUserApiKeyRequest":{"type":"object","required":["api_key_id"],"properties":{"api_key_id":{"type":"string","format":"uuid","description":"The id of the api key to delete."}}},"EditMessageData":{"type":"object","required":["topic_id","message_sort_order","new_message_content"],"properties":{"highlight_citations":{"type":"boolean","description":"Whether or not to highlight the citations in the response. If this is set to true or not included, the citations will be highlighted. If this is set to false, the citations will not be highlighted. Default is true.","nullable":true},"highlight_delimiters":{"type":"array","items":{"type":"string"},"description":"The delimiters to use for highlighting the citations. If this is not included, the default delimiters will be used. Default is `[\".\", \"!\", \"?\", \"\\n\", \"\\t\", \",\"]`.","nullable":true},"message_sort_order":{"type":"integer","format":"int32","description":"The sort order of the message to edit."},"new_message_content":{"type":"string","description":"The new content of the message to replace the old content with."},"stream_response":{"type":"boolean","description":"Whether or not to stream the response. If this is set to true or not included, the response will be a stream. If this is set to false, the response will be a normal JSON response. Default is true.","nullable":true},"topic_id":{"type":"string","format":"uuid","description":"The id of the topic to edit the message at the given sort order for."}}},"ErrorResponseBody":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}},"example":{"message":"Bad Request"}},"Event":{"type":"object","required":["id","created_at","updated_at","dataset_id","event_type","event_data"],"properties":{"created_at":{"type":"string","format":"date-time"},"dataset_id":{"type":"string","format":"uuid"},"event_data":{},"event_type":{"type":"string"},"id":{"type":"string","format":"uuid"},"updated_at":{"type":"string","format":"date-time"}},"example":{"created_at":"2021-01-01T00:00:00","dataset_id":"e3e3e3e3-e3e3-e3e3-e3e3-e3e3e3e3e3e3","event_data":{"file_name":"file.txt","group_id":"e3e3e3e3-e3e3-e3e3-e3e3-e3e3e3e3e3e3"},"event_type":"file_uploaded","id":"e3e3e3e3-e3e3-e3e3-e3e3-e3e3e3e3e3e3","updated_at":"2021-01-01T00:00:00"}},"EventReturn":{"type":"object","required":["events","page_count"],"properties":{"events":{"type":"array","items":{"$ref":"#/components/schemas/Event"}},"page_count":{"type":"integer","format":"int32"}}},"FieldCondition":{"type":"object","required":["field"],"properties":{"date_range":{"allOf":[{"$ref":"#/components/schemas/DateRange"}],"nullable":true},"field":{"type":"string","description":"Field is the name of the field to filter on. The field value will be used to check for an exact substring match on the metadata values for each existing chunk. This is useful for when you want to filter chunks by arbitrary metadata. To access fields inside of the metadata that you provide with the card, prefix the field name with `metadata.`."},"geo_bounding_box":{"allOf":[{"$ref":"#/components/schemas/LocationBoundingBox"}],"nullable":true},"geo_polygon":{"allOf":[{"$ref":"#/components/schemas/LocationPolygon"}],"nullable":true},"geo_radius":{"allOf":[{"$ref":"#/components/schemas/LocationRadius"}],"nullable":true},"match":{"type":"array","items":{"$ref":"#/components/schemas/MatchCondition"},"description":"Match is the value to match on the field. The match value will be used to check for an exact substring match on the metadata values for each existing chunk. This is useful for when you want to filter chunks by arbitrary metadata.","nullable":true},"range":{"allOf":[{"$ref":"#/components/schemas/Range"}],"nullable":true}},"example":{"field":"metadata.key1","match":["value1","value2"],"range":{"gt":0.0,"gte":0.0,"lt":1.0,"lte":1.0}}},"File":{"type":"object","required":["id","file_name","created_at","updated_at","size","dataset_id"],"properties":{"created_at":{"type":"string","format":"date-time"},"dataset_id":{"type":"string","format":"uuid"},"file_name":{"type":"string"},"id":{"type":"string","format":"uuid"},"link":{"type":"string","nullable":true},"metadata":{"nullable":true},"size":{"type":"integer","format":"int64"},"tag_set":{"type":"string","nullable":true},"time_stamp":{"type":"string","format":"date-time","nullable":true},"updated_at":{"type":"string","format":"date-time"}},"example":{"created_at":"2021-01-01T00:00:00","dataset_id":"e3e3e3e3-e3e3-e3e3-e3e3-e3e3e3e3e3e3","file_name":"file.txt","id":"e3e3e3e3-e3e3-e3e3-e3e3-e3e3e3e3e3e3","link":"https://trieve.ai","metadata":{"key":"value"},"size":1000,"tag_set":"tag1,tag2","time_stamp":"2021-01-01T00:00:00","updated_at":"2021-01-01T00:00:00"}},"FileDTO":{"type":"object","required":["id","file_name","created_at","updated_at","size","s3_url"],"properties":{"created_at":{"type":"string","format":"date-time"},"file_name":{"type":"string"},"id":{"type":"string","format":"uuid"},"link":{"type":"string","nullable":true},"metadata":{"nullable":true},"s3_url":{"type":"string"},"size":{"type":"integer","format":"int64"},"updated_at":{"type":"string","format":"date-time"}},"example":{"created_at":"2021-01-01T00:00:00","file_name":"file.txt","id":"e3e3e3e3-e3e3-e3e3-e3e3-e3e3e3e3e3e3","link":"https://trieve.ai","metadata":{"key":"value"},"s3_url":"https://trieve.ai","size":1000,"updated_at":"2021-01-01T00:00:00"}},"GenerateChunksRequest":{"type":"object","required":["prev_messages","chunk_ids"],"properties":{"chunk_ids":{"type":"array","items":{"type":"string","format":"uuid"},"description":"The ids of the chunks to be retrieved and injected into the context window for RAG."},"highlight_results":{"type":"boolean","description":"Set highlight_results to false for a slight latency improvement (1-10ms). If not specified, this defaults to true. This will add `<b><mark>`` tags to the chunk_html of the chunks to highlight matching sub-sentences.","nullable":true},"prev_messages":{"type":"array","items":{"$ref":"#/components/schemas/ChatMessageProxy"},"description":"The previous messages to be placed into the chat history. The last message in this array will be the prompt for the model to inference on. The length of this array must be at least 1."},"prompt":{"type":"string","description":"Prompt for the last message in the prev_messages array. This will be used to generate the next message in the chat. The default is 'Respond to the instruction and include the doc numbers that you used in square brackets at the end of the sentences that you used the docs for:'. You can also specify an empty string to leave the final message alone such that your user's final message can be used as the prompt. See docs.trieve.ai or contact us for more information.","nullable":true},"stream_response":{"type":"boolean","description":"Whether or not to stream the response. If this is set to true or not included, the response will be a stream. If this is set to false, the response will be a normal JSON response. Default is true.","nullable":true}},"example":{"chunk_ids":["d290f1ee-6c54-4b01-90e6-d701748f0851"],"model":"text-embedding-small","prev_messages":[{"content":"I am going to provide several pieces of information (docs) for you to use in response to a request or question.","role":"user"}],"prompt":"Respond to the instruction and include the doc numbers that you used in square brackets at the end of the sentences that you used the docs for:","stream_response":true}},"GeoInfo":{"type":"object","required":["lat","lon"],"properties":{"lat":{"$ref":"#/components/schemas/GeoTypes"},"lon":{"$ref":"#/components/schemas/GeoTypes"}}},"GeoTypes":{"oneOf":[{"type":"integer","format":"int64"},{"type":"number","format":"double"}]},"GetChunksData":{"type":"object","required":["ids"],"properties":{"ids":{"type":"array","items":{"type":"string","format":"uuid"}}}},"GetEventsData":{"type":"object","properties":{"event_types":{"type":"array","items":{"type":"string"},"description":"The types of events to get. Any combination of file_uploaded, chunk_uploaded, chunk_action_failed, chunk_updated, or qdrant_index_failed. Leave undefined to get all events.","nullable":true},"page":{"type":"integer","format":"int64","description":"The page number to get. Default is 1.","nullable":true},"page_size":{"type":"integer","format":"int64","description":"The number of items per page. Default is 10.","nullable":true}},"example":{"page":1,"page_size":10,"type":["chunk_action_failed"]}},"GetGroupsForChunksData":{"type":"object","required":["chunk_ids"],"properties":{"chunk_ids":{"type":"array","items":{"type":"string","format":"uuid"}}}},"GetTrackingChunksData":{"type":"object","required":["tracking_ids"],"properties":{"tracking_ids":{"type":"array","items":{"type":"string"}}}},"GroupData":{"type":"object","required":["groups","total_pages"],"properties":{"groups":{"type":"array","items":{"$ref":"#/components/schemas/ChunkGroupAndFile"}},"total_pages":{"type":"integer","format":"int64"}}},"GroupScoreChunk":{"type":"object","required":["group_id","metadata"],"properties":{"group_id":{"type":"string","format":"uuid"},"group_name":{"type":"string","nullable":true},"group_tracking_id":{"type":"string","nullable":true},"metadata":{"type":"array","items":{"$ref":"#/components/schemas/ScoreChunkDTO"}}},"example":{"group_id":"e3e3e3-e3e3-e3e3-e3e3-e3e3e3e3e3e3","metadata":[{"metadata":[{"content":"This is a test content","id":"e3e3e3-e3e3-e3e3-e3e3-e3e3e3e3e3e3","link":"https://www.google.com","metadata":{"key":"value"},"tag_set":"test","time_stamp":"2021-01-01T00:00:00Z","tracking_id":"e3e3e3-e3e3-e3e3-e3e3-e3e3e3e3e3e3","weight":1.0}],"score":0.5}]}},"InvitationData":{"type":"object","required":["organization_id","user_role","email","app_url","redirect_uri"],"properties":{"app_url":{"type":"string","description":"The url of the app that the user will be directed to in order to set their password. Usually admin.trieve.ai, but may differ for local dev or self-hosted setups."},"email":{"type":"string","description":"The email of the user to invite. Must be a valid email as they will be sent an email to register."},"organization_id":{"type":"string","format":"uuid","description":"The id of the organization to invite the user to."},"redirect_uri":{"type":"string","description":"The url that the user will be redirected to after setting their password."},"user_role":{"type":"integer","format":"int32","description":"The role the user will have in the organization. 0 = User, 1 = Admin, 2 = Owner."}}},"LocationBoundingBox":{"type":"object","required":["top_left","bottom_right"],"properties":{"bottom_right":{"$ref":"#/components/schemas/GeoInfo"},"top_left":{"$ref":"#/components/schemas/GeoInfo"}}},"LocationPolygon":{"type":"object","required":["exterior"],"properties":{"exterior":{"type":"array","items":{"$ref":"#/components/schemas/GeoInfo"}},"interior":{"type":"array","items":{"type":"array","items":{"$ref":"#/components/schemas/GeoInfo"}},"nullable":true}}},"LocationRadius":{"type":"object","required":["center","radius"],"properties":{"center":{"$ref":"#/components/schemas/GeoInfo"},"radius":{"type":"number","format":"double"}}},"MatchCondition":{"oneOf":[{"type":"string"},{"type":"integer","format":"int64"}]},"Message":{"type":"object","required":["id","topic_id","sort_order","content","role","deleted","created_at","updated_at","dataset_id"],"properties":{"completion_tokens":{"type":"integer","format":"int32","nullable":true},"content":{"type":"string"},"created_at":{"type":"string","format":"date-time"},"dataset_id":{"type":"string","format":"uuid"},"deleted":{"type":"boolean"},"id":{"type":"string","format":"uuid"},"prompt_tokens":{"type":"integer","format":"int32","nullable":true},"role":{"type":"string"},"sort_order":{"type":"integer","format":"int32"},"topic_id":{"type":"string","format":"uuid"},"updated_at":{"type":"string","format":"date-time"}},"example":{"completion_tokens":300,"content":"Hello, world!","created_at":"2021-01-01T00:00:00","dataset_id":"e3e3e3e3-e3e3-e3e3-e3e3-e3e3e3e3e3e3","deleted":false,"id":"e3e3e3e3-e3e3-e3e3-e3e3-e3e3e3e3e3e3","prompt_tokens":300,"role":"user","sort_order":1,"topic_id":"e3e3e3e3-e3e3-e3e3-e3e3-e3e3e3e3e3e3","updated_at":"2021-01-01T00:00:00"}},"Organization":{"type":"object","required":["id","name","created_at","updated_at"],"properties":{"created_at":{"type":"string","format":"date-time"},"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"registerable":{"type":"boolean","nullable":true},"updated_at":{"type":"string","format":"date-time"}},"example":{"created_at":"2021-01-01T00:00:00","id":"e3e3e3e3-e3e3-e3e3-e3e3-e3e3e3e3e3e3","name":"Trieve","registerable":true,"updated_at":"2021-01-01T00:00:00"}},"OrganizationUsageCount":{"type":"object","required":["id","org_id","dataset_count","user_count","file_storage","message_count","chunk_count"],"properties":{"chunk_count":{"type":"integer","format":"int32"},"dataset_count":{"type":"integer","format":"int32"},"file_storage":{"type":"integer","format":"int64"},"id":{"type":"string","format":"uuid"},"message_count":{"type":"integer","format":"int32"},"org_id":{"type":"string","format":"uuid"},"user_count":{"type":"integer","format":"int32"}},"example":{"chunk_count":1000,"dataset_count":1,"file_storage":512,"id":"e3e3e3e3-e3e3-e3e3-e3e3-e3e3e3e3e3e3","message_count":1000,"org_id":"e3e3e3e3-e3e3-e3e3-e3e3-e3e3e3e3e3e3","user_count":5}},"Range":{"type":"object","properties":{"gt":{"allOf":[{"$ref":"#/components/schemas/RangeCondition"}],"nullable":true},"gte":{"allOf":[{"$ref":"#/components/schemas/RangeCondition"}],"nullable":true},"lt":{"allOf":[{"$ref":"#/components/schemas/RangeCondition"}],"nullable":true},"lte":{"allOf":[{"$ref":"#/components/schemas/RangeCondition"}],"nullable":true}},"example":{"gt":0.0,"gte":0.0,"lt":1.0,"lte":1.0}},"RangeCondition":{"oneOf":[{"type":"number","format":"double"},{"type":"integer","format":"int64"}]},"RecommendChunksRequest":{"type":"object","properties":{"filters":{"allOf":[{"$ref":"#/components/schemas/ChunkFilter"}],"nullable":true},"limit":{"type":"integer","format":"int64","description":"The number of chunks to return. This is the number of chunks which will be returned in the response. The default is 10.","nullable":true,"minimum":0},"negative_chunk_ids":{"type":"array","items":{"type":"string","format":"uuid"},"description":"The ids of the chunks to be used as negative examples for the recommendation. The chunks in this array will be used to filter out similar chunks.","nullable":true},"negative_tracking_ids":{"type":"array","items":{"type":"string"},"description":"The tracking_ids of the chunks to be used as negative examples for the recommendation. The chunks in this array will be used to filter out similar chunks.","nullable":true},"positive_chunk_ids":{"type":"array","items":{"type":"string","format":"uuid"},"description":"The ids of the chunks to be used as positive examples for the recommendation. The chunks in this array will be used to find similar chunks.","nullable":true},"positive_tracking_ids":{"type":"array","items":{"type":"string"},"description":"The tracking_ids of the chunks to be used as positive examples for the recommendation. The chunks in this array will be used to find similar chunks.","nullable":true},"recommend_type":{"type":"string","description":"The type of recommendation to make. This lets you choose whether to recommend based off of `semantic` or `fulltext` similarity. The default is `semantic`.","nullable":true},"slim_chunks":{"type":"boolean","description":"Set slim_chunks to true to avoid returning the content and chunk_html of the chunks. This is useful for when you want to reduce amount of data over the wire for latency improvement (typicall 10-50ms). Default is false.","nullable":true},"strategy":{"type":"string","description":"Strategy to use for recommendations, either \"average_vector\" or \"best_score\". The default is \"average_vector\". The \"average_vector\" strategy will construct a single average vector from the positive and negative samples then use it to perform a pseudo-search. The \"best_score\" strategy is more advanced and navigates the HNSW with a heuristic of picking edges where the point is closer to the positive samples than it is the negatives.","nullable":true}}},"RecommendGroupChunksRequest":{"type":"object","properties":{"filters":{"allOf":[{"$ref":"#/components/schemas/ChunkFilter"}],"nullable":true},"group_size":{"type":"integer","format":"int32","description":"The number of chunks to fetch for each group. This is the number of chunks which will be returned in the response for each group. The default is 3. If this is set to a large number, we recommend setting slim_chunks to true to avoid returning the content and chunk_html of the chunks so as to reduce latency due to content download and serialization.","nullable":true,"minimum":0},"limit":{"type":"integer","format":"int64","description":"The number of groups to return. This is the number of groups which will be returned in the response. The default is 10.","nullable":true,"minimum":0},"negative_group_ids":{"type":"array","items":{"type":"string","format":"uuid"},"description":"The ids of the groups to be used as negative examples for the recommendation. The groups in this array will be used to filter out similar groups.","nullable":true},"negative_group_tracking_ids":{"type":"array","items":{"type":"string"},"description":"The ids of the groups to be used as negative examples for the recommendation. The groups in this array will be used to filter out similar groups.","nullable":true},"positive_group_ids":{"type":"array","items":{"type":"string","format":"uuid"},"description":"The ids of the groups to be used as positive examples for the recommendation. The groups in this array will be used to find similar groups.","nullable":true},"positive_group_tracking_ids":{"type":"array","items":{"type":"string"},"description":"The ids of the groups to be used as positive examples for the recommendation. The groups in this array will be used to find similar groups.","nullable":true},"recommend_type":{"type":"string","description":"The type of recommendation to make. This lets you choose whether to recommend based off of `semantic` or `fulltext` similarity. The default is `semantic`.","nullable":true},"slim_chunks":{"type":"boolean","description":"Set slim_chunks to true to avoid returning the content and chunk_html of the chunks. This is useful for when you want to reduce amount of data over the wire for latency improvement (typicall 10-50ms). Default is false.","nullable":true},"strategy":{"type":"string","description":"Strategy to use for recommendations, either \"average_vector\" or \"best_score\". The default is \"average_vector\". The \"average_vector\" strategy will construct a single average vector from the positive and negative samples then use it to perform a pseudo-search. The \"best_score\" strategy is more advanced and navigates the HNSW with a heuristic of picking edges where the point is closer to the positive samples than it is the negatives.","nullable":true}}},"RegenerateMessageData":{"type":"object","required":["topic_id"],"properties":{"highlight_citations":{"type":"boolean","description":"Whether or not to highlight the citations in the response. If this is set to true or not included, the citations will be highlighted. If this is set to false, the citations will not be highlighted. Default is true.","nullable":true},"highlight_delimiters":{"type":"array","items":{"type":"string"},"description":"The delimiters to use for highlighting the citations. If this is not included, the default delimiters will be used. Default is `[\".\", \"!\", \"?\", \"\\n\", \"\\t\", \",\"]`.","nullable":true},"stream_response":{"type":"boolean","description":"Whether or not to stream the response. If this is set to true or not included, the response will be a stream. If this is set to false, the response will be a normal JSON response. Default is true.","nullable":true},"topic_id":{"type":"string","format":"uuid","description":"The id of the topic to regenerate the last message for."}}},"ReturnQueuedChunk":{"oneOf":[{"$ref":"#/components/schemas/SingleQueuedChunkResponse"},{"$ref":"#/components/schemas/BatchQueuedChunkResponse"}]},"ScoreChunkDTO":{"type":"object","required":["metadata","score"],"properties":{"metadata":{"type":"array","items":{"$ref":"#/components/schemas/ChunkMetadataTypes"}},"score":{"type":"number","format":"double"}},"example":{"metadata":[{"chunk_html":"<p>Some HTML content</p>","content":"Some content","id":"d290f1ee-6c54-4b01-90e6-d701748f0851","link":"https://example.com","metadata":{"key1":"value1","key2":"value2"},"time_stamp":"2021-01-01T00:00:00","weight":0.5}],"score":0.5}},"SearchChunkData":{"type":"object","required":["search_type","query"],"properties":{"content_only":{"type":"boolean","description":"Set content_only to true to only returning the chunk_html of the chunks. This is useful for when you want to reduce amount of data over the wire for latency improvement (typically 10-50ms). Default is false.","nullable":true},"filters":{"allOf":[{"$ref":"#/components/schemas/ChunkFilter"}],"nullable":true},"get_collisions":{"type":"boolean","description":"Set get_collisions to true to get the collisions for each chunk. This will only apply if environment variable COLLISIONS_ENABLED is set to true.","nullable":true},"get_total_pages":{"type":"boolean","description":"Get total page count for the query accounting for the applied filters. Defaults to false, but can be set to true when the latency penalty is acceptable (typically 50-200ms).","nullable":true},"highlight_delimiters":{"type":"array","items":{"type":"string"},"description":"Set highlight_delimiters to a list of strings to use as delimiters for highlighting. If not specified, this defaults to [\"?\", \",\", \".\", \"!\"].","nullable":true},"highlight_results":{"type":"boolean","description":"Set highlight_results to false for a slight latency improvement (1-10ms). If not specified, this defaults to true. This will add `<b><mark>` tags to the chunk_html of the chunks to highlight matching sub-sentences.","nullable":true},"highlight_threshold":{"type":"number","format":"double","description":"Set highlight_threshold to a lower or higher value to adjust the sensitivity of the highlights applied to the chunk html. If not specified, this defaults to 0.8. The range is 0.0 to 1.0.","nullable":true},"page":{"type":"integer","format":"int64","description":"Page of chunks to fetch. Page is 1-indexed.","nullable":true,"minimum":0},"page_size":{"type":"integer","format":"int64","description":"Page size is the number of chunks to fetch. This can be used to fetch more than 10 chunks at a time.","nullable":true,"minimum":0},"query":{"type":"string","description":"Query is the search query. This can be any string. The query will be used to create an embedding vector and/or SPLADE vector which will be used to find the result set."},"recency_bias":{"type":"number","format":"float","description":"Recency Bias lets you determine how much of an effect the recency of chunks will have on the search results. If not specified, this defaults to 0.0. We recommend setting this to 1.0 for a gentle reranking of the results, >3.0 for a strong reranking of the results.","nullable":true},"score_threshold":{"type":"number","format":"float","description":"Set score_threshold to a float to filter out chunks with a score below the threshold.","nullable":true},"search_type":{"type":"string","description":"Can be either \"semantic\", \"fulltext\", or \"hybrid\". If specified as \"hybrid\", it will pull in one page (10 chunks) of both semantic and full-text results then re-rank them using BAAI/bge-reranker-large. \"semantic\" will pull in one page (10 chunks) of the nearest cosine distant vectors. \"fulltext\" will pull in one page (10 chunks) of full-text results based on SPLADE."},"slim_chunks":{"type":"boolean","description":"Set slim_chunks to true to avoid returning the content and chunk_html of the chunks. This is useful for when you want to reduce amount of data over the wire for latency improvement (typically 10-50ms). Default is false.","nullable":true},"tag_weights":{"type":"object","description":"Tag weights is a JSON object which can be used to boost the ranking of chunks with certain tags. This is useful for when you want to be able to bias towards chunks with a certain tag on the fly. The keys are the tag names and the values are the weights.","additionalProperties":{"type":"number","format":"float"},"nullable":true},"use_weights":{"type":"boolean","description":"Set use_weights to true to use the weights of the chunks in the result set in order to sort them. If not specified, this defaults to true.","nullable":true}},"example":{"date_bias":true,"filters":{"must":[{"field":"metadata.key2","match":["value3","value4"],"range":{"gt":0.0,"gte":0.0,"lt":1.0,"lte":1.0}}],"must_not":[{"field":"metadata.key3","match":["value5","value6"],"range":{"gt":0.0,"gte":0.0,"lt":1.0,"lte":1.0}}],"should":[{"field":"metadata.key1","match":["value1","value2"],"range":{"gt":0.0,"gte":0.0,"lt":1.0,"lte":1.0}}]},"get_collisions":true,"highlight_delimiters":["?",",",".","!"],"highlight_results":true,"page":1,"page_size":10,"query":"Some search query","score_threshold":0.5,"search_type":"semantic","use_weights":true}},"SearchChunkQueryResponseBody":{"type":"object","required":["score_chunks","total_chunk_pages"],"properties":{"score_chunks":{"type":"array","items":{"$ref":"#/components/schemas/ScoreChunkDTO"}},"total_chunk_pages":{"type":"integer","format":"int64"}}},"SearchOverGroupsData":{"type":"object","required":["search_type","query"],"properties":{"filters":{"allOf":[{"$ref":"#/components/schemas/ChunkFilter"}],"nullable":true},"get_collisions":{"type":"boolean","description":"Set get_collisions to true to get the collisions for each chunk. This will only apply if environment variable COLLISIONS_ENABLED is set to true.","nullable":true},"get_total_pages":{"type":"boolean","description":"Get total page count for the query accounting for the applied filters. Defaults to false, but can be set to true when the latency penalty is acceptable (typically 50-200ms).","nullable":true},"group_size":{"type":"integer","format":"int32","description":"Group_size is the number of chunks to fetch for each group. The default is 3. If a group has less than group_size chunks, all chunks will be returned. If this is set to a large number, we recommend setting slim_chunks to true to avoid returning the content and chunk_html of the chunks so as to lower the amount of time required for content download and serialization.","nullable":true,"minimum":0},"highlight_delimiters":{"type":"array","items":{"type":"string"},"description":"Set highlight_delimiters to a list of strings to use as delimiters for highlighting. If not specified, this defaults to [\"?\", \",\", \".\", \"!\"].","nullable":true},"highlight_results":{"type":"boolean","description":"Set highlight_results to false for a slight latency improvement (1-10ms). If not specified, this defaults to true. This will add `<b><mark>` tags to the chunk_html of the chunks to highlight matching sub-sentences.","nullable":true},"highlight_threshold":{"type":"number","format":"double","description":"Set highlight_threshold to a lower or higher value to adjust the sensitivity of the highlights applied to the chunk html. If not specified, this defaults to 0.8. The range is 0.0 to 1.0.","nullable":true},"page":{"type":"integer","format":"int64","description":"Page of group results to fetch. Page is 1-indexed.","nullable":true,"minimum":0},"page_size":{"type":"integer","format":"int32","description":"Page size is the number of group results to fetch. The default is 10.","nullable":true,"minimum":0},"query":{"type":"string","description":"Query is the search query. This can be any string. The query will be used to create an embedding vector and/or SPLADE vector which will be used to find the result set."},"score_threshold":{"type":"number","format":"float","description":"Set score_threshold to a float to filter out chunks with a score below the threshold.","nullable":true},"search_type":{"type":"string","description":"Can be either \"semantic\", \"fulltext\", or \"hybrid\". \"hybrid\" will pull in one page (10 chunks) of both semantic and full-text results then re-rank them using BAAI/bge-reranker-large. \"semantic\" will pull in one page (10 chunks) of the nearest cosine distant vectors. \"fulltext\" will pull in one page (10 chunks) of full-text results based on SPLADE."},"slim_chunks":{"type":"boolean","description":"Set slim_chunks to true to avoid returning the content and chunk_html of the chunks. This is useful for when you want to reduce amount of data over the wire for latency improvement (typicall 10-50ms). Default is false.","nullable":true}}},"SearchOverGroupsResults":{"type":"object","required":["group_chunks","total_chunk_pages"],"properties":{"group_chunks":{"type":"array","items":{"$ref":"#/components/schemas/GroupScoreChunk"}},"total_chunk_pages":{"type":"integer","format":"int64"}}},"SearchWithinGroupData":{"type":"object","required":["query","search_type"],"properties":{"filters":{"allOf":[{"$ref":"#/components/schemas/ChunkFilter"}],"nullable":true},"get_total_pages":{"type":"boolean","description":"Get total page count for the query accounting for the applied filters. Defaults to false, but can be set to true when the latency penalty is acceptable (typically 50-200ms).","nullable":true},"group_id":{"type":"string","format":"uuid","description":"Group specifies the group to search within. Results will only consist of chunks which are bookmarks within the specified group.","nullable":true},"group_tracking_id":{"type":"string","description":"Group_tracking_id specifies the group to search within by tracking id. Results will only consist of chunks which are bookmarks within the specified group. If both group_id and group_tracking_id are provided, group_id will be used.","nullable":true},"highlight_delimiters":{"type":"array","items":{"type":"string"},"description":"Set highlight_delimiters to a list of strings to use as delimiters for highlighting. If not specified, this defaults to [\"?\", \",\", \".\", \"!\"].","nullable":true},"highlight_results":{"type":"boolean","description":"Set highlight_results to false for a slight latency improvement (1-10ms). If not specified, this defaults to true. This will add `<b><mark>` tags to the chunk_html of the chunks to highlight matching sub-sentences.","nullable":true},"highlight_threshold":{"type":"number","format":"double","description":"Set highlight_threshold to a lower or higher value to adjust the sensitivity of the highlights applied to the chunk html. If not specified, this defaults to 0.8. The range is 0.0 to 1.0.","nullable":true},"page":{"type":"integer","format":"int64","description":"The page of chunks to fetch. Page is 1-indexed.","nullable":true,"minimum":0},"page_size":{"type":"integer","format":"int64","description":"The page size is the number of chunks to fetch. This can be used to fetch more than 10 chunks at a time.","nullable":true,"minimum":0},"query":{"type":"string","description":"The query is the search query. This can be any string. The query will be used to create an embedding vector and/or SPLADE vector which will be used to find the result set."},"recency_bias":{"type":"number","format":"float","description":"Recency Bias lets you determine how much of an effect the recency of chunks will have on the search results. If not specified, this defaults to 0.0.","nullable":true},"score_threshold":{"type":"number","format":"float","description":"Set score_threshold to a float to filter out chunks with a score below the threshold.","nullable":true},"search_type":{"type":"string","description":"Search_type can be either \"semantic\", \"fulltext\", or \"hybrid\". \"hybrid\" will pull in one page (10 chunks) of both semantic and full-text results then re-rank them using BAAI/bge-reranker-large. \"semantic\" will pull in one page (10 chunks) of the nearest cosine distant vectors. \"fulltext\" will pull in one page (10 chunks) of full-text results based on SPLADE."},"slim_chunks":{"type":"boolean","description":"Set slim_chunks to true to avoid returning the content and chunk_html of the chunks. This is useful for when you want to reduce amount of data over the wire for latency improvement (typicall 10-50ms). Default is false.","nullable":true},"tag_weights":{"type":"object","description":"Tag weights is a JSON object which can be used to boost the ranking of chunks with certain tags. This is useful for when you want to be able to bias towards chunks with a certain tag on the fly. The keys are the tag names and the values are the weights.","additionalProperties":{"type":"number","format":"float"},"nullable":true},"use_weights":{"type":"boolean","description":"Set use_weights to true to use the weights of the chunks in the result set in order to sort them. If not specified, this defaults to true.","nullable":true}}},"SearchWithinGroupResults":{"type":"object","required":["bookmarks","group","total_pages"],"properties":{"bookmarks":{"type":"array","items":{"$ref":"#/components/schemas/ScoreChunkDTO"}},"group":{"$ref":"#/components/schemas/ChunkGroup"},"total_pages":{"type":"integer","format":"int64"}}},"SetUserApiKeyRequest":{"type":"object","required":["name","role"],"properties":{"name":{"type":"string","description":"The name which will be assigned to the new api key."},"role":{"type":"integer","format":"int32","description":"The role which will be assigned to the new api key. Either 0 (read), 1 (read and write at the level of the currently auth'ed user). The auth'ed user must have a role greater than or equal to the role being assigned which means they must be an admin (1) or owner (2) of the organization to assign write permissions with a role of 1."}}},"SetUserApiKeyResponse":{"type":"object","required":["api_key"],"properties":{"api_key":{"type":"string","description":"The api key which was created. This is the value which should be used in the Authorization header."}}},"SingleQueuedChunkResponse":{"type":"object","required":["chunk_metadata","pos_in_queue"],"properties":{"chunk_metadata":{"$ref":"#/components/schemas/ChunkMetadata"},"pos_in_queue":{"type":"integer","format":"int32","description":"The current position the last access item is in the queue"}},"example":{"chunk_metadata":[{"chunk_vector":[0.1,0.2,0.3],"content":"Some content","file_id":"d290f1ee-6c54-4b01-90e6-d701748f0851","link":"https://example.com","metadata":{"key1":"value1","key2":"value2"},"tag_set":["tag1","tag2"],"time_stamp":"2021-01-01T00:00:00","tracking_id":"tracking_id","weight":0.5}],"pos_in_queue":1}},"SlimChunkMetadata":{"type":"object","required":["id","created_at","updated_at","dataset_id","weight"],"properties":{"created_at":{"type":"string","format":"date-time"},"dataset_id":{"type":"string","format":"uuid"},"id":{"type":"string","format":"uuid"},"image_urls":{"type":"array","items":{"type":"string","nullable":true},"nullable":true},"link":{"type":"string","nullable":true},"location":{"allOf":[{"$ref":"#/components/schemas/GeoInfo"}],"nullable":true},"metadata":{"nullable":true},"qdrant_point_id":{"type":"string","format":"uuid","nullable":true},"tag_set":{"type":"string","nullable":true},"time_stamp":{"type":"string","format":"date-time","nullable":true},"tracking_id":{"type":"string","nullable":true},"updated_at":{"type":"string","format":"date-time"},"weight":{"type":"number","format":"double"}},"example":{"created_at":"2021-01-01T00:00:00","dataset_id":"e3e3e3e3-e3e3-e3e3-e3e3-e3e3e3e3e3e3","id":"e3e3e3e3-e3e3-e3e3-e3e3-e3e3e3e3e3e3","link":"https://trieve.ai","metadata":{"key":"value"},"qdrant_point_id":"e3e3e3e3-e3e3-e3e3-e3e3-e3e3e3e3e3e3","tag_set":"tag1,tag2","time_stamp":"2021-01-01T00:00:00","tracking_id":"e3e3e3e3-e3e3-e3e3-e3e3-e3e3e3e3e3e3","updated_at":"2021-01-01T00:00:00","weight":0.5}},"SlimChunkMetadataWithScore":{"type":"object","required":["id","created_at","updated_at","weight","score"],"properties":{"created_at":{"type":"string","format":"date-time"},"id":{"type":"string","format":"uuid"},"link":{"type":"string","nullable":true},"metadata":{"nullable":true},"qdrant_point_id":{"type":"string","format":"uuid","nullable":true},"score":{"type":"number","format":"float"},"tag_set":{"type":"string","nullable":true},"time_stamp":{"type":"string","format":"date-time","nullable":true},"tracking_id":{"type":"string","nullable":true},"updated_at":{"type":"string","format":"date-time"},"weight":{"type":"number","format":"double"}},"example":{"created_at":"2021-01-01T00:00:00","dataset_id":"e3e3e3e3-e3e3-e3e3-e3e3-e3e3e3e3e3e3","id":"e3e3e3e3-e3e3-e3e3-e3e3-e3e3e3e3e3e3","link":"https://trieve.ai","metadata":{"key":"value"},"qdrant_point_id":"e3e3e3e3-e3e3-e3e3-e3e3-e3e3e3e3e3e3","score":0.9,"tag_set":"tag1,tag2","time_stamp":"2021-01-01T00:00:00","tracking_id":"e3e3e3e3-e3e3-e3e3-e3e3-e3e3e3e3e3e3","updated_at":"2021-01-01T00:00:00","weight":0.5}},"SlimGroup":{"type":"object","required":["id","name","dataset_id","of_current_dataset"],"properties":{"dataset_id":{"type":"string","format":"uuid"},"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"of_current_dataset":{"type":"boolean"}},"example":{"dataset_id":"e3e3e3e3-e3e3-e3e3-e3e3-e3e3e3e3e3e3","id":"e3e3e3e3-e3e3-e3e3-e3e3-e3e3e3e3e3e3","name":"Trieve","of_current_dataset":true}},"SlimUser":{"type":"object","required":["id","email","user_orgs","orgs"],"properties":{"email":{"type":"string"},"id":{"type":"string","format":"uuid"},"name":{"type":"string","nullable":true},"orgs":{"type":"array","items":{"$ref":"#/components/schemas/Organization"}},"user_orgs":{"type":"array","items":{"$ref":"#/components/schemas/UserOrganization"}}},"example":{"email":"developers@trieve.ai","id":"e3e3e3e3-e3e3-e3e3-e3e3-e3e3e3e3e3e3","name":"Trieve","orgs":[{"created_at":"2021-01-01T00:00:00","id":"e3e3e3e3-e3e3-e3e3-e3e3-e3e3e3e3e3e3","name":"Trieve","registerable":true,"updated_at":"2021-01-01T00:00:00"}],"user_orgs":[{"created_at":"2021-01-01T00:00:00","id":"e3e3e3e3-e3e3-e3e3-e3e3-e3e3e3e3e3e3","org_id":"e3e3e3e3-e3e3-e3e3-e3e3-e3e3e3e3e3e3","role":0,"updated_at":"2021-01-01T00:00:00","user_id":"e3e3e3e3-e3e3-e3e3-e3e3-e3e3e3e3e3e3"}]}},"StripePlan":{"type":"object","required":["id","stripe_id","chunk_count","file_storage","user_count","dataset_count","message_count","amount","created_at","updated_at","name"],"properties":{"amount":{"type":"integer","format":"int64"},"chunk_count":{"type":"integer","format":"int32"},"created_at":{"type":"string","format":"date-time"},"dataset_count":{"type":"integer","format":"int32"},"file_storage":{"type":"integer","format":"int64"},"id":{"type":"string","format":"uuid"},"message_count":{"type":"integer","format":"int32"},"name":{"type":"string"},"stripe_id":{"type":"string"},"updated_at":{"type":"string","format":"date-time"},"user_count":{"type":"integer","format":"int32"}},"example":{"amount":1000,"chunk_count":1000,"created_at":"2021-01-01T00:00:00","dataset_count":1,"file_storage":512,"id":"e3e3e3e3-e3e3-e3e3-e3e3-e3e3e3e3e3e3","message_count":1000,"name":"Free","stripe_id":"plan_123","updated_at":"2021-01-01T00:00:00","user_count":5}},"SuggestedQueriesRequest":{"type":"object","required":["query"],"properties":{"query":{"type":"string","description":"The query to base the generated suggested queries off of."}}},"SuggestedQueriesResponse":{"type":"object","required":["queries"],"properties":{"queries":{"type":"array","items":{"type":"string"}}}},"Topic":{"type":"object","required":["id","name","deleted","created_at","updated_at","dataset_id","owner_id"],"properties":{"created_at":{"type":"string","format":"date-time"},"dataset_id":{"type":"string","format":"uuid"},"deleted":{"type":"boolean"},"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"owner_id":{"type":"string"},"updated_at":{"type":"string","format":"date-time"}},"example":{"created_at":"2021-01-01T00:00:00","dataset_id":"e3e3e3e3-e3e3-e3e3-e3e3-e3e3e3e3e3e3","deleted":false,"id":"e3e3e3e3-e3e3-e3e3-e3e3-e3e3e3e3e3e3","name":"Trieve","owner_id":"e3e3e3e3-e3e3-e3e3-e3e3-e3e3e3e3e3e3","updated_at":"2021-01-01T00:00:00"}},"UpdateChunkByTrackingIdData":{"type":"object","required":["tracking_id"],"properties":{"chunk_html":{"type":"string","description":"HTML content of the chunk you want to update. This can also be plaintext. The innerText of the HTML will be used to create the embedding vector. The point of using HTML is for convienience, as some users have applications where users submit HTML content. If no chunk_html is provided, the existing chunk_html will be used.","nullable":true},"convert_html_to_text":{"type":"boolean","description":"Convert HTML to raw text before processing to avoid adding noise to the vector embeddings. By default this is true. If you are using HTML content that you want to be included in the vector embeddings, set this to false.","nullable":true},"group_ids":{"type":"array","items":{"type":"string","format":"uuid"},"description":"Group ids are the ids of the groups that the chunk should be placed into. This is useful for when you want to update a chunk and add it to a group or multiple groups in one request.","nullable":true},"group_tracking_ids":{"type":"array","items":{"type":"string"},"description":"Group tracking_ids are the tracking_ids of the groups that the chunk should be placed into. This is useful for when you want to update a chunk and add it to a group or multiple groups in one request.","nullable":true},"link":{"type":"string","description":"Link of the chunk you want to update. This can also be any string. Frequently, this is a link to the source of the chunk. The link value will not affect the embedding creation. If no link is provided, the existing link will be used.","nullable":true},"metadata":{"description":"The metadata is a JSON object which can be used to filter chunks. This is useful for when you want to filter chunks by arbitrary metadata. Unlike with tag filtering, there is a performance hit for filtering on metadata. If no metadata is provided, the existing metadata will be used.","nullable":true},"time_stamp":{"type":"string","description":"Time_stamp should be an ISO 8601 combined date and time without timezone. It is used for time window filtering and recency-biasing search results. If no time_stamp is provided, the existing time_stamp will be used.","nullable":true},"tracking_id":{"type":"string","description":"Tracking_id of the chunk you want to update. This is required to match an existing chunk."},"weight":{"type":"number","format":"double","description":"Weight is a float which can be used to bias search results. This is useful for when you want to bias search results for a chunk. The magnitude only matters relative to other chunks in the chunk's dataset dataset. If no weight is provided, the existing weight will be used.","nullable":true}}},"UpdateChunkData":{"type":"object","properties":{"chunk_html":{"type":"string","description":"HTML content of the chunk you want to update. This can also be plaintext. The innerText of the HTML will be used to create the embedding vector. The point of using HTML is for convienience, as some users have applications where users submit HTML content. If no chunk_html is provided, the existing chunk_html will be used.","nullable":true},"chunk_id":{"type":"string","format":"uuid","description":"Id of the chunk you want to update. You can provide either the chunk_id or the tracking_id. If both are provided, the chunk_id will be used.","nullable":true},"convert_html_to_text":{"type":"boolean","description":"Convert HTML to raw text before processing to avoid adding noise to the vector embeddings. By default this is true. If you are using HTML content that you want to be included in the vector embeddings, set this to false.","nullable":true},"group_ids":{"type":"array","items":{"type":"string","format":"uuid"},"description":"Group ids are the ids of the groups that the chunk should be placed into. This is useful for when you want to update a chunk and add it to a group or multiple groups in one request.","nullable":true},"group_tracking_ids":{"type":"array","items":{"type":"string"},"description":"Group tracking_ids are the tracking_ids of the groups that the chunk should be placed into. This is useful for when you want to update a chunk and add it to a group or multiple groups in one request.","nullable":true},"image_urls":{"type":"array","items":{"type":"string"},"description":"Image urls are a list of urls to images that are associated with the chunk. This is useful for when you want to associate images with a chunk. If no image_urls are provided, the existing image_urls will be used.","nullable":true},"link":{"type":"string","description":"Link of the chunk you want to update. This can also be any string. Frequently, this is a link to the source of the chunk. The link value will not affect the embedding creation. If no link is provided, the existing link will be used.","nullable":true},"location":{"allOf":[{"$ref":"#/components/schemas/GeoInfo"}],"nullable":true},"metadata":{"description":"The metadata is a JSON object which can be used to filter chunks. This is useful for when you want to filter chunks by arbitrary metadata. Unlike with tag filtering, there is a performance hit for filtering on metadata. If no metadata is provided, the existing metadata will be used.","nullable":true},"tag_set":{"type":"array","items":{"type":"string"},"description":"Tag set is a list of tags. This can be used to filter chunks by tag. Unlike with metadata filtering, HNSW indices will exist for each tag such that there is not a performance hit for filtering on them. If no tag_set is provided, the existing tag_set will be used.","nullable":true},"time_stamp":{"type":"string","description":"Time_stamp should be an ISO 8601 combined date and time without timezone. It is used for time window filtering and recency-biasing search results. If no time_stamp is provided, the existing time_stamp will be used.","nullable":true},"tracking_id":{"type":"string","description":"Tracking_id of the chunk you want to update. This is required to match an existing chunk.","nullable":true},"weight":{"type":"number","format":"double","description":"Weight is a float which can be used to bias search results. This is useful for when you want to bias search results for a chunk. The magnitude only matters relative to other chunks in the chunk's dataset dataset. If no weight is provided, the existing weight will be used.","nullable":true}},"example":{"chunk_html":"<p>Some HTML content</p>","chunk_id":"d290f1ee-6c54-4b01-90e6-d701748f0851","group_ids":["d290f1ee-6c54-4b01-90e6-d701748f0851"],"link":"https://example.com","metadata":{"key1":"value1","key2":"value2"},"time_stamp":"2021-01-01T00:00:00","weight":0.5}},"UpdateChunkGroupData":{"type":"object","properties":{"description":{"type":"string","description":"Description to assign to the chunk_group. Convenience field for you to avoid having to remember what the group is for. If not provided, the description will not be updated.","nullable":true},"group_id":{"type":"string","format":"uuid","description":"Id of the chunk_group to update.","nullable":true},"metadata":{"description":"Optional metadata to assign to the chunk_group. This is a JSON object that can store any additional information you want to associate with the chunks inside of the chunk_group.","nullable":true},"name":{"type":"string","description":"Name to assign to the chunk_group. Does not need to be unique. If not provided, the name will not be updated.","nullable":true},"tag_set":{"type":"array","items":{"type":"string"},"description":"Optional tags to assign to the chunk_group. This is a list of strings that can be used to categorize the chunks inside the chunk_group.","nullable":true},"tracking_id":{"type":"string","description":"Tracking Id of the chunk_group to update.","nullable":true}}},"UpdateDatasetRequest":{"type":"object","properties":{"client_configuration":{"description":"The new client configuration of the dataset, can be arbitrary JSON. See docs.trieve.ai for more information. If not provided, the client configuration will not be updated.","nullable":true},"dataset_id":{"type":"string","format":"uuid","description":"The id of the dataset you want to update.","nullable":true},"dataset_name":{"type":"string","description":"The new name of the dataset. Must be unique within the organization. If not provided, the name will not be updated.","nullable":true},"server_configuration":{"description":"The new server configuration of the dataset, can be arbitrary JSON. See docs.trieve.ai for more information. If not provided, the server configuration will not be updated.","nullable":true},"tracking_id":{"type":"string","description":"tracking ID for the dataset. Can be used to track the dataset in external systems.","nullable":true}},"example":{"client_configuration":{},"dataset_id":"00000000-0000-0000-0000-000000000000","dataset_name":"My Dataset","server_configuration":{}}},"UpdateGroupByTrackingIDData":{"type":"object","required":["tracking_id"],"properties":{"description":{"type":"string","description":"Description to assign to the chunk_group. Convenience field for you to avoid having to remember what the group is for. If not provided, the description will not be updated.","nullable":true},"metadata":{"description":"Optional metadata to assign to the chunk_group. This is a JSON object that can store any additional information you want to associate with the chunks inside of the chunk_group.","nullable":true},"name":{"type":"string","description":"Name to assign to the chunk_group. Does not need to be unique. If not provided, the name will not be updated.","nullable":true},"tag_set":{"type":"array","items":{"type":"string"},"description":"Optional tags to assign to the chunk_group. This is a list of strings that can be used to categorize the chunks inside the chunk_group.","nullable":true},"tracking_id":{"type":"string","description":"Tracking Id of the chunk_group to update."}}},"UpdateOrganizationData":{"type":"object","required":["organization_id"],"properties":{"name":{"type":"string","description":"The new name of the organization. If not provided, the name will not be updated.","nullable":true},"organization_id":{"type":"string","format":"uuid","description":"The id of the organization to update."}}},"UpdateTopicData":{"type":"object","required":["topic_id","name"],"properties":{"name":{"type":"string","description":"The new name of the topic. A name is not generated from this field, it is used as-is."},"topic_id":{"type":"string","format":"uuid","description":"The id of the topic to target."}}},"UpdateUserOrgRoleData":{"type":"object","required":["organization_id","role"],"properties":{"organization_id":{"type":"string","format":"uuid","description":"The id of the organization to update the user for."},"role":{"type":"integer","format":"int32","description":"Either 0 (user), 1 (admin), or 2 (owner). If not provided, the current role will be used. The auth'ed user must have a role greater than or equal to the role being assigned."},"user_id":{"type":"string","format":"uuid","description":"The id of the user to update, if not provided, the auth'ed user will be updated. If provided, the auth'ed user must be an admin (1) or owner (2) of the organization.","nullable":true}}},"UploadFileData":{"type":"object","required":["base64_file","file_name"],"properties":{"base64_file":{"type":"string","description":"Base64 encoded file. Convert + to -, / to _, and remove the ending = if present. This is the standard base64url encoding."},"create_chunks":{"type":"boolean","description":"Create chunks is a boolean which determines whether or not to create chunks from the file. If false, you can manually chunk the file and send the chunks to the create_chunk endpoint with the file_id to associate chunks with the file. Meant mostly for advanced users.","nullable":true},"description":{"type":"string","description":"Description is an optional convience field so you do not have to remember what the file contains or is about. It will be included on the group resulting from the file which will hold its chunk.","nullable":true},"file_name":{"type":"string","description":"Name of the file being uploaded, including the extension."},"group_tracking_id":{"type":"string","description":"Group tracking id is an optional field which allows you to specify the tracking id of the group that is created from the file. Chunks created will be created with the tracking id of `group_tracking_id|<index of chunk>`","nullable":true},"link":{"type":"string","description":"Link to the file. This can also be any string. This can be used to filter when searching for the file's resulting chunks. The link value will not affect embedding creation.","nullable":true},"metadata":{"description":"Metadata is a JSON object which can be used to filter chunks. This is useful for when you want to filter chunks by arbitrary metadata. Unlike with tag filtering, there is a performance hit for filtering on metadata. Will be passed down to the file's chunks.","nullable":true},"tag_set":{"type":"array","items":{"type":"string"},"description":"Tag set is a comma separated list of tags which will be passed down to the chunks made from the file. Tags are used to filter chunks when searching. HNSW indices are created for each tag such that there is no performance loss when filtering on them.","nullable":true},"time_stamp":{"type":"string","description":"Time stamp should be an ISO 8601 combined date and time without timezone. Time_stamp is used for time window filtering and recency-biasing search results. Will be passed down to the file's chunks.","nullable":true}},"example":{"base64_file":"base64_encoded_file","create_chunks":true,"description":"This is an example file","file_mime_type":"application/pdf","file_name":"example.pdf","link":"https://example.com","metadata":{"key1":"value1","key2":"value2"},"tag_set":["tag1","tag2"],"time_stamp":"2021-01-01T00:00:00Z"}},"UploadFileResult":{"type":"object","required":["file_metadata"],"properties":{"file_metadata":{"$ref":"#/components/schemas/File"}}},"UserOrganization":{"type":"object","required":["id","user_id","organization_id","role","created_at","updated_at"],"properties":{"created_at":{"type":"string","format":"date-time"},"id":{"type":"string","format":"uuid"},"organization_id":{"type":"string","format":"uuid"},"role":{"type":"integer","format":"int32"},"updated_at":{"type":"string","format":"date-time"},"user_id":{"type":"string","format":"uuid"}},"example":{"created_at":"2021-01-01T00:00:00","id":"e3e3e3e3-e3e3-e3e3-e3e3-e3e3e3e3e3e3","organization_id":"e3e3e3e3-e3e3-e3e3-e3e3-e3e3e3e3e3e3","role":2,"updated_at":"2021-01-01T00:00:00","user_id":"e3e3e3e3-e3e3-e3e3-e3e3-e3e3e3e3e3e3"}}},"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"Authorization"}}},"tags":[{"name":"invitation","description":"Invitation endpoint. Exists to invite users to an organization."},{"name":"auth","description":"Authentication endpoint. Serves to register and authenticate users."},{"name":"user","description":"User endpoint. Enables you to modify user roles and information."},{"name":"organization","description":"Organization endpoint. Enables you to modify organization roles and information."},{"name":"dataset","description":"Dataset endpoint. Datasets belong to organizations and hold configuration information for both client and server. Datasets contain chunks and chunk groups."},{"name":"chunk","description":"Chunk endpoint. Think of chunks as individual searchable units of information. The majority of your integration will likely be with the Chunk endpoint."},{"name":"chunk_group","description":"Chunk groups endpoint. Think of a chunk_group as a bookmark folder within the dataset."},{"name":"file","description":"File endpoint. When files are uploaded, they are stored in S3 and broken up into chunks with text extraction from Apache Tika. You can upload files of pretty much any type up to 1GB in size. See chunking algorithm details at `docs.trieve.ai` for more information on how chunking works. Improved default chunking is on our roadmap."},{"name":"events","description":"Notifications endpoint. Files are uploaded asynchronously and events are sent to the user when the upload is complete."},{"name":"topic","description":"Topic chat endpoint. Think of topics as the storage system for gen-ai chat memory. Gen AI messages belong to topics."},{"name":"message","description":"Message chat endpoint. Messages are units belonging to a topic in the context of a chat with a LLM. There are system, user, and assistant messages."},{"name":"stripe","description":"Stripe endpoint. Used for the managed SaaS version of this app. Eventually this will become a micro-service. Reach out to the team using contact info found at `docs.trieve.ai` for more information."},{"name":"health","description":"Health check endpoint. Used to check if the server is up and running."}]}