trieve_ruby_client 0.3.5 → 0.4.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/AuthApi.md +28 -34
- data/docs/AuthQuery.md +22 -0
- data/docs/BatchQueuedChunkResponse.md +20 -0
- data/docs/ChunkApi.md +69 -143
- data/docs/ChunkData.md +42 -0
- data/docs/ChunkGroupApi.md +169 -85
- 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 +57 -132
- data/lib/trieve_ruby_client/api/chunk_group_api.rb +149 -61
- 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 +1 -1
- data/lib/trieve_ruby_client/models/api_key_dto.rb +1 -1
- data/lib/trieve_ruby_client/models/auth_query.rb +238 -0
- 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 +1233 -824
- data/spec/models/auth_query_spec.rb +48 -0
- data/spec/models/batch_queued_chunk_response_spec.rb +42 -0
- data/spec/models/chunk_data_spec.rb +108 -0
- data/spec/models/get_events_data_spec.rb +48 -0
- data/spec/models/single_queued_chunk_response_spec.rb +42 -0
- data/spec/spec_helper.rb +1 -1
- data/trieve_ruby_client-0.3.5.gem +0 -0
- data/trieve_ruby_client.gemspec +1 -1
- metadata +23 -4
- data/trieve_ruby_client-0.3.4.gem +0 -0
- data/trieve_ruby_client-0.3.41.gem +0 -0
data/docs/UserApi.md
CHANGED
@@ -1,21 +1,21 @@
|
|
1
1
|
# TrieveRubyClient::UserApi
|
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
|
-
| [**delete_user_api_key**](UserApi.md#delete_user_api_key) | **DELETE** /api/user/delete_api_key |
|
8
|
-
| [**set_user_api_key**](UserApi.md#set_user_api_key) | **POST** /api/user/set_api_key |
|
9
|
-
| [**update_user**](UserApi.md#update_user) | **PUT** /api/user |
|
7
|
+
| [**delete_user_api_key**](UserApi.md#delete_user_api_key) | **DELETE** /api/user/delete_api_key | Delete User Api Key |
|
8
|
+
| [**set_user_api_key**](UserApi.md#set_user_api_key) | **POST** /api/user/set_api_key | Set User Api Key |
|
9
|
+
| [**update_user**](UserApi.md#update_user) | **PUT** /api/user | Update User |
|
10
10
|
|
11
11
|
|
12
12
|
## delete_user_api_key
|
13
13
|
|
14
14
|
> <Array<ApiKeyDTO>> delete_user_api_key(delete_user_api_key_request)
|
15
15
|
|
16
|
-
|
16
|
+
Delete User Api Key
|
17
17
|
|
18
|
-
|
18
|
+
Delete User Api Key Delete an api key for the auth'ed user.
|
19
19
|
|
20
20
|
### Examples
|
21
21
|
|
@@ -34,7 +34,7 @@ api_instance = TrieveRubyClient::UserApi.new
|
|
34
34
|
delete_user_api_key_request = TrieveRubyClient::DeleteUserApiKeyRequest.new({api_key_id: 'api_key_id_example'}) # DeleteUserApiKeyRequest | JSON request payload to delete a user api key
|
35
35
|
|
36
36
|
begin
|
37
|
-
#
|
37
|
+
# Delete User Api Key
|
38
38
|
result = api_instance.delete_user_api_key(delete_user_api_key_request)
|
39
39
|
p result
|
40
40
|
rescue TrieveRubyClient::ApiError => e
|
@@ -50,7 +50,7 @@ This returns an Array which contains the response data, status code and headers.
|
|
50
50
|
|
51
51
|
```ruby
|
52
52
|
begin
|
53
|
-
#
|
53
|
+
# Delete User Api Key
|
54
54
|
data, status_code, headers = api_instance.delete_user_api_key_with_http_info(delete_user_api_key_request)
|
55
55
|
p status_code # => 2xx
|
56
56
|
p headers # => { ... }
|
@@ -84,9 +84,9 @@ end
|
|
84
84
|
|
85
85
|
> <SetUserApiKeyResponse> set_user_api_key(set_user_api_key_request)
|
86
86
|
|
87
|
-
|
87
|
+
Set User Api Key
|
88
88
|
|
89
|
-
|
89
|
+
Set User Api Key Create 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.
|
90
90
|
|
91
91
|
### Examples
|
92
92
|
|
@@ -105,7 +105,7 @@ api_instance = TrieveRubyClient::UserApi.new
|
|
105
105
|
set_user_api_key_request = TrieveRubyClient::SetUserApiKeyRequest.new({name: 'name_example', role: 37}) # SetUserApiKeyRequest | JSON request payload to create a new user api key
|
106
106
|
|
107
107
|
begin
|
108
|
-
#
|
108
|
+
# Set User Api Key
|
109
109
|
result = api_instance.set_user_api_key(set_user_api_key_request)
|
110
110
|
p result
|
111
111
|
rescue TrieveRubyClient::ApiError => e
|
@@ -121,7 +121,7 @@ This returns an Array which contains the response data, status code and headers.
|
|
121
121
|
|
122
122
|
```ruby
|
123
123
|
begin
|
124
|
-
#
|
124
|
+
# Set User Api Key
|
125
125
|
data, status_code, headers = api_instance.set_user_api_key_with_http_info(set_user_api_key_request)
|
126
126
|
p status_code # => 2xx
|
127
127
|
p headers # => { ... }
|
@@ -155,9 +155,9 @@ end
|
|
155
155
|
|
156
156
|
> <SlimUser> update_user(update_user_data)
|
157
157
|
|
158
|
-
|
158
|
+
Update User
|
159
159
|
|
160
|
-
|
160
|
+
Update User Update 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.
|
161
161
|
|
162
162
|
### Examples
|
163
163
|
|
@@ -176,7 +176,7 @@ api_instance = TrieveRubyClient::UserApi.new
|
|
176
176
|
update_user_data = TrieveRubyClient::UpdateUserData.new({organization_id: 'organization_id_example'}) # UpdateUserData | JSON request payload to update user information for the auth'ed user
|
177
177
|
|
178
178
|
begin
|
179
|
-
#
|
179
|
+
# Update User
|
180
180
|
result = api_instance.update_user(update_user_data)
|
181
181
|
p result
|
182
182
|
rescue TrieveRubyClient::ApiError => e
|
@@ -192,7 +192,7 @@ This returns an Array which contains the response data, status code and headers.
|
|
192
192
|
|
193
193
|
```ruby
|
194
194
|
begin
|
195
|
-
#
|
195
|
+
# Update User
|
196
196
|
data, status_code, headers = api_instance.update_user_with_http_info(update_user_data)
|
197
197
|
p status_code # => 2xx
|
198
198
|
p headers # => { ... }
|
@@ -3,7 +3,7 @@
|
|
3
3
|
|
4
4
|
#Trieve OpenAPI Specification. This document describes all of the operations available through the Trieve API.
|
5
5
|
|
6
|
-
The version of the OpenAPI document: 0.
|
6
|
+
The version of the OpenAPI document: 0.4.0
|
7
7
|
Contact: developers@trieve.ai
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
9
|
Generator version: 7.4.0
|
@@ -19,8 +19,8 @@ module TrieveRubyClient
|
|
19
19
|
def initialize(api_client = ApiClient.default)
|
20
20
|
@api_client = api_client
|
21
21
|
end
|
22
|
-
#
|
23
|
-
#
|
22
|
+
# OpenID Connect callback
|
23
|
+
# OpenID Connect callback This is the callback route for the OAuth provider, it should not be called directly. Redirects to browser with set-cookie header.
|
24
24
|
# @param [Hash] opts the optional parameters
|
25
25
|
# @return [SlimUser]
|
26
26
|
def callback(opts = {})
|
@@ -28,8 +28,8 @@ module TrieveRubyClient
|
|
28
28
|
data
|
29
29
|
end
|
30
30
|
|
31
|
-
#
|
32
|
-
#
|
31
|
+
# OpenID Connect callback
|
32
|
+
# OpenID Connect callback This is the callback route for the OAuth provider, it should not be called directly. Redirects to browser with set-cookie header.
|
33
33
|
# @param [Hash] opts the optional parameters
|
34
34
|
# @return [Array<(SlimUser, Integer, Hash)>] SlimUser data, response status code and response headers
|
35
35
|
def callback_with_http_info(opts = {})
|
@@ -76,8 +76,8 @@ module TrieveRubyClient
|
|
76
76
|
return data, status_code, headers
|
77
77
|
end
|
78
78
|
|
79
|
-
#
|
80
|
-
#
|
79
|
+
# Get Me
|
80
|
+
# Get Me Get the user corresponding to your current auth credentials.
|
81
81
|
# @param [Hash] opts the optional parameters
|
82
82
|
# @return [SlimUser]
|
83
83
|
def get_me(opts = {})
|
@@ -85,8 +85,8 @@ module TrieveRubyClient
|
|
85
85
|
data
|
86
86
|
end
|
87
87
|
|
88
|
-
#
|
89
|
-
#
|
88
|
+
# Get Me
|
89
|
+
# Get Me Get the user corresponding to your current auth credentials.
|
90
90
|
# @param [Hash] opts the optional parameters
|
91
91
|
# @return [Array<(SlimUser, Integer, Hash)>] SlimUser data, response status code and response headers
|
92
92
|
def get_me_with_http_info(opts = {})
|
@@ -133,50 +133,43 @@ module TrieveRubyClient
|
|
133
133
|
return data, status_code, headers
|
134
134
|
end
|
135
135
|
|
136
|
-
#
|
137
|
-
#
|
136
|
+
# Login
|
137
|
+
# Login This will redirect you to the OAuth provider for authentication with email/pass, SSO, Google, Github, etc.
|
138
|
+
# @param content [AuthQuery] Query parameters for login to be included as kv pairs after ? on the request URL.
|
138
139
|
# @param [Hash] opts the optional parameters
|
139
|
-
# @option opts [String] :inv_code Code sent via email as a result of successful call to send_invitation
|
140
|
-
# @option opts [String] :organization_id ID of organization to authenticate into
|
141
|
-
# @option opts [String] :redirect_uri URL to redirect to after successful login
|
142
140
|
# @return [nil]
|
143
|
-
def login(opts = {})
|
144
|
-
login_with_http_info(opts)
|
141
|
+
def login(content, opts = {})
|
142
|
+
login_with_http_info(content, opts)
|
145
143
|
nil
|
146
144
|
end
|
147
145
|
|
148
|
-
#
|
149
|
-
#
|
146
|
+
# Login
|
147
|
+
# Login This will redirect you to the OAuth provider for authentication with email/pass, SSO, Google, Github, etc.
|
148
|
+
# @param content [AuthQuery] Query parameters for login to be included as kv pairs after ? on the request URL.
|
150
149
|
# @param [Hash] opts the optional parameters
|
151
|
-
# @option opts [String] :inv_code Code sent via email as a result of successful call to send_invitation
|
152
|
-
# @option opts [String] :organization_id ID of organization to authenticate into
|
153
|
-
# @option opts [String] :redirect_uri URL to redirect to after successful login
|
154
150
|
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
155
|
-
def login_with_http_info(opts = {})
|
151
|
+
def login_with_http_info(content, opts = {})
|
156
152
|
if @api_client.config.debugging
|
157
153
|
@api_client.config.logger.debug 'Calling API: AuthApi.login ...'
|
158
154
|
end
|
155
|
+
# verify the required parameter 'content' is set
|
156
|
+
if @api_client.config.client_side_validation && content.nil?
|
157
|
+
fail ArgumentError, "Missing the required parameter 'content' when calling AuthApi.login"
|
158
|
+
end
|
159
159
|
# resource path
|
160
160
|
local_var_path = '/api/auth'
|
161
161
|
|
162
162
|
# query parameters
|
163
163
|
query_params = opts[:query_params] || {}
|
164
|
+
query_params[:'content'] = content
|
164
165
|
|
165
166
|
# header parameters
|
166
167
|
header_params = opts[:header_params] || {}
|
167
168
|
# HTTP header 'Accept' (if needed)
|
168
169
|
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
169
|
-
# HTTP header 'Content-Type'
|
170
|
-
content_type = @api_client.select_header_content_type(['application/x-www-form-urlencoded'])
|
171
|
-
if !content_type.nil?
|
172
|
-
header_params['Content-Type'] = content_type
|
173
|
-
end
|
174
170
|
|
175
171
|
# form parameters
|
176
172
|
form_params = opts[:form_params] || {}
|
177
|
-
form_params['inv_code'] = opts[:'inv_code'] if !opts[:'inv_code'].nil?
|
178
|
-
form_params['organization_id'] = opts[:'organization_id'] if !opts[:'organization_id'].nil?
|
179
|
-
form_params['redirect_uri'] = opts[:'redirect_uri'] if !opts[:'redirect_uri'].nil?
|
180
173
|
|
181
174
|
# http body (model)
|
182
175
|
post_body = opts[:debug_body]
|
@@ -204,8 +197,8 @@ module TrieveRubyClient
|
|
204
197
|
return data, status_code, headers
|
205
198
|
end
|
206
199
|
|
207
|
-
#
|
208
|
-
#
|
200
|
+
# Logout
|
201
|
+
# Logout Invalidate your current auth credential stored typically stored in a cookie. This does not invalidate your API key.
|
209
202
|
# @param [Hash] opts the optional parameters
|
210
203
|
# @return [nil]
|
211
204
|
def logout(opts = {})
|
@@ -213,8 +206,8 @@ module TrieveRubyClient
|
|
213
206
|
nil
|
214
207
|
end
|
215
208
|
|
216
|
-
#
|
217
|
-
#
|
209
|
+
# Logout
|
210
|
+
# Logout Invalidate your current auth credential stored typically stored in a cookie. This does not invalidate your API key.
|
218
211
|
# @param [Hash] opts the optional parameters
|
219
212
|
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
220
213
|
def logout_with_http_info(opts = {})
|
@@ -3,7 +3,7 @@
|
|
3
3
|
|
4
4
|
#Trieve OpenAPI Specification. This document describes all of the operations available through the Trieve API.
|
5
5
|
|
6
|
-
The version of the OpenAPI document: 0.
|
6
|
+
The version of the OpenAPI document: 0.4.0
|
7
7
|
Contact: developers@trieve.ai
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
9
|
Generator version: 7.4.0
|
@@ -19,83 +19,8 @@ module TrieveRubyClient
|
|
19
19
|
def initialize(api_client = ApiClient.default)
|
20
20
|
@api_client = api_client
|
21
21
|
end
|
22
|
-
#
|
23
|
-
#
|
24
|
-
# @param tr_dataset [String] The dataset id to use for the request
|
25
|
-
# @param create_chunk_data [CreateChunkData] JSON request payload to create a new chunk (chunk)
|
26
|
-
# @param [Hash] opts the optional parameters
|
27
|
-
# @return [ReturnQueuedChunk]
|
28
|
-
def bulk_create_chunk(tr_dataset, create_chunk_data, opts = {})
|
29
|
-
data, _status_code, _headers = bulk_create_chunk_with_http_info(tr_dataset, create_chunk_data, opts)
|
30
|
-
data
|
31
|
-
end
|
32
|
-
|
33
|
-
# bulk_create_chunk
|
34
|
-
# 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.
|
35
|
-
# @param tr_dataset [String] The dataset id to use for the request
|
36
|
-
# @param create_chunk_data [CreateChunkData] JSON request payload to create a new chunk (chunk)
|
37
|
-
# @param [Hash] opts the optional parameters
|
38
|
-
# @return [Array<(ReturnQueuedChunk, Integer, Hash)>] ReturnQueuedChunk data, response status code and response headers
|
39
|
-
def bulk_create_chunk_with_http_info(tr_dataset, create_chunk_data, opts = {})
|
40
|
-
if @api_client.config.debugging
|
41
|
-
@api_client.config.logger.debug 'Calling API: ChunkApi.bulk_create_chunk ...'
|
42
|
-
end
|
43
|
-
# verify the required parameter 'tr_dataset' is set
|
44
|
-
if @api_client.config.client_side_validation && tr_dataset.nil?
|
45
|
-
fail ArgumentError, "Missing the required parameter 'tr_dataset' when calling ChunkApi.bulk_create_chunk"
|
46
|
-
end
|
47
|
-
# verify the required parameter 'create_chunk_data' is set
|
48
|
-
if @api_client.config.client_side_validation && create_chunk_data.nil?
|
49
|
-
fail ArgumentError, "Missing the required parameter 'create_chunk_data' when calling ChunkApi.bulk_create_chunk"
|
50
|
-
end
|
51
|
-
# resource path
|
52
|
-
local_var_path = '/api/chunk/bulk'
|
53
|
-
|
54
|
-
# query parameters
|
55
|
-
query_params = opts[:query_params] || {}
|
56
|
-
|
57
|
-
# header parameters
|
58
|
-
header_params = opts[:header_params] || {}
|
59
|
-
# HTTP header 'Accept' (if needed)
|
60
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
61
|
-
# HTTP header 'Content-Type'
|
62
|
-
content_type = @api_client.select_header_content_type(['application/json'])
|
63
|
-
if !content_type.nil?
|
64
|
-
header_params['Content-Type'] = content_type
|
65
|
-
end
|
66
|
-
header_params[:'TR-Dataset'] = tr_dataset
|
67
|
-
|
68
|
-
# form parameters
|
69
|
-
form_params = opts[:form_params] || {}
|
70
|
-
|
71
|
-
# http body (model)
|
72
|
-
post_body = opts[:debug_body] || @api_client.object_to_http_body(create_chunk_data)
|
73
|
-
|
74
|
-
# return_type
|
75
|
-
return_type = opts[:debug_return_type] || 'ReturnQueuedChunk'
|
76
|
-
|
77
|
-
# auth_names
|
78
|
-
auth_names = opts[:debug_auth_names] || ['ApiKey']
|
79
|
-
|
80
|
-
new_options = opts.merge(
|
81
|
-
:operation => :"ChunkApi.bulk_create_chunk",
|
82
|
-
:header_params => header_params,
|
83
|
-
:query_params => query_params,
|
84
|
-
:form_params => form_params,
|
85
|
-
:body => post_body,
|
86
|
-
:auth_names => auth_names,
|
87
|
-
:return_type => return_type
|
88
|
-
)
|
89
|
-
|
90
|
-
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
91
|
-
if @api_client.config.debugging
|
92
|
-
@api_client.config.logger.debug "API called: ChunkApi#bulk_create_chunk\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
93
|
-
end
|
94
|
-
return data, status_code, headers
|
95
|
-
end
|
96
|
-
|
97
|
-
# create_chunk
|
98
|
-
# create_chunk 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.
|
22
|
+
# Create Chunk
|
23
|
+
# Create Chunk 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.
|
99
24
|
# @param tr_dataset [String] The dataset id to use for the request
|
100
25
|
# @param create_chunk_data [CreateChunkData] JSON request payload to create a new chunk (chunk)
|
101
26
|
# @param [Hash] opts the optional parameters
|
@@ -105,8 +30,8 @@ module TrieveRubyClient
|
|
105
30
|
data
|
106
31
|
end
|
107
32
|
|
108
|
-
#
|
109
|
-
#
|
33
|
+
# Create Chunk
|
34
|
+
# Create Chunk 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.
|
110
35
|
# @param tr_dataset [String] The dataset id to use for the request
|
111
36
|
# @param create_chunk_data [CreateChunkData] JSON request payload to create a new chunk (chunk)
|
112
37
|
# @param [Hash] opts the optional parameters
|
@@ -169,8 +94,8 @@ module TrieveRubyClient
|
|
169
94
|
return data, status_code, headers
|
170
95
|
end
|
171
96
|
|
172
|
-
#
|
173
|
-
#
|
97
|
+
# Generate suggested queries
|
98
|
+
# 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
99
|
# @param tr_dataset [String] The dataset id to use for the request
|
175
100
|
# @param suggested_queries_request [SuggestedQueriesRequest] JSON request payload to get alternative suggested queries
|
176
101
|
# @param [Hash] opts the optional parameters
|
@@ -180,8 +105,8 @@ module TrieveRubyClient
|
|
180
105
|
data
|
181
106
|
end
|
182
107
|
|
183
|
-
#
|
184
|
-
#
|
108
|
+
# Generate suggested queries
|
109
|
+
# 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.
|
185
110
|
# @param tr_dataset [String] The dataset id to use for the request
|
186
111
|
# @param suggested_queries_request [SuggestedQueriesRequest] JSON request payload to get alternative suggested queries
|
187
112
|
# @param [Hash] opts the optional parameters
|
@@ -244,26 +169,26 @@ module TrieveRubyClient
|
|
244
169
|
return data, status_code, headers
|
245
170
|
end
|
246
171
|
|
247
|
-
#
|
248
|
-
#
|
172
|
+
# Delete Chunk
|
173
|
+
# 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.
|
249
174
|
# @param tr_dataset [String] The dataset id to use for the request
|
250
|
-
# @param chunk_id [Uuid] Id of the chunk you want to fetch. This can be either the chunk_id or the tracking_id.
|
251
175
|
# @param tracking_or_chunk [String] The type of id you are using to search for the chunk. This can be either 'chunk' or 'tracking_id'
|
176
|
+
# @param chunk_id [String] Id of the chunk you want to fetch. This can be either the chunk_id or the tracking_id.
|
252
177
|
# @param [Hash] opts the optional parameters
|
253
178
|
# @return [nil]
|
254
|
-
def delete_chunk(tr_dataset,
|
255
|
-
delete_chunk_with_http_info(tr_dataset,
|
179
|
+
def delete_chunk(tr_dataset, tracking_or_chunk, chunk_id, opts = {})
|
180
|
+
delete_chunk_with_http_info(tr_dataset, tracking_or_chunk, chunk_id, opts)
|
256
181
|
nil
|
257
182
|
end
|
258
183
|
|
259
|
-
#
|
260
|
-
#
|
184
|
+
# Delete Chunk
|
185
|
+
# 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.
|
261
186
|
# @param tr_dataset [String] The dataset id to use for the request
|
262
|
-
# @param chunk_id [Uuid] Id of the chunk you want to fetch. This can be either the chunk_id or the tracking_id.
|
263
187
|
# @param tracking_or_chunk [String] The type of id you are using to search for the chunk. This can be either 'chunk' or 'tracking_id'
|
188
|
+
# @param chunk_id [String] Id of the chunk you want to fetch. This can be either the chunk_id or the tracking_id.
|
264
189
|
# @param [Hash] opts the optional parameters
|
265
190
|
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
266
|
-
def delete_chunk_with_http_info(tr_dataset,
|
191
|
+
def delete_chunk_with_http_info(tr_dataset, tracking_or_chunk, chunk_id, opts = {})
|
267
192
|
if @api_client.config.debugging
|
268
193
|
@api_client.config.logger.debug 'Calling API: ChunkApi.delete_chunk ...'
|
269
194
|
end
|
@@ -276,7 +201,7 @@ module TrieveRubyClient
|
|
276
201
|
fail ArgumentError, "Missing the required parameter 'tracking_or_chunk' when calling ChunkApi.delete_chunk"
|
277
202
|
end
|
278
203
|
# resource path
|
279
|
-
local_var_path = '/api/{tracking_or_chunk}/{chunk_id}'.sub('{' + '
|
204
|
+
local_var_path = '/api/chunk/{tracking_or_chunk}/{chunk_id}'.sub('{' + 'tracking_or_chunk' + '}', CGI.escape(tracking_or_chunk.to_s)).sub('{' + 'chunk_id' + '}', CGI.escape(chunk_id.to_s))
|
280
205
|
|
281
206
|
# query parameters
|
282
207
|
query_params = opts[:query_params] || {}
|
@@ -316,8 +241,8 @@ module TrieveRubyClient
|
|
316
241
|
return data, status_code, headers
|
317
242
|
end
|
318
243
|
|
319
|
-
#
|
320
|
-
#
|
244
|
+
# Delete Chunk By Tracking Id
|
245
|
+
# 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
246
|
# @param tr_dataset [String] The dataset id to use for the request
|
322
247
|
# @param tracking_id [String] tracking_id of the chunk you want to delete
|
323
248
|
# @param [Hash] opts the optional parameters
|
@@ -327,8 +252,8 @@ module TrieveRubyClient
|
|
327
252
|
nil
|
328
253
|
end
|
329
254
|
|
330
|
-
#
|
331
|
-
#
|
255
|
+
# Delete Chunk By Tracking Id
|
256
|
+
# 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.
|
332
257
|
# @param tr_dataset [String] The dataset id to use for the request
|
333
258
|
# @param tracking_id [String] tracking_id of the chunk you want to delete
|
334
259
|
# @param [Hash] opts the optional parameters
|
@@ -386,8 +311,8 @@ module TrieveRubyClient
|
|
386
311
|
return data, status_code, headers
|
387
312
|
end
|
388
313
|
|
389
|
-
#
|
390
|
-
#
|
314
|
+
# RAG on User Defined Chunks
|
315
|
+
# RAG on User Defined 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.
|
391
316
|
# @param tr_dataset [String] The dataset id to use for the request
|
392
317
|
# @param generate_chunks_request [GenerateChunksRequest] JSON request payload to perform RAG on some chunks (chunks)
|
393
318
|
# @param [Hash] opts the optional parameters
|
@@ -397,8 +322,8 @@ module TrieveRubyClient
|
|
397
322
|
data
|
398
323
|
end
|
399
324
|
|
400
|
-
#
|
401
|
-
#
|
325
|
+
# RAG on User Defined Chunks
|
326
|
+
# RAG on User Defined 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.
|
402
327
|
# @param tr_dataset [String] The dataset id to use for the request
|
403
328
|
# @param generate_chunks_request [GenerateChunksRequest] JSON request payload to perform RAG on some chunks (chunks)
|
404
329
|
# @param [Hash] opts the optional parameters
|
@@ -461,26 +386,26 @@ module TrieveRubyClient
|
|
461
386
|
return data, status_code, headers
|
462
387
|
end
|
463
388
|
|
464
|
-
#
|
465
|
-
#
|
389
|
+
# Get Chunk By Id
|
390
|
+
# Get Chunk By Id Get a singular chunk by id.
|
466
391
|
# @param tr_dataset [String] The dataset id to use for the request
|
467
|
-
# @param chunk_id [Uuid] Id of the chunk you want to fetch. This can be either the chunk_id or the tracking_id.
|
468
392
|
# @param tracking_or_chunk [String] The type of id you are using to search for the chunk. This can be either 'chunk' or 'tracking_id'
|
393
|
+
# @param chunk_id [String] Id of the chunk you want to fetch. This can be either the chunk_id or the tracking_id.
|
469
394
|
# @param [Hash] opts the optional parameters
|
470
395
|
# @return [ChunkMetadata]
|
471
|
-
def get_chunk_by_id(tr_dataset,
|
472
|
-
data, _status_code, _headers = get_chunk_by_id_with_http_info(tr_dataset,
|
396
|
+
def get_chunk_by_id(tr_dataset, tracking_or_chunk, chunk_id, opts = {})
|
397
|
+
data, _status_code, _headers = get_chunk_by_id_with_http_info(tr_dataset, tracking_or_chunk, chunk_id, opts)
|
473
398
|
data
|
474
399
|
end
|
475
400
|
|
476
|
-
#
|
477
|
-
#
|
401
|
+
# Get Chunk By Id
|
402
|
+
# Get Chunk By Id Get a singular chunk by id.
|
478
403
|
# @param tr_dataset [String] The dataset id to use for the request
|
479
|
-
# @param chunk_id [Uuid] Id of the chunk you want to fetch. This can be either the chunk_id or the tracking_id.
|
480
404
|
# @param tracking_or_chunk [String] The type of id you are using to search for the chunk. This can be either 'chunk' or 'tracking_id'
|
405
|
+
# @param chunk_id [String] Id of the chunk you want to fetch. This can be either the chunk_id or the tracking_id.
|
481
406
|
# @param [Hash] opts the optional parameters
|
482
407
|
# @return [Array<(ChunkMetadata, Integer, Hash)>] ChunkMetadata data, response status code and response headers
|
483
|
-
def get_chunk_by_id_with_http_info(tr_dataset,
|
408
|
+
def get_chunk_by_id_with_http_info(tr_dataset, tracking_or_chunk, chunk_id, opts = {})
|
484
409
|
if @api_client.config.debugging
|
485
410
|
@api_client.config.logger.debug 'Calling API: ChunkApi.get_chunk_by_id ...'
|
486
411
|
end
|
@@ -493,7 +418,7 @@ module TrieveRubyClient
|
|
493
418
|
fail ArgumentError, "Missing the required parameter 'tracking_or_chunk' when calling ChunkApi.get_chunk_by_id"
|
494
419
|
end
|
495
420
|
# resource path
|
496
|
-
local_var_path = '/api/{tracking_or_chunk}/{chunk_id}'.sub('{' + '
|
421
|
+
local_var_path = '/api/chunk/{tracking_or_chunk}/{chunk_id}'.sub('{' + 'tracking_or_chunk' + '}', CGI.escape(tracking_or_chunk.to_s)).sub('{' + 'chunk_id' + '}', CGI.escape(chunk_id.to_s))
|
497
422
|
|
498
423
|
# query parameters
|
499
424
|
query_params = opts[:query_params] || {}
|
@@ -533,8 +458,8 @@ module TrieveRubyClient
|
|
533
458
|
return data, status_code, headers
|
534
459
|
end
|
535
460
|
|
536
|
-
#
|
537
|
-
#
|
461
|
+
# Get Chunk By Tracking Id
|
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.
|
538
463
|
# @param tr_dataset [String] The dataset id to use for the request
|
539
464
|
# @param tracking_id [String] tracking_id of the chunk you want to fetch
|
540
465
|
# @param [Hash] opts the optional parameters
|
@@ -544,8 +469,8 @@ module TrieveRubyClient
|
|
544
469
|
data
|
545
470
|
end
|
546
471
|
|
547
|
-
#
|
548
|
-
#
|
472
|
+
# Get Chunk By Tracking Id
|
473
|
+
# 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.
|
549
474
|
# @param tr_dataset [String] The dataset id to use for the request
|
550
475
|
# @param tracking_id [String] tracking_id of the chunk you want to fetch
|
551
476
|
# @param [Hash] opts the optional parameters
|
@@ -603,8 +528,8 @@ module TrieveRubyClient
|
|
603
528
|
return data, status_code, headers
|
604
529
|
end
|
605
530
|
|
606
|
-
#
|
607
|
-
#
|
531
|
+
# Get Recommended Chunks
|
532
|
+
# 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.
|
608
533
|
# @param tr_dataset [String] The dataset id to use for the request
|
609
534
|
# @param recommend_chunks_request [RecommendChunksRequest] JSON request payload to get recommendations of chunks similar to the chunks in the request
|
610
535
|
# @param [Hash] opts the optional parameters
|
@@ -614,8 +539,8 @@ module TrieveRubyClient
|
|
614
539
|
data
|
615
540
|
end
|
616
541
|
|
617
|
-
#
|
618
|
-
#
|
542
|
+
# Get Recommended Chunks
|
543
|
+
# 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.
|
619
544
|
# @param tr_dataset [String] The dataset id to use for the request
|
620
545
|
# @param recommend_chunks_request [RecommendChunksRequest] JSON request payload to get recommendations of chunks similar to the chunks in the request
|
621
546
|
# @param [Hash] opts the optional parameters
|
@@ -678,8 +603,8 @@ module TrieveRubyClient
|
|
678
603
|
return data, status_code, headers
|
679
604
|
end
|
680
605
|
|
681
|
-
#
|
682
|
-
#
|
606
|
+
# Search
|
607
|
+
# 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.
|
683
608
|
# @param tr_dataset [String] The dataset id to use for the request
|
684
609
|
# @param search_chunk_data [SearchChunkData] JSON request payload to semantically search for chunks (chunks)
|
685
610
|
# @param [Hash] opts the optional parameters
|
@@ -689,8 +614,8 @@ module TrieveRubyClient
|
|
689
614
|
data
|
690
615
|
end
|
691
616
|
|
692
|
-
#
|
693
|
-
#
|
617
|
+
# Search
|
618
|
+
# 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.
|
694
619
|
# @param tr_dataset [String] The dataset id to use for the request
|
695
620
|
# @param search_chunk_data [SearchChunkData] JSON request payload to semantically search for chunks (chunks)
|
696
621
|
# @param [Hash] opts the optional parameters
|
@@ -753,8 +678,8 @@ module TrieveRubyClient
|
|
753
678
|
return data, status_code, headers
|
754
679
|
end
|
755
680
|
|
756
|
-
#
|
757
|
-
#
|
681
|
+
# Update Chunk
|
682
|
+
# 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.
|
758
683
|
# @param tr_dataset [String] The dataset id to use for the request
|
759
684
|
# @param update_chunk_data [UpdateChunkData] JSON request payload to update a chunk (chunk)
|
760
685
|
# @param [Hash] opts the optional parameters
|
@@ -764,8 +689,8 @@ module TrieveRubyClient
|
|
764
689
|
nil
|
765
690
|
end
|
766
691
|
|
767
|
-
#
|
768
|
-
#
|
692
|
+
# Update Chunk
|
693
|
+
# 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.
|
769
694
|
# @param tr_dataset [String] The dataset id to use for the request
|
770
695
|
# @param update_chunk_data [UpdateChunkData] JSON request payload to update a chunk (chunk)
|
771
696
|
# @param [Hash] opts the optional parameters
|
@@ -828,8 +753,8 @@ module TrieveRubyClient
|
|
828
753
|
return data, status_code, headers
|
829
754
|
end
|
830
755
|
|
831
|
-
#
|
832
|
-
#
|
756
|
+
# Update Chunk By Tracking Id
|
757
|
+
# 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.
|
833
758
|
# @param tr_dataset [String] The dataset id to use for the request
|
834
759
|
# @param update_chunk_by_tracking_id_data [UpdateChunkByTrackingIdData] JSON request payload to update a chunk by tracking_id (chunks)
|
835
760
|
# @param [Hash] opts the optional parameters
|
@@ -839,8 +764,8 @@ module TrieveRubyClient
|
|
839
764
|
nil
|
840
765
|
end
|
841
766
|
|
842
|
-
#
|
843
|
-
#
|
767
|
+
# Update Chunk By Tracking Id
|
768
|
+
# 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.
|
844
769
|
# @param tr_dataset [String] The dataset id to use for the request
|
845
770
|
# @param update_chunk_by_tracking_id_data [UpdateChunkByTrackingIdData] JSON request payload to update a chunk by tracking_id (chunks)
|
846
771
|
# @param [Hash] opts the optional parameters
|