trieve_ruby_client 0.3.5 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +78 -74
- data/docs/AddChunkToGroupData.md +1 -1
- data/docs/AuthApi.md +28 -34
- data/docs/AuthQuery.md +22 -0
- data/docs/BatchQueuedChunkResponse.md +20 -0
- data/docs/ChunkApi.md +69 -147
- data/docs/ChunkData.md +42 -0
- data/docs/ChunkGroupApi.md +168 -90
- data/docs/CreateChunkData.md +41 -34
- data/docs/DatasetApi.md +31 -31
- data/docs/EventsApi.md +13 -13
- data/docs/FileApi.md +21 -21
- data/docs/GetEventsData.md +22 -0
- data/docs/HealthApi.md +6 -4
- data/docs/InvitationApi.md +6 -6
- data/docs/MessageApi.md +21 -21
- data/docs/OrganizationApi.md +31 -31
- data/docs/ReturnQueuedChunk.md +39 -10
- data/docs/SingleQueuedChunkResponse.md +20 -0
- data/docs/StripeApi.md +21 -13
- data/docs/TopicApi.md +21 -21
- data/docs/UserApi.md +16 -16
- data/lib/trieve_ruby_client/api/auth_api.rb +27 -34
- data/lib/trieve_ruby_client/api/chunk_api.rb +64 -143
- data/lib/trieve_ruby_client/api/chunk_group_api.rb +153 -75
- data/lib/trieve_ruby_client/api/dataset_api.rb +25 -25
- data/lib/trieve_ruby_client/api/events_api.rb +21 -16
- data/lib/trieve_ruby_client/api/file_api.rb +17 -17
- data/lib/trieve_ruby_client/api/health_api.rb +5 -1
- data/lib/trieve_ruby_client/api/invitation_api.rb +5 -5
- data/lib/trieve_ruby_client/api/message_api.rb +17 -17
- data/lib/trieve_ruby_client/api/organization_api.rb +25 -25
- data/lib/trieve_ruby_client/api/stripe_api.rb +17 -1
- data/lib/trieve_ruby_client/api/topic_api.rb +17 -17
- data/lib/trieve_ruby_client/api/user_api.rb +13 -13
- data/lib/trieve_ruby_client/api_client.rb +1 -1
- data/lib/trieve_ruby_client/api_error.rb +1 -1
- data/lib/trieve_ruby_client/configuration.rb +8 -4
- data/lib/trieve_ruby_client/models/add_chunk_to_group_data.rb +2 -2
- data/lib/trieve_ruby_client/models/api_key_dto.rb +1 -1
- data/lib/trieve_ruby_client/models/{stripe_subscription.rb → auth_query.rb} +23 -96
- data/lib/trieve_ruby_client/models/batch_queued_chunk_response.rb +240 -0
- data/lib/trieve_ruby_client/models/bookmark_data.rb +1 -1
- data/lib/trieve_ruby_client/models/bookmark_group_result.rb +1 -1
- data/lib/trieve_ruby_client/models/chat_message_proxy.rb +1 -1
- data/lib/trieve_ruby_client/models/chunk_data.rb +356 -0
- data/lib/trieve_ruby_client/models/chunk_filter.rb +1 -1
- data/lib/trieve_ruby_client/models/chunk_group.rb +1 -1
- data/lib/trieve_ruby_client/models/chunk_group_and_file.rb +1 -1
- data/lib/trieve_ruby_client/models/chunk_metadata.rb +1 -1
- data/lib/trieve_ruby_client/models/chunk_metadata_with_file_data.rb +1 -1
- data/lib/trieve_ruby_client/models/client_dataset_configuration.rb +1 -1
- data/lib/trieve_ruby_client/models/create_chunk_data.rb +79 -330
- data/lib/trieve_ruby_client/models/create_chunk_group_data.rb +1 -1
- data/lib/trieve_ruby_client/models/create_dataset_request.rb +1 -1
- data/lib/trieve_ruby_client/models/create_message_data.rb +1 -1
- data/lib/trieve_ruby_client/models/create_organization_data.rb +1 -1
- data/lib/trieve_ruby_client/models/create_topic_data.rb +1 -1
- data/lib/trieve_ruby_client/models/dataset.rb +1 -1
- data/lib/trieve_ruby_client/models/dataset_and_usage.rb +1 -1
- data/lib/trieve_ruby_client/models/dataset_dto.rb +1 -1
- data/lib/trieve_ruby_client/models/dataset_usage_count.rb +1 -1
- data/lib/trieve_ruby_client/models/delete_dataset_request.rb +1 -1
- data/lib/trieve_ruby_client/models/delete_topic_data.rb +1 -1
- data/lib/trieve_ruby_client/models/delete_user_api_key_request.rb +1 -1
- data/lib/trieve_ruby_client/models/edit_message_data.rb +1 -1
- data/lib/trieve_ruby_client/models/error_response_body.rb +1 -1
- data/lib/trieve_ruby_client/models/event.rb +1 -1
- data/lib/trieve_ruby_client/models/event_return.rb +1 -1
- data/lib/trieve_ruby_client/models/field_condition.rb +1 -1
- data/lib/trieve_ruby_client/models/file.rb +1 -1
- data/lib/trieve_ruby_client/models/file_dto.rb +1 -1
- data/lib/trieve_ruby_client/models/generate_chunks_request.rb +1 -1
- data/lib/trieve_ruby_client/models/get_events_data.rb +240 -0
- data/lib/trieve_ruby_client/models/get_groups_for_chunks_data.rb +1 -1
- data/lib/trieve_ruby_client/models/group_data.rb +1 -1
- data/lib/trieve_ruby_client/models/group_score_chunk_dto.rb +1 -1
- data/lib/trieve_ruby_client/models/invitation_data.rb +1 -1
- data/lib/trieve_ruby_client/models/match_condition.rb +1 -1
- data/lib/trieve_ruby_client/models/message.rb +1 -1
- data/lib/trieve_ruby_client/models/organization.rb +1 -1
- data/lib/trieve_ruby_client/models/organization_usage_count.rb +1 -1
- data/lib/trieve_ruby_client/models/range.rb +1 -1
- data/lib/trieve_ruby_client/models/reccomend_group_chunks_request.rb +1 -1
- data/lib/trieve_ruby_client/models/recommend_chunks_request.rb +1 -1
- data/lib/trieve_ruby_client/models/regenerate_message_data.rb +1 -1
- data/lib/trieve_ruby_client/models/return_queued_chunk.rb +75 -207
- data/lib/trieve_ruby_client/models/score_chunk_dto.rb +1 -1
- data/lib/trieve_ruby_client/models/search_chunk_data.rb +1 -1
- data/lib/trieve_ruby_client/models/search_chunk_query_response_body.rb +1 -1
- data/lib/trieve_ruby_client/models/search_groups_result.rb +1 -1
- data/lib/trieve_ruby_client/models/search_over_groups_data.rb +1 -1
- data/lib/trieve_ruby_client/models/search_over_groups_response_body.rb +1 -1
- data/lib/trieve_ruby_client/models/search_within_group_data.rb +1 -1
- data/lib/trieve_ruby_client/models/set_user_api_key_request.rb +1 -1
- data/lib/trieve_ruby_client/models/set_user_api_key_response.rb +1 -1
- data/lib/trieve_ruby_client/models/single_queued_chunk_response.rb +238 -0
- data/lib/trieve_ruby_client/models/slim_group.rb +1 -1
- data/lib/trieve_ruby_client/models/slim_user.rb +1 -1
- data/lib/trieve_ruby_client/models/stripe_plan.rb +1 -1
- data/lib/trieve_ruby_client/models/suggested_queries_request.rb +1 -1
- data/lib/trieve_ruby_client/models/suggested_queries_response.rb +1 -1
- data/lib/trieve_ruby_client/models/topic.rb +1 -1
- data/lib/trieve_ruby_client/models/update_chunk_by_tracking_id_data.rb +1 -1
- data/lib/trieve_ruby_client/models/update_chunk_data.rb +1 -1
- data/lib/trieve_ruby_client/models/update_chunk_group_data.rb +1 -1
- data/lib/trieve_ruby_client/models/update_dataset_request.rb +1 -1
- data/lib/trieve_ruby_client/models/update_group_by_tracking_id_data.rb +1 -1
- data/lib/trieve_ruby_client/models/update_organization_data.rb +1 -1
- data/lib/trieve_ruby_client/models/update_topic_data.rb +1 -1
- data/lib/trieve_ruby_client/models/update_user_data.rb +1 -1
- data/lib/trieve_ruby_client/models/upload_file_data.rb +1 -1
- data/lib/trieve_ruby_client/models/upload_file_result.rb +1 -1
- data/lib/trieve_ruby_client/models/user_organization.rb +1 -1
- data/lib/trieve_ruby_client/version.rb +2 -2
- data/lib/trieve_ruby_client.rb +6 -2
- data/openapi-generator.yaml +1 -1
- data/openapi.json +1196 -849
- data/spec/api/auth_api_spec.rb +16 -18
- data/spec/api/chunk_api_spec.rb +30 -43
- data/spec/api/chunk_group_api_spec.rb +54 -33
- data/spec/api/dataset_api_spec.rb +19 -19
- data/spec/api/events_api_spec.rb +10 -10
- data/spec/api/file_api_spec.rb +15 -15
- data/spec/api/health_api_spec.rb +9 -7
- data/spec/api/invitation_api_spec.rb +9 -9
- data/spec/api/message_api_spec.rb +15 -15
- data/spec/api/organization_api_spec.rb +19 -19
- data/spec/api/stripe_api_spec.rb +15 -7
- data/spec/api/topic_api_spec.rb +15 -15
- data/spec/api/user_api_spec.rb +13 -13
- data/spec/models/add_chunk_to_group_data_spec.rb +8 -8
- data/spec/models/api_key_dto_spec.rb +8 -8
- data/spec/models/auth_query_spec.rb +48 -0
- data/spec/models/batch_queued_chunk_response_spec.rb +42 -0
- data/spec/models/bookmark_data_spec.rb +8 -8
- data/spec/models/bookmark_group_result_spec.rb +8 -8
- data/spec/models/chat_message_proxy_spec.rb +8 -8
- data/spec/models/chunk_data_spec.rb +108 -0
- data/spec/models/chunk_filter_spec.rb +8 -8
- data/spec/models/chunk_group_and_file_spec.rb +8 -8
- data/spec/models/chunk_group_spec.rb +8 -8
- data/spec/models/chunk_metadata_spec.rb +8 -8
- data/spec/models/chunk_metadata_with_file_data_spec.rb +8 -8
- data/spec/models/client_dataset_configuration_spec.rb +8 -8
- data/spec/models/create_chunk_data_spec.rb +11 -87
- data/spec/models/create_chunk_group_data_spec.rb +8 -8
- data/spec/models/create_dataset_request_spec.rb +8 -8
- data/spec/models/create_message_data_spec.rb +8 -8
- data/spec/models/create_organization_data_spec.rb +8 -8
- data/spec/models/create_topic_data_spec.rb +8 -8
- data/spec/models/dataset_and_usage_spec.rb +8 -8
- data/spec/models/dataset_dto_spec.rb +8 -8
- data/spec/models/dataset_spec.rb +8 -8
- data/spec/models/dataset_usage_count_spec.rb +8 -8
- data/spec/models/delete_dataset_request_spec.rb +8 -8
- data/spec/models/delete_topic_data_spec.rb +8 -8
- data/spec/models/delete_user_api_key_request_spec.rb +8 -8
- data/spec/models/edit_message_data_spec.rb +8 -8
- data/spec/models/error_response_body_spec.rb +8 -8
- data/spec/models/event_return_spec.rb +8 -8
- data/spec/models/event_spec.rb +8 -8
- data/spec/models/field_condition_spec.rb +8 -8
- data/spec/models/file_dto_spec.rb +8 -8
- data/spec/models/file_spec.rb +8 -8
- data/spec/models/generate_chunks_request_spec.rb +8 -8
- data/spec/models/get_events_data_spec.rb +48 -0
- data/spec/models/get_groups_for_chunks_data_spec.rb +8 -8
- data/spec/models/group_data_spec.rb +8 -8
- data/spec/models/group_score_chunk_dto_spec.rb +8 -8
- data/spec/models/invitation_data_spec.rb +8 -8
- data/spec/models/match_condition_spec.rb +6 -6
- data/spec/models/message_spec.rb +8 -8
- data/spec/models/organization_spec.rb +8 -8
- data/spec/models/organization_usage_count_spec.rb +8 -8
- data/spec/models/range_spec.rb +8 -8
- data/spec/models/reccomend_group_chunks_request_spec.rb +8 -8
- data/spec/models/recommend_chunks_request_spec.rb +8 -8
- data/spec/models/regenerate_message_data_spec.rb +8 -8
- data/spec/models/return_queued_chunk_spec.rb +11 -21
- data/spec/models/score_chunk_dto_spec.rb +8 -8
- data/spec/models/search_chunk_data_spec.rb +8 -8
- data/spec/models/search_chunk_query_response_body_spec.rb +8 -8
- data/spec/models/search_groups_result_spec.rb +8 -8
- data/spec/models/search_over_groups_data_spec.rb +8 -8
- data/spec/models/search_over_groups_response_body_spec.rb +8 -8
- data/spec/models/search_within_group_data_spec.rb +8 -8
- data/spec/models/set_user_api_key_request_spec.rb +8 -8
- data/spec/models/set_user_api_key_response_spec.rb +8 -8
- data/spec/models/single_queued_chunk_response_spec.rb +42 -0
- data/spec/models/slim_group_spec.rb +8 -8
- data/spec/models/slim_user_spec.rb +8 -8
- data/spec/models/stripe_plan_spec.rb +8 -8
- data/spec/models/suggested_queries_request_spec.rb +8 -8
- data/spec/models/suggested_queries_response_spec.rb +8 -8
- data/spec/models/topic_spec.rb +8 -8
- data/spec/models/update_chunk_by_tracking_id_data_spec.rb +20 -8
- data/spec/models/update_chunk_data_spec.rb +20 -8
- data/spec/models/update_chunk_group_data_spec.rb +14 -8
- data/spec/models/update_dataset_request_spec.rb +8 -8
- data/spec/models/update_group_by_tracking_id_data_spec.rb +8 -8
- data/spec/models/update_organization_data_spec.rb +8 -8
- data/spec/models/update_topic_data_spec.rb +8 -8
- data/spec/models/update_user_data_spec.rb +8 -8
- data/spec/models/upload_file_data_spec.rb +8 -8
- data/spec/models/upload_file_result_spec.rb +8 -8
- data/spec/models/user_organization_spec.rb +8 -8
- data/spec/spec_helper.rb +1 -1
- data/trieve_ruby_client-0.3.5.gem +0 -0
- data/trieve_ruby_client-0.4.0.gem +0 -0
- data/trieve_ruby_client.gemspec +1 -1
- metadata +24 -8
- data/docs/StripeSubscription.md +0 -30
- data/spec/models/stripe_subscription_spec.rb +0 -72
- data/trieve_ruby_client-0.3.4.gem +0 -0
- data/trieve_ruby_client-0.3.41.gem +0 -0
data/docs/ChunkApi.md
CHANGED
@@ -1,103 +1,29 @@
|
|
1
1
|
# TrieveRubyClient::ChunkApi
|
2
2
|
|
3
|
-
All URIs are relative to *http://localhost*
|
3
|
+
All URIs are relative to *http://localhost:8090*
|
4
4
|
|
5
5
|
| Method | HTTP request | Description |
|
6
6
|
| ------ | ------------ | ----------- |
|
7
|
-
| [**
|
8
|
-
| [**
|
9
|
-
| [**
|
10
|
-
| [**
|
11
|
-
| [**
|
12
|
-
| [**
|
13
|
-
| [**
|
14
|
-
| [**
|
15
|
-
| [**
|
16
|
-
| [**
|
17
|
-
| [**
|
18
|
-
| [**update_chunk_by_tracking_id**](ChunkApi.md#update_chunk_by_tracking_id) | **PUT** /api/chunk/tracking_id/update | update_chunk_by_tracking_id |
|
19
|
-
|
20
|
-
|
21
|
-
## bulk_create_chunk
|
22
|
-
|
23
|
-
> <ReturnQueuedChunk> bulk_create_chunk(tr_dataset, create_chunk_data)
|
24
|
-
|
25
|
-
bulk_create_chunk
|
26
|
-
|
27
|
-
bulk_create_chunk Create a new chunk from an array of chunks. 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.
|
28
|
-
|
29
|
-
### Examples
|
30
|
-
|
31
|
-
```ruby
|
32
|
-
require 'time'
|
33
|
-
require 'trieve_ruby_client'
|
34
|
-
# setup authorization
|
35
|
-
TrieveRubyClient.configure do |config|
|
36
|
-
# Configure API key authorization: ApiKey
|
37
|
-
config.api_key['ApiKey'] = 'YOUR API KEY'
|
38
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
39
|
-
# config.api_key_prefix['ApiKey'] = 'Bearer'
|
40
|
-
end
|
41
|
-
|
42
|
-
api_instance = TrieveRubyClient::ChunkApi.new
|
43
|
-
tr_dataset = 'tr_dataset_example' # String | The dataset id to use for the request
|
44
|
-
create_chunk_data = TrieveRubyClient::CreateChunkData.new # CreateChunkData | JSON request payload to create a new chunk (chunk)
|
45
|
-
|
46
|
-
begin
|
47
|
-
# bulk_create_chunk
|
48
|
-
result = api_instance.bulk_create_chunk(tr_dataset, create_chunk_data)
|
49
|
-
p result
|
50
|
-
rescue TrieveRubyClient::ApiError => e
|
51
|
-
puts "Error when calling ChunkApi->bulk_create_chunk: #{e}"
|
52
|
-
end
|
53
|
-
```
|
54
|
-
|
55
|
-
#### Using the bulk_create_chunk_with_http_info variant
|
56
|
-
|
57
|
-
This returns an Array which contains the response data, status code and headers.
|
58
|
-
|
59
|
-
> <Array(<ReturnQueuedChunk>, Integer, Hash)> bulk_create_chunk_with_http_info(tr_dataset, create_chunk_data)
|
60
|
-
|
61
|
-
```ruby
|
62
|
-
begin
|
63
|
-
# bulk_create_chunk
|
64
|
-
data, status_code, headers = api_instance.bulk_create_chunk_with_http_info(tr_dataset, create_chunk_data)
|
65
|
-
p status_code # => 2xx
|
66
|
-
p headers # => { ... }
|
67
|
-
p data # => <ReturnQueuedChunk>
|
68
|
-
rescue TrieveRubyClient::ApiError => e
|
69
|
-
puts "Error when calling ChunkApi->bulk_create_chunk_with_http_info: #{e}"
|
70
|
-
end
|
71
|
-
```
|
72
|
-
|
73
|
-
### Parameters
|
74
|
-
|
75
|
-
| Name | Type | Description | Notes |
|
76
|
-
| ---- | ---- | ----------- | ----- |
|
77
|
-
| **tr_dataset** | **String** | The dataset id to use for the request | |
|
78
|
-
| **create_chunk_data** | [**CreateChunkData**](CreateChunkData.md) | JSON request payload to create a new chunk (chunk) | |
|
79
|
-
|
80
|
-
### Return type
|
81
|
-
|
82
|
-
[**ReturnQueuedChunk**](ReturnQueuedChunk.md)
|
83
|
-
|
84
|
-
### Authorization
|
85
|
-
|
86
|
-
[ApiKey](../README.md#ApiKey)
|
87
|
-
|
88
|
-
### HTTP request headers
|
89
|
-
|
90
|
-
- **Content-Type**: application/json
|
91
|
-
- **Accept**: application/json
|
7
|
+
| [**create_chunk**](ChunkApi.md#create_chunk) | **POST** /api/chunk | Create or Upsert Chunk or Chunks |
|
8
|
+
| [**create_suggested_queries_handler**](ChunkApi.md#create_suggested_queries_handler) | **POST** /api/chunk/gen_suggestions | Generate suggested queries |
|
9
|
+
| [**delete_chunk**](ChunkApi.md#delete_chunk) | **DELETE** /api/chunk/{chunk_id} | Delete Chunk |
|
10
|
+
| [**delete_chunk_by_tracking_id**](ChunkApi.md#delete_chunk_by_tracking_id) | **DELETE** /api/chunk/tracking_id/{tracking_id} | Delete Chunk By Tracking Id |
|
11
|
+
| [**generate_off_chunks**](ChunkApi.md#generate_off_chunks) | **POST** /api/chunk/generate | RAG on Specified Chunks |
|
12
|
+
| [**get_chunk_by_id**](ChunkApi.md#get_chunk_by_id) | **GET** /api/chunk/{chunk_id} | Get Chunk By Id |
|
13
|
+
| [**get_chunk_by_tracking_id**](ChunkApi.md#get_chunk_by_tracking_id) | **GET** /api/chunk/tracking_id/{tracking_id} | Get Chunk By Tracking Id |
|
14
|
+
| [**get_recommended_chunks**](ChunkApi.md#get_recommended_chunks) | **POST** /api/chunk/recommend | Get Recommended Chunks |
|
15
|
+
| [**search_chunk**](ChunkApi.md#search_chunk) | **POST** /api/chunk/search | Search |
|
16
|
+
| [**update_chunk**](ChunkApi.md#update_chunk) | **PUT** /api/chunk | Update Chunk |
|
17
|
+
| [**update_chunk_by_tracking_id**](ChunkApi.md#update_chunk_by_tracking_id) | **PUT** /api/chunk/tracking_id/update | Update Chunk By Tracking Id |
|
92
18
|
|
93
19
|
|
94
20
|
## create_chunk
|
95
21
|
|
96
22
|
> <ReturnQueuedChunk> create_chunk(tr_dataset, create_chunk_data)
|
97
23
|
|
98
|
-
|
24
|
+
Create or Upsert Chunk or Chunks
|
99
25
|
|
100
|
-
|
26
|
+
Create or Upsert Chunk or Chunks Create 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.
|
101
27
|
|
102
28
|
### Examples
|
103
29
|
|
@@ -114,10 +40,10 @@ end
|
|
114
40
|
|
115
41
|
api_instance = TrieveRubyClient::ChunkApi.new
|
116
42
|
tr_dataset = 'tr_dataset_example' # String | The dataset id to use for the request
|
117
|
-
create_chunk_data =
|
43
|
+
create_chunk_data = nil # CreateChunkData | JSON request payload to create a new chunk (chunk)
|
118
44
|
|
119
45
|
begin
|
120
|
-
#
|
46
|
+
# Create or Upsert Chunk or Chunks
|
121
47
|
result = api_instance.create_chunk(tr_dataset, create_chunk_data)
|
122
48
|
p result
|
123
49
|
rescue TrieveRubyClient::ApiError => e
|
@@ -133,7 +59,7 @@ This returns an Array which contains the response data, status code and headers.
|
|
133
59
|
|
134
60
|
```ruby
|
135
61
|
begin
|
136
|
-
#
|
62
|
+
# Create or Upsert Chunk or Chunks
|
137
63
|
data, status_code, headers = api_instance.create_chunk_with_http_info(tr_dataset, create_chunk_data)
|
138
64
|
p status_code # => 2xx
|
139
65
|
p headers # => { ... }
|
@@ -168,9 +94,9 @@ end
|
|
168
94
|
|
169
95
|
> <SuggestedQueriesResponse> create_suggested_queries_handler(tr_dataset, suggested_queries_request)
|
170
96
|
|
171
|
-
|
97
|
+
Generate suggested queries
|
172
98
|
|
173
|
-
|
99
|
+
Generate suggested queries This endpoint will generate 3 suggested queries based off the query provided in the request body and return them as a JSON object.
|
174
100
|
|
175
101
|
### Examples
|
176
102
|
|
@@ -190,7 +116,7 @@ tr_dataset = 'tr_dataset_example' # String | The dataset id to use for the reque
|
|
190
116
|
suggested_queries_request = TrieveRubyClient::SuggestedQueriesRequest.new({query: 'query_example'}) # SuggestedQueriesRequest | JSON request payload to get alternative suggested queries
|
191
117
|
|
192
118
|
begin
|
193
|
-
#
|
119
|
+
# Generate suggested queries
|
194
120
|
result = api_instance.create_suggested_queries_handler(tr_dataset, suggested_queries_request)
|
195
121
|
p result
|
196
122
|
rescue TrieveRubyClient::ApiError => e
|
@@ -206,7 +132,7 @@ This returns an Array which contains the response data, status code and headers.
|
|
206
132
|
|
207
133
|
```ruby
|
208
134
|
begin
|
209
|
-
#
|
135
|
+
# Generate suggested queries
|
210
136
|
data, status_code, headers = api_instance.create_suggested_queries_handler_with_http_info(tr_dataset, suggested_queries_request)
|
211
137
|
p status_code # => 2xx
|
212
138
|
p headers # => { ... }
|
@@ -239,11 +165,11 @@ end
|
|
239
165
|
|
240
166
|
## delete_chunk
|
241
167
|
|
242
|
-
> delete_chunk(tr_dataset, chunk_id
|
168
|
+
> delete_chunk(tr_dataset, chunk_id)
|
243
169
|
|
244
|
-
|
170
|
+
Delete Chunk
|
245
171
|
|
246
|
-
|
172
|
+
Delete Chunk Delete a chunk by its id. If deleting a root chunk which has a collision, the most recently created collision will become a new root chunk.
|
247
173
|
|
248
174
|
### Examples
|
249
175
|
|
@@ -260,12 +186,11 @@ end
|
|
260
186
|
|
261
187
|
api_instance = TrieveRubyClient::ChunkApi.new
|
262
188
|
tr_dataset = 'tr_dataset_example' # String | The dataset id to use for the request
|
263
|
-
chunk_id =
|
264
|
-
tracking_or_chunk = 'tracking_or_chunk_example' # String | The type of id you are using to search for the chunk. This can be either 'chunk' or 'tracking_id'
|
189
|
+
chunk_id = '38400000-8cf0-11bd-b23e-10b96e4ef00d' # String | Id of the chunk you want to fetch.
|
265
190
|
|
266
191
|
begin
|
267
|
-
#
|
268
|
-
api_instance.delete_chunk(tr_dataset, chunk_id
|
192
|
+
# Delete Chunk
|
193
|
+
api_instance.delete_chunk(tr_dataset, chunk_id)
|
269
194
|
rescue TrieveRubyClient::ApiError => e
|
270
195
|
puts "Error when calling ChunkApi->delete_chunk: #{e}"
|
271
196
|
end
|
@@ -275,12 +200,12 @@ end
|
|
275
200
|
|
276
201
|
This returns an Array which contains the response data (`nil` in this case), status code and headers.
|
277
202
|
|
278
|
-
> <Array(nil, Integer, Hash)> delete_chunk_with_http_info(tr_dataset, chunk_id
|
203
|
+
> <Array(nil, Integer, Hash)> delete_chunk_with_http_info(tr_dataset, chunk_id)
|
279
204
|
|
280
205
|
```ruby
|
281
206
|
begin
|
282
|
-
#
|
283
|
-
data, status_code, headers = api_instance.delete_chunk_with_http_info(tr_dataset, chunk_id
|
207
|
+
# Delete Chunk
|
208
|
+
data, status_code, headers = api_instance.delete_chunk_with_http_info(tr_dataset, chunk_id)
|
284
209
|
p status_code # => 2xx
|
285
210
|
p headers # => { ... }
|
286
211
|
p data # => nil
|
@@ -294,8 +219,7 @@ end
|
|
294
219
|
| Name | Type | Description | Notes |
|
295
220
|
| ---- | ---- | ----------- | ----- |
|
296
221
|
| **tr_dataset** | **String** | The dataset id to use for the request | |
|
297
|
-
| **chunk_id** |
|
298
|
-
| **tracking_or_chunk** | **String** | The type of id you are using to search for the chunk. This can be either 'chunk' or 'tracking_id' | |
|
222
|
+
| **chunk_id** | **String** | Id of the chunk you want to fetch. | |
|
299
223
|
|
300
224
|
### Return type
|
301
225
|
|
@@ -315,9 +239,9 @@ nil (empty response body)
|
|
315
239
|
|
316
240
|
> delete_chunk_by_tracking_id(tr_dataset, tracking_id)
|
317
241
|
|
318
|
-
|
242
|
+
Delete Chunk By Tracking Id
|
319
243
|
|
320
|
-
|
244
|
+
Delete Chunk By Tracking Id Delete a chunk by tracking_id. This is useful for when you are coordinating with an external system and want to use the tracking_id to identify the chunk. If deleting a root chunk which has a collision, the most recently created collision will become a new root chunk.
|
321
245
|
|
322
246
|
### Examples
|
323
247
|
|
@@ -337,7 +261,7 @@ tr_dataset = 'tr_dataset_example' # String | The dataset id to use for the reque
|
|
337
261
|
tracking_id = 'tracking_id_example' # String | tracking_id of the chunk you want to delete
|
338
262
|
|
339
263
|
begin
|
340
|
-
#
|
264
|
+
# Delete Chunk By Tracking Id
|
341
265
|
api_instance.delete_chunk_by_tracking_id(tr_dataset, tracking_id)
|
342
266
|
rescue TrieveRubyClient::ApiError => e
|
343
267
|
puts "Error when calling ChunkApi->delete_chunk_by_tracking_id: #{e}"
|
@@ -352,7 +276,7 @@ This returns an Array which contains the response data (`nil` in this case), sta
|
|
352
276
|
|
353
277
|
```ruby
|
354
278
|
begin
|
355
|
-
#
|
279
|
+
# Delete Chunk By Tracking Id
|
356
280
|
data, status_code, headers = api_instance.delete_chunk_by_tracking_id_with_http_info(tr_dataset, tracking_id)
|
357
281
|
p status_code # => 2xx
|
358
282
|
p headers # => { ... }
|
@@ -387,9 +311,9 @@ nil (empty response body)
|
|
387
311
|
|
388
312
|
> String generate_off_chunks(tr_dataset, generate_chunks_request)
|
389
313
|
|
390
|
-
|
314
|
+
RAG on Specified Chunks
|
391
315
|
|
392
|
-
|
316
|
+
RAG on Specified Chunks This 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.
|
393
317
|
|
394
318
|
### Examples
|
395
319
|
|
@@ -409,7 +333,7 @@ tr_dataset = 'tr_dataset_example' # String | The dataset id to use for the reque
|
|
409
333
|
generate_chunks_request = TrieveRubyClient::GenerateChunksRequest.new({chunk_ids: ['chunk_ids_example'], prev_messages: [TrieveRubyClient::ChatMessageProxy.new({content: 'content_example', role: 'role_example'})]}) # GenerateChunksRequest | JSON request payload to perform RAG on some chunks (chunks)
|
410
334
|
|
411
335
|
begin
|
412
|
-
#
|
336
|
+
# RAG on Specified Chunks
|
413
337
|
result = api_instance.generate_off_chunks(tr_dataset, generate_chunks_request)
|
414
338
|
p result
|
415
339
|
rescue TrieveRubyClient::ApiError => e
|
@@ -425,7 +349,7 @@ This returns an Array which contains the response data, status code and headers.
|
|
425
349
|
|
426
350
|
```ruby
|
427
351
|
begin
|
428
|
-
#
|
352
|
+
# RAG on Specified Chunks
|
429
353
|
data, status_code, headers = api_instance.generate_off_chunks_with_http_info(tr_dataset, generate_chunks_request)
|
430
354
|
p status_code # => 2xx
|
431
355
|
p headers # => { ... }
|
@@ -458,11 +382,11 @@ end
|
|
458
382
|
|
459
383
|
## get_chunk_by_id
|
460
384
|
|
461
|
-
> <ChunkMetadata> get_chunk_by_id(tr_dataset, chunk_id
|
385
|
+
> <ChunkMetadata> get_chunk_by_id(tr_dataset, chunk_id)
|
462
386
|
|
463
|
-
|
387
|
+
Get Chunk By Id
|
464
388
|
|
465
|
-
|
389
|
+
Get Chunk By Id Get a singular chunk by id.
|
466
390
|
|
467
391
|
### Examples
|
468
392
|
|
@@ -479,12 +403,11 @@ end
|
|
479
403
|
|
480
404
|
api_instance = TrieveRubyClient::ChunkApi.new
|
481
405
|
tr_dataset = 'tr_dataset_example' # String | The dataset id to use for the request
|
482
|
-
chunk_id =
|
483
|
-
tracking_or_chunk = 'tracking_or_chunk_example' # String | The type of id you are using to search for the chunk. This can be either 'chunk' or 'tracking_id'
|
406
|
+
chunk_id = '38400000-8cf0-11bd-b23e-10b96e4ef00d' # String | Id of the chunk you want to fetch.
|
484
407
|
|
485
408
|
begin
|
486
|
-
#
|
487
|
-
result = api_instance.get_chunk_by_id(tr_dataset, chunk_id
|
409
|
+
# Get Chunk By Id
|
410
|
+
result = api_instance.get_chunk_by_id(tr_dataset, chunk_id)
|
488
411
|
p result
|
489
412
|
rescue TrieveRubyClient::ApiError => e
|
490
413
|
puts "Error when calling ChunkApi->get_chunk_by_id: #{e}"
|
@@ -495,12 +418,12 @@ end
|
|
495
418
|
|
496
419
|
This returns an Array which contains the response data, status code and headers.
|
497
420
|
|
498
|
-
> <Array(<ChunkMetadata>, Integer, Hash)> get_chunk_by_id_with_http_info(tr_dataset, chunk_id
|
421
|
+
> <Array(<ChunkMetadata>, Integer, Hash)> get_chunk_by_id_with_http_info(tr_dataset, chunk_id)
|
499
422
|
|
500
423
|
```ruby
|
501
424
|
begin
|
502
|
-
#
|
503
|
-
data, status_code, headers = api_instance.get_chunk_by_id_with_http_info(tr_dataset, chunk_id
|
425
|
+
# Get Chunk By Id
|
426
|
+
data, status_code, headers = api_instance.get_chunk_by_id_with_http_info(tr_dataset, chunk_id)
|
504
427
|
p status_code # => 2xx
|
505
428
|
p headers # => { ... }
|
506
429
|
p data # => <ChunkMetadata>
|
@@ -514,8 +437,7 @@ end
|
|
514
437
|
| Name | Type | Description | Notes |
|
515
438
|
| ---- | ---- | ----------- | ----- |
|
516
439
|
| **tr_dataset** | **String** | The dataset id to use for the request | |
|
517
|
-
| **chunk_id** |
|
518
|
-
| **tracking_or_chunk** | **String** | The type of id you are using to search for the chunk. This can be either 'chunk' or 'tracking_id' | |
|
440
|
+
| **chunk_id** | **String** | Id of the chunk you want to fetch. | |
|
519
441
|
|
520
442
|
### Return type
|
521
443
|
|
@@ -535,9 +457,9 @@ end
|
|
535
457
|
|
536
458
|
> <ChunkMetadata> get_chunk_by_tracking_id(tr_dataset, tracking_id)
|
537
459
|
|
538
|
-
|
460
|
+
Get Chunk By Tracking Id
|
539
461
|
|
540
|
-
|
462
|
+
Get Chunk By Tracking Id Get a singular chunk by tracking_id. This is useful for when you are coordinating with an external system and want to use your own id as the primary reference for a chunk.
|
541
463
|
|
542
464
|
### Examples
|
543
465
|
|
@@ -557,7 +479,7 @@ tr_dataset = 'tr_dataset_example' # String | The dataset id to use for the reque
|
|
557
479
|
tracking_id = 'tracking_id_example' # String | tracking_id of the chunk you want to fetch
|
558
480
|
|
559
481
|
begin
|
560
|
-
#
|
482
|
+
# Get Chunk By Tracking Id
|
561
483
|
result = api_instance.get_chunk_by_tracking_id(tr_dataset, tracking_id)
|
562
484
|
p result
|
563
485
|
rescue TrieveRubyClient::ApiError => e
|
@@ -573,7 +495,7 @@ This returns an Array which contains the response data, status code and headers.
|
|
573
495
|
|
574
496
|
```ruby
|
575
497
|
begin
|
576
|
-
#
|
498
|
+
# Get Chunk By Tracking Id
|
577
499
|
data, status_code, headers = api_instance.get_chunk_by_tracking_id_with_http_info(tr_dataset, tracking_id)
|
578
500
|
p status_code # => 2xx
|
579
501
|
p headers # => { ... }
|
@@ -608,9 +530,9 @@ end
|
|
608
530
|
|
609
531
|
> <Array<ChunkMetadataWithFileData>> get_recommended_chunks(tr_dataset, recommend_chunks_request)
|
610
532
|
|
611
|
-
|
533
|
+
Get Recommended Chunks
|
612
534
|
|
613
|
-
|
535
|
+
Get Recommended Chunks Get 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.
|
614
536
|
|
615
537
|
### Examples
|
616
538
|
|
@@ -630,7 +552,7 @@ tr_dataset = 'tr_dataset_example' # String | The dataset id to use for the reque
|
|
630
552
|
recommend_chunks_request = TrieveRubyClient::RecommendChunksRequest.new # RecommendChunksRequest | JSON request payload to get recommendations of chunks similar to the chunks in the request
|
631
553
|
|
632
554
|
begin
|
633
|
-
#
|
555
|
+
# Get Recommended Chunks
|
634
556
|
result = api_instance.get_recommended_chunks(tr_dataset, recommend_chunks_request)
|
635
557
|
p result
|
636
558
|
rescue TrieveRubyClient::ApiError => e
|
@@ -646,7 +568,7 @@ This returns an Array which contains the response data, status code and headers.
|
|
646
568
|
|
647
569
|
```ruby
|
648
570
|
begin
|
649
|
-
#
|
571
|
+
# Get Recommended Chunks
|
650
572
|
data, status_code, headers = api_instance.get_recommended_chunks_with_http_info(tr_dataset, recommend_chunks_request)
|
651
573
|
p status_code # => 2xx
|
652
574
|
p headers # => { ... }
|
@@ -681,9 +603,9 @@ end
|
|
681
603
|
|
682
604
|
> <SearchChunkQueryResponseBody> search_chunk(tr_dataset, search_chunk_data)
|
683
605
|
|
684
|
-
|
606
|
+
Search
|
685
607
|
|
686
|
-
|
608
|
+
Search This route provides the primary search functionality for the API. It can be used to search for chunks by semantic similarity, full-text similarity, or a combination of both. Results' `chunk_html` values will be modified with `<b>` tags for sub-sentence highlighting.
|
687
609
|
|
688
610
|
### Examples
|
689
611
|
|
@@ -703,7 +625,7 @@ tr_dataset = 'tr_dataset_example' # String | The dataset id to use for the reque
|
|
703
625
|
search_chunk_data = TrieveRubyClient::SearchChunkData.new({query: 'query_example', search_type: 'search_type_example'}) # SearchChunkData | JSON request payload to semantically search for chunks (chunks)
|
704
626
|
|
705
627
|
begin
|
706
|
-
#
|
628
|
+
# Search
|
707
629
|
result = api_instance.search_chunk(tr_dataset, search_chunk_data)
|
708
630
|
p result
|
709
631
|
rescue TrieveRubyClient::ApiError => e
|
@@ -719,7 +641,7 @@ This returns an Array which contains the response data, status code and headers.
|
|
719
641
|
|
720
642
|
```ruby
|
721
643
|
begin
|
722
|
-
#
|
644
|
+
# Search
|
723
645
|
data, status_code, headers = api_instance.search_chunk_with_http_info(tr_dataset, search_chunk_data)
|
724
646
|
p status_code # => 2xx
|
725
647
|
p headers # => { ... }
|
@@ -754,9 +676,9 @@ end
|
|
754
676
|
|
755
677
|
> update_chunk(tr_dataset, update_chunk_data)
|
756
678
|
|
757
|
-
|
679
|
+
Update Chunk
|
758
680
|
|
759
|
-
|
681
|
+
Update Chunk Update a chunk. If you try to change the tracking_id of the chunk to have the same tracking_id as an existing chunk, the request will fail.
|
760
682
|
|
761
683
|
### Examples
|
762
684
|
|
@@ -776,7 +698,7 @@ tr_dataset = 'tr_dataset_example' # String | The dataset id to use for the reque
|
|
776
698
|
update_chunk_data = TrieveRubyClient::UpdateChunkData.new # UpdateChunkData | JSON request payload to update a chunk (chunk)
|
777
699
|
|
778
700
|
begin
|
779
|
-
#
|
701
|
+
# Update Chunk
|
780
702
|
api_instance.update_chunk(tr_dataset, update_chunk_data)
|
781
703
|
rescue TrieveRubyClient::ApiError => e
|
782
704
|
puts "Error when calling ChunkApi->update_chunk: #{e}"
|
@@ -791,7 +713,7 @@ This returns an Array which contains the response data (`nil` in this case), sta
|
|
791
713
|
|
792
714
|
```ruby
|
793
715
|
begin
|
794
|
-
#
|
716
|
+
# Update Chunk
|
795
717
|
data, status_code, headers = api_instance.update_chunk_with_http_info(tr_dataset, update_chunk_data)
|
796
718
|
p status_code # => 2xx
|
797
719
|
p headers # => { ... }
|
@@ -826,9 +748,9 @@ nil (empty response body)
|
|
826
748
|
|
827
749
|
> update_chunk_by_tracking_id(tr_dataset, update_chunk_by_tracking_id_data)
|
828
750
|
|
829
|
-
|
751
|
+
Update Chunk By Tracking Id
|
830
752
|
|
831
|
-
|
753
|
+
Update Chunk By Tracking Id Update a chunk by tracking_id. This is useful for when you are coordinating with an external system and want to use the tracking_id to identify the chunk.
|
832
754
|
|
833
755
|
### Examples
|
834
756
|
|
@@ -848,7 +770,7 @@ tr_dataset = 'tr_dataset_example' # String | The dataset id to use for the reque
|
|
848
770
|
update_chunk_by_tracking_id_data = TrieveRubyClient::UpdateChunkByTrackingIdData.new({tracking_id: 'tracking_id_example'}) # UpdateChunkByTrackingIdData | JSON request payload to update a chunk by tracking_id (chunks)
|
849
771
|
|
850
772
|
begin
|
851
|
-
#
|
773
|
+
# Update Chunk By Tracking Id
|
852
774
|
api_instance.update_chunk_by_tracking_id(tr_dataset, update_chunk_by_tracking_id_data)
|
853
775
|
rescue TrieveRubyClient::ApiError => e
|
854
776
|
puts "Error when calling ChunkApi->update_chunk_by_tracking_id: #{e}"
|
@@ -863,7 +785,7 @@ This returns an Array which contains the response data (`nil` in this case), sta
|
|
863
785
|
|
864
786
|
```ruby
|
865
787
|
begin
|
866
|
-
#
|
788
|
+
# Update Chunk By Tracking Id
|
867
789
|
data, status_code, headers = api_instance.update_chunk_by_tracking_id_with_http_info(tr_dataset, update_chunk_by_tracking_id_data)
|
868
790
|
p status_code # => 2xx
|
869
791
|
p headers # => { ... }
|
data/docs/ChunkData.md
ADDED
@@ -0,0 +1,42 @@
|
|
1
|
+
# TrieveRubyClient::ChunkData
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **chunk_html** | **String** | 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. | [optional] |
|
8
|
+
| **chunk_vector** | **Array<Float>** | 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. | [optional] |
|
9
|
+
| **file_id** | **String** | File_uuid is the uuid of the file that the chunk is associated with. This is used to associate chunks with files. This is useful for when you want to delete a file and all of its associated chunks. | [optional] |
|
10
|
+
| **group_ids** | **Array<String>** | 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. | [optional] |
|
11
|
+
| **group_tracking_ids** | **Array<String>** | 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. | [optional] |
|
12
|
+
| **link** | **String** | 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. | [optional] |
|
13
|
+
| **metadata** | **Object** | 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. | [optional] |
|
14
|
+
| **split_avg** | **Boolean** | 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. | [optional] |
|
15
|
+
| **tag_set** | **Array<String>** | 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. | [optional] |
|
16
|
+
| **time_stamp** | **String** | 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. | [optional] |
|
17
|
+
| **tracking_id** | **String** | 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. | [optional] |
|
18
|
+
| **upsert_by_tracking_id** | **Boolean** | 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. | [optional] |
|
19
|
+
| **weight** | **Float** | 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. | [optional] |
|
20
|
+
|
21
|
+
## Example
|
22
|
+
|
23
|
+
```ruby
|
24
|
+
require 'trieve_ruby_client'
|
25
|
+
|
26
|
+
instance = TrieveRubyClient::ChunkData.new(
|
27
|
+
chunk_html: null,
|
28
|
+
chunk_vector: null,
|
29
|
+
file_id: null,
|
30
|
+
group_ids: null,
|
31
|
+
group_tracking_ids: null,
|
32
|
+
link: null,
|
33
|
+
metadata: null,
|
34
|
+
split_avg: null,
|
35
|
+
tag_set: null,
|
36
|
+
time_stamp: null,
|
37
|
+
tracking_id: null,
|
38
|
+
upsert_by_tracking_id: null,
|
39
|
+
weight: null
|
40
|
+
)
|
41
|
+
```
|
42
|
+
|