Skip to content

Commit

Permalink
feature: update to version 0.8.5
Browse files Browse the repository at this point in the history
  • Loading branch information
skeptrunedev committed May 17, 2024
1 parent a8c38b9 commit 5e4ffb0
Show file tree
Hide file tree
Showing 137 changed files with 1,672 additions and 8,026 deletions.
22 changes: 12 additions & 10 deletions .openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ docs/AddChunkToGroupData.md
docs/ApiKeyDTO.md
docs/AuthApi.md
docs/AuthQuery.md
docs/AutocompleteData.md
docs/BatchQueuedChunkResponse.md
docs/BookmarkData.md
docs/BookmarkGroupResult.md
Expand All @@ -18,8 +19,10 @@ docs/ChunkGroup.md
docs/ChunkGroupAndFile.md
docs/ChunkGroupApi.md
docs/ChunkMetadata.md
docs/ChunkMetadataTypes.md
docs/ChunkMetadataWithScore.md
docs/ClientDatasetConfiguration.md
docs/ContentChunkMetadata.md
docs/CreateChunkData.md
docs/CreateChunkGroupData.md
docs/CreateDatasetRequest.md
Expand All @@ -31,6 +34,7 @@ docs/DatasetAndUsage.md
docs/DatasetApi.md
docs/DatasetDTO.md
docs/DatasetUsageCount.md
docs/DateRange.md
docs/DeleteTopicData.md
docs/DeleteUserApiKeyRequest.md
docs/EditMessageData.md
Expand All @@ -51,7 +55,6 @@ docs/GetGroupsForChunksData.md
docs/GetTrackingChunksData.md
docs/GroupData.md
docs/GroupScoreChunk.md
docs/GroupScoreSlimChunks.md
docs/HealthApi.md
docs/InvitationApi.md
docs/InvitationData.md
Expand All @@ -71,16 +74,12 @@ docs/RecommendGroupChunksRequest.md
docs/RegenerateMessageData.md
docs/ReturnQueuedChunk.md
docs/ScoreChunkDTO.md
docs/ScoreSlimChunks.md
docs/SearchChunkData.md
docs/SearchChunkQueryResponseBody.md
docs/SearchOverGroupsData.md
docs/SearchOverGroupsResults.md
docs/SearchOverGroupsSlimResults.md
docs/SearchSlimChunkQueryResponseBody.md
docs/SearchWithinGroupData.md
docs/SearchWithinGroupResults.md
docs/SearchWithinGroupSlimResults.md
docs/SetUserApiKeyRequest.md
docs/SetUserApiKeyResponse.md
docs/SingleQueuedChunkResponse.md
Expand Down Expand Up @@ -113,6 +112,10 @@ setup.cfg
setup.py
test-requirements.txt
test/__init__.py
test/test_autocomplete_data.py
test/test_chunk_metadata_types.py
test/test_content_chunk_metadata.py
test/test_date_range.py
tox.ini
trieve_py_client/__init__.py
trieve_py_client/api/__init__.py
Expand All @@ -137,6 +140,7 @@ trieve_py_client/models/__init__.py
trieve_py_client/models/add_chunk_to_group_data.py
trieve_py_client/models/api_key_dto.py
trieve_py_client/models/auth_query.py
trieve_py_client/models/autocomplete_data.py
trieve_py_client/models/batch_queued_chunk_response.py
trieve_py_client/models/bookmark_data.py
trieve_py_client/models/bookmark_group_result.py
Expand All @@ -146,8 +150,10 @@ trieve_py_client/models/chunk_filter.py
trieve_py_client/models/chunk_group.py
trieve_py_client/models/chunk_group_and_file.py
trieve_py_client/models/chunk_metadata.py
trieve_py_client/models/chunk_metadata_types.py
trieve_py_client/models/chunk_metadata_with_score.py
trieve_py_client/models/client_dataset_configuration.py
trieve_py_client/models/content_chunk_metadata.py
trieve_py_client/models/create_chunk_data.py
trieve_py_client/models/create_chunk_group_data.py
trieve_py_client/models/create_dataset_request.py
Expand All @@ -158,6 +164,7 @@ trieve_py_client/models/dataset.py
trieve_py_client/models/dataset_and_usage.py
trieve_py_client/models/dataset_dto.py
trieve_py_client/models/dataset_usage_count.py
trieve_py_client/models/date_range.py
trieve_py_client/models/delete_topic_data.py
trieve_py_client/models/delete_user_api_key_request.py
trieve_py_client/models/edit_message_data.py
Expand All @@ -176,7 +183,6 @@ trieve_py_client/models/get_groups_for_chunks_data.py
trieve_py_client/models/get_tracking_chunks_data.py
trieve_py_client/models/group_data.py
trieve_py_client/models/group_score_chunk.py
trieve_py_client/models/group_score_slim_chunks.py
trieve_py_client/models/invitation_data.py
trieve_py_client/models/location_bounding_box.py
trieve_py_client/models/location_polygon.py
Expand All @@ -192,16 +198,12 @@ trieve_py_client/models/recommend_group_chunks_request.py
trieve_py_client/models/regenerate_message_data.py
trieve_py_client/models/return_queued_chunk.py
trieve_py_client/models/score_chunk_dto.py
trieve_py_client/models/score_slim_chunks.py
trieve_py_client/models/search_chunk_data.py
trieve_py_client/models/search_chunk_query_response_body.py
trieve_py_client/models/search_over_groups_data.py
trieve_py_client/models/search_over_groups_results.py
trieve_py_client/models/search_over_groups_slim_results.py
trieve_py_client/models/search_slim_chunk_query_response_body.py
trieve_py_client/models/search_within_group_data.py
trieve_py_client/models/search_within_group_results.py
trieve_py_client/models/search_within_group_slim_results.py
trieve_py_client/models/set_user_api_key_request.py
trieve_py_client/models/set_user_api_key_response.py
trieve_py_client/models/single_queued_chunk_response.py
Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ Trieve OpenAPI Specification. This document describes all of the operations avai

This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:

- API version: 0.8.2
- Package version: 0.8.2
- API version: 0.8.5
- Package version: 0.8.5
- Generator version: 7.4.0
- Build package: org.openapitools.codegen.languages.PythonClientCodegen
For more information, please visit [https://trieve.ai](https://trieve.ai)
Expand Down Expand Up @@ -89,6 +89,7 @@ Class | Method | HTTP request | Description
*AuthApi* | [**get_me**](docs/AuthApi.md#get_me) | **GET** /api/auth/me | Get Me
*AuthApi* | [**login**](docs/AuthApi.md#login) | **GET** /api/auth | Login
*AuthApi* | [**logout**](docs/AuthApi.md#logout) | **DELETE** /api/auth | Logout
*ChunkApi* | [**autocomplete**](docs/ChunkApi.md#autocomplete) | **POST** /api/chunk/autocomplete | Autocomplete
*ChunkApi* | [**create_chunk**](docs/ChunkApi.md#create_chunk) | **POST** /api/chunk | Create or Upsert Chunk or Chunks
*ChunkApi* | [**create_suggested_queries_handler**](docs/ChunkApi.md#create_suggested_queries_handler) | **POST** /api/chunk/gen_suggestions | Generate suggested queries
*ChunkApi* | [**delete_chunk**](docs/ChunkApi.md#delete_chunk) | **DELETE** /api/chunk/{chunk_id} | Delete Chunk
Expand Down Expand Up @@ -160,6 +161,7 @@ Class | Method | HTTP request | Description
- [AddChunkToGroupData](docs/AddChunkToGroupData.md)
- [ApiKeyDTO](docs/ApiKeyDTO.md)
- [AuthQuery](docs/AuthQuery.md)
- [AutocompleteData](docs/AutocompleteData.md)
- [BatchQueuedChunkResponse](docs/BatchQueuedChunkResponse.md)
- [BookmarkData](docs/BookmarkData.md)
- [BookmarkGroupResult](docs/BookmarkGroupResult.md)
Expand All @@ -169,8 +171,10 @@ Class | Method | HTTP request | Description
- [ChunkGroup](docs/ChunkGroup.md)
- [ChunkGroupAndFile](docs/ChunkGroupAndFile.md)
- [ChunkMetadata](docs/ChunkMetadata.md)
- [ChunkMetadataTypes](docs/ChunkMetadataTypes.md)
- [ChunkMetadataWithScore](docs/ChunkMetadataWithScore.md)
- [ClientDatasetConfiguration](docs/ClientDatasetConfiguration.md)
- [ContentChunkMetadata](docs/ContentChunkMetadata.md)
- [CreateChunkData](docs/CreateChunkData.md)
- [CreateChunkGroupData](docs/CreateChunkGroupData.md)
- [CreateDatasetRequest](docs/CreateDatasetRequest.md)
Expand All @@ -181,6 +185,7 @@ Class | Method | HTTP request | Description
- [DatasetAndUsage](docs/DatasetAndUsage.md)
- [DatasetDTO](docs/DatasetDTO.md)
- [DatasetUsageCount](docs/DatasetUsageCount.md)
- [DateRange](docs/DateRange.md)
- [DeleteTopicData](docs/DeleteTopicData.md)
- [DeleteUserApiKeyRequest](docs/DeleteUserApiKeyRequest.md)
- [EditMessageData](docs/EditMessageData.md)
Expand All @@ -199,7 +204,6 @@ Class | Method | HTTP request | Description
- [GetTrackingChunksData](docs/GetTrackingChunksData.md)
- [GroupData](docs/GroupData.md)
- [GroupScoreChunk](docs/GroupScoreChunk.md)
- [GroupScoreSlimChunks](docs/GroupScoreSlimChunks.md)
- [InvitationData](docs/InvitationData.md)
- [LocationBoundingBox](docs/LocationBoundingBox.md)
- [LocationPolygon](docs/LocationPolygon.md)
Expand All @@ -215,16 +219,12 @@ Class | Method | HTTP request | Description
- [RegenerateMessageData](docs/RegenerateMessageData.md)
- [ReturnQueuedChunk](docs/ReturnQueuedChunk.md)
- [ScoreChunkDTO](docs/ScoreChunkDTO.md)
- [ScoreSlimChunks](docs/ScoreSlimChunks.md)
- [SearchChunkData](docs/SearchChunkData.md)
- [SearchChunkQueryResponseBody](docs/SearchChunkQueryResponseBody.md)
- [SearchOverGroupsData](docs/SearchOverGroupsData.md)
- [SearchOverGroupsResults](docs/SearchOverGroupsResults.md)
- [SearchOverGroupsSlimResults](docs/SearchOverGroupsSlimResults.md)
- [SearchSlimChunkQueryResponseBody](docs/SearchSlimChunkQueryResponseBody.md)
- [SearchWithinGroupData](docs/SearchWithinGroupData.md)
- [SearchWithinGroupResults](docs/SearchWithinGroupResults.md)
- [SearchWithinGroupSlimResults](docs/SearchWithinGroupSlimResults.md)
- [SetUserApiKeyRequest](docs/SetUserApiKeyRequest.md)
- [SetUserApiKeyResponse](docs/SetUserApiKeyResponse.md)
- [SingleQueuedChunkResponse](docs/SingleQueuedChunkResponse.md)
Expand Down
41 changes: 41 additions & 0 deletions docs/AutocompleteData.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# AutocompleteData


## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**content_only** | **bool** | 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. | [optional]
**filters** | [**ChunkFilter**](ChunkFilter.md) | | [optional]
**highlight_delimiters** | **List[str]** | Set highlight_delimiters to a list of strings to use as delimiters for highlighting. If not specified, this defaults to [\"?\", \",\", \".\", \"!\"]. | [optional]
**highlight_results** | **bool** | 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. | [optional]
**highlight_threshold** | **float** | 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. | [optional]
**page_size** | **int** | Page size is the number of chunks to fetch. This can be used to fetch more than 10 chunks at a time. | [optional]
**query** | **str** | 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** | **float** | 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. | [optional]
**score_threshold** | **float** | Set score_threshold to a float to filter out chunks with a score below the threshold. | [optional]
**search_type** | **str** | 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** | **bool** | 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. | [optional]
**tag_weights** | **Dict[str, float]** | 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. | [optional]
**use_weights** | **bool** | 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. | [optional]

## Example

```python
from trieve_py_client.models.autocomplete_data import AutocompleteData

# TODO update the JSON string below
json = "{}"
# create an instance of AutocompleteData from a JSON string
autocomplete_data_instance = AutocompleteData.from_json(json)
# print the JSON string representation of the object
print(AutocompleteData.to_json())

# convert the object into a dict
autocomplete_data_dict = autocomplete_data_instance.to_dict()
# create an instance of AutocompleteData from a dict
autocomplete_data_form_dict = autocomplete_data.from_dict(autocomplete_data_dict)
```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


90 changes: 86 additions & 4 deletions docs/ChunkApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ All URIs are relative to *https://api.trieve.ai*

Method | HTTP request | Description
------------- | ------------- | -------------
[**autocomplete**](ChunkApi.md#autocomplete) | **POST** /api/chunk/autocomplete | Autocomplete
[**create_chunk**](ChunkApi.md#create_chunk) | **POST** /api/chunk | Create or Upsert Chunk or Chunks
[**create_suggested_queries_handler**](ChunkApi.md#create_suggested_queries_handler) | **POST** /api/chunk/gen_suggestions | Generate suggested queries
[**delete_chunk**](ChunkApi.md#delete_chunk) | **DELETE** /api/chunk/{chunk_id} | Delete Chunk
Expand All @@ -19,6 +20,89 @@ Method | HTTP request | Description
[**update_chunk_by_tracking_id**](ChunkApi.md#update_chunk_by_tracking_id) | **PUT** /api/chunk/tracking_id/update | Update Chunk By Tracking Id


# **autocomplete**
> SearchChunkQueryResponseBody autocomplete(tr_dataset, autocomplete_data)
Autocomplete

Autocomplete This route provides the primary autocomplete functionality for the API. This prioritize prefix matching with semantic or full-text search.

### Example

* Api Key Authentication (ApiKey):

```python
import trieve_py_client
from trieve_py_client.models.autocomplete_data import AutocompleteData
from trieve_py_client.models.search_chunk_query_response_body import SearchChunkQueryResponseBody
from trieve_py_client.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.trieve.ai
# See configuration.py for a list of all supported configuration parameters.
configuration = trieve_py_client.Configuration(
host = "https://api.trieve.ai"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure API key authorization: ApiKey
configuration.api_key['ApiKey'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['ApiKey'] = 'Bearer'

# Enter a context with an instance of the API client
with trieve_py_client.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = trieve_py_client.ChunkApi(api_client)
tr_dataset = 'tr_dataset_example' # str | The dataset id to use for the request
autocomplete_data = trieve_py_client.AutocompleteData() # AutocompleteData | JSON request payload to semantically search for chunks (chunks)

try:
# Autocomplete
api_response = api_instance.autocomplete(tr_dataset, autocomplete_data)
print("The response of ChunkApi->autocomplete:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling ChunkApi->autocomplete: %s\n" % e)
```



### Parameters


Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**tr_dataset** | **str**| The dataset id to use for the request |
**autocomplete_data** | [**AutocompleteData**](AutocompleteData.md)| JSON request payload to semantically search for chunks (chunks) |

### Return type

[**SearchChunkQueryResponseBody**](SearchChunkQueryResponseBody.md)

### Authorization

[ApiKey](../README.md#ApiKey)

### HTTP request headers

- **Content-Type**: application/json
- **Accept**: application/json

### HTTP response details

| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | Chunks with embedding vectors which are similar to those in the request body | - |
**400** | Service error relating to searching | - |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **create_chunk**
> ReturnQueuedChunk create_chunk(tr_dataset, create_chunk_data)
Expand Down Expand Up @@ -838,8 +922,7 @@ Name | Type | Description | Notes

| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | Chunks with embedding vectors which are similar to positives and dissimilar to negatives if slim_chunks is false in the request | - |
**206** | Chunks with embedding vectors which are similar to positives and dissimilar to negatives if slim_chunks is true in the request | - |
**200** | Chunks with embedding vectors which are similar to positives and dissimilar to negatives | - |
**400** | Service error relating to to getting similar chunks | - |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
Expand Down Expand Up @@ -922,8 +1005,7 @@ Name | Type | Description | Notes

| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | Chunks with embedding vectors which are similar to those in the request body if slim_chunks is false or not specified in the request body | - |
**206** | Chunks with embedding vectors which are similar to those in the request body if slim_chunks is true in the request body | - |
**200** | Chunks with embedding vectors which are similar to those in the request body | - |
**400** | Service error relating to searching | - |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
Expand Down

0 comments on commit 5e4ffb0

Please sign in to comment.