trieve_ruby_client 0.8.0 → 0.10.7
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 +39 -30
- data/docs/ApiKeyRespBody.md +32 -0
- data/docs/AutocompleteData.md +42 -0
- data/docs/AutocompleteReqPayload.md +50 -0
- data/docs/BoostPhrase.md +20 -0
- data/docs/ChunkApi.md +140 -66
- data/docs/ChunkData.md +2 -0
- data/docs/ChunkFilter.md +3 -3
- data/docs/ChunkGroup.md +1 -1
- data/docs/ChunkGroupApi.md +35 -33
- data/docs/ChunkMetadata.md +5 -3
- data/docs/ChunkMetadataStringTagSet.md +46 -0
- data/docs/ChunkMetadataTypes.md +51 -0
- data/docs/ChunkMetadataWithScore.md +0 -2
- data/docs/ChunkReqPayload.md +50 -0
- data/docs/ClientDatasetConfiguration.md +0 -2
- data/docs/ConditionType.md +49 -0
- data/docs/ContentChunkMetadata.md +32 -0
- data/docs/CreateChunkGroupReqPayload.md +28 -0
- data/docs/CreateChunkReqPayloadEnum.md +49 -0
- data/docs/CreateDatasetRequest.md +2 -2
- data/docs/CreateMessageData.md +2 -2
- data/docs/CreateMessageReqPayload.md +42 -0
- data/docs/CreateTopicReqPayload.md +22 -0
- data/docs/Dataset.md +2 -0
- data/docs/DatasetApi.md +236 -12
- data/docs/DateRange.md +24 -0
- data/docs/EditMessageReqPayload.md +44 -0
- data/docs/FieldCondition.md +2 -0
- data/docs/File.md +1 -1
- data/docs/FileApi.md +7 -7
- data/docs/GenerateChunksRequest.md +2 -0
- data/docs/GetDatasetsPagination.md +20 -0
- data/docs/GroupScoreSlimChunks.md +4 -0
- data/docs/HasIDCondition.md +20 -0
- data/docs/InvitationApi.md +1 -1
- data/docs/MatchCondition.md +3 -1
- data/docs/MessageApi.md +42 -42
- data/docs/Organization.md +2 -0
- data/docs/OrganizationApi.md +24 -25
- data/docs/RangeCondition.md +1 -3
- data/docs/RecommendChunksRequest.md +1 -1
- data/docs/RecommendGroupChunksRequest.md +1 -1
- data/docs/RegenerateMessageReqPayload.md +40 -0
- data/docs/RemoveChunkFromGroupReqPayload.md +18 -0
- data/docs/ScoreChunkDTO.md +3 -1
- data/docs/SearchChunkData.md +12 -6
- data/docs/SearchChunksReqPayload.md +54 -0
- data/docs/SearchOverGroupsData.md +12 -4
- data/docs/SearchWithinGroupData.md +16 -6
- data/docs/SetUserApiKeyRequest.md +4 -0
- data/docs/SlimChunkMetadata.md +4 -0
- data/docs/SuggestedQueriesReqPayload.md +18 -0
- data/docs/TopicApi.md +16 -16
- data/docs/UpdateChunkData.md +2 -0
- data/docs/UpdateChunkReqPayload.md +46 -0
- data/docs/UpdateDatasetRequest.md +2 -0
- data/docs/UpdateGroupByTrackingIDReqPayload.md +26 -0
- data/docs/UpdateTopicReqPayload.md +20 -0
- data/docs/UpdateUserOrgRoleData.md +1 -1
- data/docs/UploadFileReqPayload.md +40 -0
- data/docs/UserApi.md +7 -8
- data/lib/trieve_ruby_client/api/auth_api.rb +1 -1
- data/lib/trieve_ruby_client/api/chunk_api.rb +158 -83
- data/lib/trieve_ruby_client/api/chunk_group_api.rb +58 -51
- data/lib/trieve_ruby_client/api/dataset_api.rb +224 -15
- data/lib/trieve_ruby_client/api/events_api.rb +1 -1
- data/lib/trieve_ruby_client/api/file_api.rb +12 -12
- data/lib/trieve_ruby_client/api/health_api.rb +1 -1
- data/lib/trieve_ruby_client/api/invitation_api.rb +3 -3
- data/lib/trieve_ruby_client/api/message_api.rb +50 -50
- data/lib/trieve_ruby_client/api/organization_api.rb +27 -27
- data/lib/trieve_ruby_client/api/stripe_api.rb +1 -1
- data/lib/trieve_ruby_client/api/topic_api.rb +27 -27
- data/lib/trieve_ruby_client/api/user_api.rb +8 -8
- 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 +1 -1
- 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/api_key_resp_body.rb +325 -0
- data/lib/trieve_ruby_client/models/auth_query.rb +1 -1
- data/lib/trieve_ruby_client/models/autocomplete_data.rb +378 -0
- data/lib/trieve_ruby_client/models/autocomplete_req_payload.rb +467 -0
- data/lib/trieve_ruby_client/models/batch_queued_chunk_response.rb +1 -1
- 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/boost_phrase.rb +240 -0
- data/lib/trieve_ruby_client/models/chat_message_proxy.rb +1 -1
- data/lib/trieve_ruby_client/models/chunk_data.rb +15 -2
- data/lib/trieve_ruby_client/models/chunk_filter.rb +4 -4
- data/lib/trieve_ruby_client/models/chunk_group.rb +5 -3
- data/lib/trieve_ruby_client/models/chunk_group_and_file.rb +1 -1
- data/lib/trieve_ruby_client/models/chunk_metadata.rb +28 -20
- data/lib/trieve_ruby_client/models/chunk_metadata_string_tag_set.rb +387 -0
- data/lib/trieve_ruby_client/models/chunk_metadata_types.rb +106 -0
- data/lib/trieve_ruby_client/models/chunk_metadata_with_score.rb +2 -18
- data/lib/trieve_ruby_client/models/chunk_req_payload.rb +400 -0
- data/lib/trieve_ruby_client/models/client_dataset_configuration.rb +2 -18
- data/lib/trieve_ruby_client/models/condition_type.rb +105 -0
- data/lib/trieve_ruby_client/models/content_chunk_metadata.rb +299 -0
- data/lib/trieve_ruby_client/models/create_chunk_data.rb +1 -1
- data/lib/trieve_ruby_client/models/create_chunk_group_data.rb +1 -1
- data/lib/trieve_ruby_client/models/create_chunk_group_req_payload.rb +273 -0
- data/lib/trieve_ruby_client/models/create_chunk_req_payload_enum.rb +105 -0
- data/lib/trieve_ruby_client/models/create_dataset_request.rb +3 -3
- data/lib/trieve_ruby_client/models/create_message_data.rb +13 -13
- data/lib/trieve_ruby_client/models/create_message_req_payload.rb +378 -0
- 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/create_topic_req_payload.rb +244 -0
- data/lib/trieve_ruby_client/models/dataset.rb +18 -2
- 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/date_range.rb +245 -0
- 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/edit_message_req_payload.rb +395 -0
- 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 +12 -2
- data/lib/trieve_ruby_client/models/file.rb +5 -3
- data/lib/trieve_ruby_client/models/file_dto.rb +1 -1
- data/lib/trieve_ruby_client/models/generate_chunks_request.rb +13 -2
- data/lib/trieve_ruby_client/models/geo_info.rb +1 -1
- data/lib/trieve_ruby_client/models/geo_types.rb +1 -1
- data/lib/trieve_ruby_client/models/get_chunks_data.rb +1 -1
- data/lib/trieve_ruby_client/models/get_datasets_pagination.rb +225 -0
- data/lib/trieve_ruby_client/models/get_events_data.rb +1 -1
- data/lib/trieve_ruby_client/models/get_groups_for_chunks_data.rb +1 -1
- data/lib/trieve_ruby_client/models/get_tracking_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.rb +1 -1
- data/lib/trieve_ruby_client/models/group_score_slim_chunks.rb +22 -2
- data/lib/trieve_ruby_client/models/has_id_condition.rb +229 -0
- data/lib/trieve_ruby_client/models/invitation_data.rb +1 -1
- data/lib/trieve_ruby_client/models/location_bounding_box.rb +1 -1
- data/lib/trieve_ruby_client/models/location_polygon.rb +1 -1
- data/lib/trieve_ruby_client/models/location_radius.rb +1 -1
- data/lib/trieve_ruby_client/models/match_condition.rb +2 -1
- data/lib/trieve_ruby_client/models/message.rb +1 -1
- data/lib/trieve_ruby_client/models/organization.rb +18 -2
- 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/range_condition.rb +2 -3
- data/lib/trieve_ruby_client/models/recommend_chunks_request.rb +2 -2
- data/lib/trieve_ruby_client/models/recommend_group_chunks_request.rb +2 -2
- data/lib/trieve_ruby_client/models/regenerate_message_data.rb +1 -1
- data/lib/trieve_ruby_client/models/regenerate_message_req_payload.rb +361 -0
- data/lib/trieve_ruby_client/models/remove_chunk_from_group_req_payload.rb +222 -0
- data/lib/trieve_ruby_client/models/return_queued_chunk.rb +1 -1
- data/lib/trieve_ruby_client/models/score_chunk_dto.rb +15 -3
- data/lib/trieve_ruby_client/models/score_slim_chunks.rb +1 -1
- data/lib/trieve_ruby_client/models/search_chunk_data.rb +49 -14
- data/lib/trieve_ruby_client/models/search_chunk_query_response_body.rb +1 -1
- data/lib/trieve_ruby_client/models/search_chunks_req_payload.rb +504 -0
- data/lib/trieve_ruby_client/models/search_over_groups_data.rb +95 -6
- data/lib/trieve_ruby_client/models/search_over_groups_results.rb +1 -1
- data/lib/trieve_ruby_client/models/search_over_groups_slim_results.rb +1 -1
- data/lib/trieve_ruby_client/models/search_slim_chunk_query_response_body.rb +1 -1
- data/lib/trieve_ruby_client/models/search_within_group_data.rb +119 -17
- data/lib/trieve_ruby_client/models/search_within_group_results.rb +1 -1
- data/lib/trieve_ruby_client/models/search_within_group_slim_results.rb +1 -1
- data/lib/trieve_ruby_client/models/set_user_api_key_request.rb +28 -2
- 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 +1 -1
- data/lib/trieve_ruby_client/models/slim_chunk_metadata.rb +24 -2
- data/lib/trieve_ruby_client/models/slim_chunk_metadata_with_score.rb +1 -1
- 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_req_payload.rb +222 -0
- 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 +15 -2
- data/lib/trieve_ruby_client/models/update_chunk_group_data.rb +1 -1
- data/lib/trieve_ruby_client/models/update_chunk_req_payload.rb +376 -0
- data/lib/trieve_ruby_client/models/update_dataset_request.rb +13 -2
- data/lib/trieve_ruby_client/models/update_group_by_tracking_id_data.rb +1 -1
- data/lib/trieve_ruby_client/models/update_group_by_tracking_id_req_payload.rb +268 -0
- 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_topic_req_payload.rb +239 -0
- data/lib/trieve_ruby_client/models/update_user_org_role_data.rb +2 -2
- data/lib/trieve_ruby_client/models/upload_file_data.rb +1 -1
- data/lib/trieve_ruby_client/models/upload_file_req_payload.rb +368 -0
- 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 +25 -20
- data/openapi-generator.yaml +1 -1
- data/openapi.json +1 -7784
- data/spec/models/api_key_resp_body_spec.rb +78 -0
- data/spec/models/autocomplete_data_spec.rb +108 -0
- data/spec/models/autocomplete_req_payload_spec.rb +132 -0
- data/spec/models/boost_phrase_spec.rb +42 -0
- data/spec/models/chunk_metadata_string_tag_set_spec.rb +120 -0
- data/spec/models/chunk_metadata_types_spec.rb +32 -0
- data/spec/models/chunk_req_payload_spec.rb +132 -0
- data/spec/models/condition_type_spec.rb +32 -0
- data/spec/models/content_chunk_metadata_spec.rb +72 -0
- data/spec/models/create_chunk_group_req_payload_spec.rb +66 -0
- data/spec/models/create_chunk_req_payload_enum_spec.rb +32 -0
- data/spec/models/create_message_req_payload_spec.rb +108 -0
- data/spec/models/create_topic_req_payload_spec.rb +48 -0
- data/spec/models/date_range_spec.rb +54 -0
- data/spec/models/edit_message_req_payload_spec.rb +114 -0
- data/spec/models/get_datasets_pagination_spec.rb +42 -0
- data/spec/models/has_id_condition_spec.rb +42 -0
- data/spec/models/regenerate_message_req_payload_spec.rb +102 -0
- data/spec/models/remove_chunk_from_group_req_payload_spec.rb +36 -0
- data/spec/models/search_chunks_req_payload_spec.rb +144 -0
- data/spec/models/suggested_queries_req_payload_spec.rb +36 -0
- data/spec/models/update_chunk_req_payload_spec.rb +120 -0
- data/spec/models/update_group_by_tracking_id_req_payload_spec.rb +60 -0
- data/spec/models/update_topic_req_payload_spec.rb +42 -0
- data/spec/models/upload_file_req_payload_spec.rb +102 -0
- data/spec/spec_helper.rb +1 -1
- data/trieve_ruby_client-0.8.0.gem +0 -0
- data/trieve_ruby_client-0.8.2.gem +0 -0
- data/trieve_ruby_client-0.8.5.gem +0 -0
- data/trieve_ruby_client.gemspec +1 -1
- metadata +105 -2
@@ -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.10.7
|
7
7
|
Contact: developers@trieve.ai
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
9
|
Generator version: 7.4.0
|
@@ -17,6 +17,8 @@ module TrieveRubyClient
|
|
17
17
|
class Organization
|
18
18
|
attr_accessor :created_at
|
19
19
|
|
20
|
+
attr_accessor :deleted
|
21
|
+
|
20
22
|
attr_accessor :id
|
21
23
|
|
22
24
|
attr_accessor :name
|
@@ -29,6 +31,7 @@ module TrieveRubyClient
|
|
29
31
|
def self.attribute_map
|
30
32
|
{
|
31
33
|
:'created_at' => :'created_at',
|
34
|
+
:'deleted' => :'deleted',
|
32
35
|
:'id' => :'id',
|
33
36
|
:'name' => :'name',
|
34
37
|
:'registerable' => :'registerable',
|
@@ -45,6 +48,7 @@ module TrieveRubyClient
|
|
45
48
|
def self.openapi_types
|
46
49
|
{
|
47
50
|
:'created_at' => :'Time',
|
51
|
+
:'deleted' => :'Integer',
|
48
52
|
:'id' => :'String',
|
49
53
|
:'name' => :'String',
|
50
54
|
:'registerable' => :'Boolean',
|
@@ -80,6 +84,12 @@ module TrieveRubyClient
|
|
80
84
|
self.created_at = nil
|
81
85
|
end
|
82
86
|
|
87
|
+
if attributes.key?(:'deleted')
|
88
|
+
self.deleted = attributes[:'deleted']
|
89
|
+
else
|
90
|
+
self.deleted = nil
|
91
|
+
end
|
92
|
+
|
83
93
|
if attributes.key?(:'id')
|
84
94
|
self.id = attributes[:'id']
|
85
95
|
else
|
@@ -112,6 +122,10 @@ module TrieveRubyClient
|
|
112
122
|
invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
|
113
123
|
end
|
114
124
|
|
125
|
+
if @deleted.nil?
|
126
|
+
invalid_properties.push('invalid value for "deleted", deleted cannot be nil.')
|
127
|
+
end
|
128
|
+
|
115
129
|
if @id.nil?
|
116
130
|
invalid_properties.push('invalid value for "id", id cannot be nil.')
|
117
131
|
end
|
@@ -132,6 +146,7 @@ module TrieveRubyClient
|
|
132
146
|
def valid?
|
133
147
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
134
148
|
return false if @created_at.nil?
|
149
|
+
return false if @deleted.nil?
|
135
150
|
return false if @id.nil?
|
136
151
|
return false if @name.nil?
|
137
152
|
return false if @updated_at.nil?
|
@@ -144,6 +159,7 @@ module TrieveRubyClient
|
|
144
159
|
return true if self.equal?(o)
|
145
160
|
self.class == o.class &&
|
146
161
|
created_at == o.created_at &&
|
162
|
+
deleted == o.deleted &&
|
147
163
|
id == o.id &&
|
148
164
|
name == o.name &&
|
149
165
|
registerable == o.registerable &&
|
@@ -159,7 +175,7 @@ module TrieveRubyClient
|
|
159
175
|
# Calculates hash code according to all attributes.
|
160
176
|
# @return [Integer] Hash code
|
161
177
|
def hash
|
162
|
-
[created_at, id, name, registerable, updated_at].hash
|
178
|
+
[created_at, deleted, id, name, registerable, updated_at].hash
|
163
179
|
end
|
164
180
|
|
165
181
|
# Builds the object from hash
|
@@ -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.10.7
|
7
7
|
Contact: developers@trieve.ai
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
9
|
Generator version: 7.4.0
|
@@ -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.10.7
|
7
7
|
Contact: developers@trieve.ai
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
9
|
Generator version: 7.4.0
|
@@ -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.10.7
|
7
7
|
Contact: developers@trieve.ai
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
9
|
Generator version: 7.4.0
|
@@ -20,8 +20,7 @@ module TrieveRubyClient
|
|
20
20
|
def openapi_one_of
|
21
21
|
[
|
22
22
|
:'Float',
|
23
|
-
:'Integer'
|
24
|
-
:'String'
|
23
|
+
:'Integer'
|
25
24
|
]
|
26
25
|
end
|
27
26
|
|
@@ -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.10.7
|
7
7
|
Contact: developers@trieve.ai
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
9
|
Generator version: 7.4.0
|
@@ -35,7 +35,7 @@ module TrieveRubyClient
|
|
35
35
|
# The type of recommendation to make. This lets you choose whether to recommend based off of `semantic` or `fulltext` similarity. The default is `semantic`.
|
36
36
|
attr_accessor :recommend_type
|
37
37
|
|
38
|
-
# 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. Default is false.
|
38
|
+
# Set slim_chunks to true to avoid returning the content and chunk_html of the chunks. This is useful for when you want to reduce amount of data over the wire for latency improvement (typicall 10-50ms). Default is false.
|
39
39
|
attr_accessor :slim_chunks
|
40
40
|
|
41
41
|
# Strategy to use for recommendations, either \"average_vector\" or \"best_score\". The default is \"average_vector\". The \"average_vector\" strategy will construct a single average vector from the positive and negative samples then use it to perform a pseudo-search. The \"best_score\" strategy is more advanced and navigates the HNSW with a heuristic of picking edges where the point is closer to the positive samples than it is the negatives.
|
@@ -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.10.7
|
7
7
|
Contact: developers@trieve.ai
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
9
|
Generator version: 7.4.0
|
@@ -38,7 +38,7 @@ module TrieveRubyClient
|
|
38
38
|
# The type of recommendation to make. This lets you choose whether to recommend based off of `semantic` or `fulltext` similarity. The default is `semantic`.
|
39
39
|
attr_accessor :recommend_type
|
40
40
|
|
41
|
-
# 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. Default is false.
|
41
|
+
# Set slim_chunks to true to avoid returning the content and chunk_html of the chunks. This is useful for when you want to reduce amount of data over the wire for latency improvement (typicall 10-50ms). Default is false.
|
42
42
|
attr_accessor :slim_chunks
|
43
43
|
|
44
44
|
# Strategy to use for recommendations, either \"average_vector\" or \"best_score\". The default is \"average_vector\". The \"average_vector\" strategy will construct a single average vector from the positive and negative samples then use it to perform a pseudo-search. The \"best_score\" strategy is more advanced and navigates the HNSW with a heuristic of picking edges where the point is closer to the positive samples than it is the negatives.
|
@@ -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.8.
|
6
|
+
The version of the OpenAPI document: 0.8.5
|
7
7
|
Contact: developers@trieve.ai
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
9
|
Generator version: 7.4.0
|
@@ -0,0 +1,361 @@
|
|
1
|
+
=begin
|
2
|
+
#Trieve API
|
3
|
+
|
4
|
+
#Trieve OpenAPI Specification. This document describes all of the operations available through the Trieve API.
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 0.10.7
|
7
|
+
Contact: developers@trieve.ai
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
Generator version: 7.4.0
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
require 'time'
|
15
|
+
|
16
|
+
module TrieveRubyClient
|
17
|
+
class RegenerateMessageReqPayload
|
18
|
+
# Completion first decides whether the stream should contain the stream of the completion response or the chunks first. Default is false. Keep in mind that || is used to separate the chunks from the completion response. If || is in the completion then you may want to split on ||{ instead.
|
19
|
+
attr_accessor :completion_first
|
20
|
+
|
21
|
+
attr_accessor :filters
|
22
|
+
|
23
|
+
# Frequency penalty is a number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim. Default is 0.7.
|
24
|
+
attr_accessor :frequency_penalty
|
25
|
+
|
26
|
+
# Whether or not to highlight the citations in the response. If this is set to true or not included, the citations will be highlighted. If this is set to false, the citations will not be highlighted. Default is true.
|
27
|
+
attr_accessor :highlight_citations
|
28
|
+
|
29
|
+
# The delimiters to use for highlighting the citations. If this is not included, the default delimiters will be used. Default is `[\".\", \"!\", \"?\", \"\\n\", \"\\t\", \",\"]`.
|
30
|
+
attr_accessor :highlight_delimiters
|
31
|
+
|
32
|
+
# The maximum number of tokens to generate in the chat completion.
|
33
|
+
attr_accessor :max_tokens
|
34
|
+
|
35
|
+
# Presence penalty is a number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics.
|
36
|
+
attr_accessor :presence_penalty
|
37
|
+
|
38
|
+
# Search_type can be either \"semantic\", \"fulltext\", or \"hybrid\". \"hybrid\" will pull in one page (10 chunks) of both semantic and full-text results then re-rank them using BAAI/bge-reranker-large. \"semantic\" will pull in one page (10 chunks) of the nearest cosine distant vectors. \"fulltext\" will pull in one page (10 chunks) of full-text results based on SPLADE.
|
39
|
+
attr_accessor :search_type
|
40
|
+
|
41
|
+
# Stop tokens are up to 4 sequences where the API will stop generating further tokens.
|
42
|
+
attr_accessor :stop_tokens
|
43
|
+
|
44
|
+
# Whether or not to stream the response. If this is set to true or not included, the response will be a stream. If this is set to false, the response will be a normal JSON response. Default is true.
|
45
|
+
attr_accessor :stream_response
|
46
|
+
|
47
|
+
# What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. Default is 0.7.
|
48
|
+
attr_accessor :temperature
|
49
|
+
|
50
|
+
# The id of the topic to regenerate the last message for.
|
51
|
+
attr_accessor :topic_id
|
52
|
+
|
53
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
54
|
+
def self.attribute_map
|
55
|
+
{
|
56
|
+
:'completion_first' => :'completion_first',
|
57
|
+
:'filters' => :'filters',
|
58
|
+
:'frequency_penalty' => :'frequency_penalty',
|
59
|
+
:'highlight_citations' => :'highlight_citations',
|
60
|
+
:'highlight_delimiters' => :'highlight_delimiters',
|
61
|
+
:'max_tokens' => :'max_tokens',
|
62
|
+
:'presence_penalty' => :'presence_penalty',
|
63
|
+
:'search_type' => :'search_type',
|
64
|
+
:'stop_tokens' => :'stop_tokens',
|
65
|
+
:'stream_response' => :'stream_response',
|
66
|
+
:'temperature' => :'temperature',
|
67
|
+
:'topic_id' => :'topic_id'
|
68
|
+
}
|
69
|
+
end
|
70
|
+
|
71
|
+
# Returns all the JSON keys this model knows about
|
72
|
+
def self.acceptable_attributes
|
73
|
+
attribute_map.values
|
74
|
+
end
|
75
|
+
|
76
|
+
# Attribute type mapping.
|
77
|
+
def self.openapi_types
|
78
|
+
{
|
79
|
+
:'completion_first' => :'Boolean',
|
80
|
+
:'filters' => :'ChunkFilter',
|
81
|
+
:'frequency_penalty' => :'Float',
|
82
|
+
:'highlight_citations' => :'Boolean',
|
83
|
+
:'highlight_delimiters' => :'Array<String>',
|
84
|
+
:'max_tokens' => :'Integer',
|
85
|
+
:'presence_penalty' => :'Float',
|
86
|
+
:'search_type' => :'String',
|
87
|
+
:'stop_tokens' => :'Array<String>',
|
88
|
+
:'stream_response' => :'Boolean',
|
89
|
+
:'temperature' => :'Float',
|
90
|
+
:'topic_id' => :'String'
|
91
|
+
}
|
92
|
+
end
|
93
|
+
|
94
|
+
# List of attributes with nullable: true
|
95
|
+
def self.openapi_nullable
|
96
|
+
Set.new([
|
97
|
+
:'completion_first',
|
98
|
+
:'filters',
|
99
|
+
:'frequency_penalty',
|
100
|
+
:'highlight_citations',
|
101
|
+
:'highlight_delimiters',
|
102
|
+
:'max_tokens',
|
103
|
+
:'presence_penalty',
|
104
|
+
:'search_type',
|
105
|
+
:'stop_tokens',
|
106
|
+
:'stream_response',
|
107
|
+
:'temperature',
|
108
|
+
])
|
109
|
+
end
|
110
|
+
|
111
|
+
# Initializes the object
|
112
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
113
|
+
def initialize(attributes = {})
|
114
|
+
if (!attributes.is_a?(Hash))
|
115
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `TrieveRubyClient::RegenerateMessageReqPayload` initialize method"
|
116
|
+
end
|
117
|
+
|
118
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
119
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
120
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
121
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `TrieveRubyClient::RegenerateMessageReqPayload`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
122
|
+
end
|
123
|
+
h[k.to_sym] = v
|
124
|
+
}
|
125
|
+
|
126
|
+
if attributes.key?(:'completion_first')
|
127
|
+
self.completion_first = attributes[:'completion_first']
|
128
|
+
end
|
129
|
+
|
130
|
+
if attributes.key?(:'filters')
|
131
|
+
self.filters = attributes[:'filters']
|
132
|
+
end
|
133
|
+
|
134
|
+
if attributes.key?(:'frequency_penalty')
|
135
|
+
self.frequency_penalty = attributes[:'frequency_penalty']
|
136
|
+
end
|
137
|
+
|
138
|
+
if attributes.key?(:'highlight_citations')
|
139
|
+
self.highlight_citations = attributes[:'highlight_citations']
|
140
|
+
end
|
141
|
+
|
142
|
+
if attributes.key?(:'highlight_delimiters')
|
143
|
+
if (value = attributes[:'highlight_delimiters']).is_a?(Array)
|
144
|
+
self.highlight_delimiters = value
|
145
|
+
end
|
146
|
+
end
|
147
|
+
|
148
|
+
if attributes.key?(:'max_tokens')
|
149
|
+
self.max_tokens = attributes[:'max_tokens']
|
150
|
+
end
|
151
|
+
|
152
|
+
if attributes.key?(:'presence_penalty')
|
153
|
+
self.presence_penalty = attributes[:'presence_penalty']
|
154
|
+
end
|
155
|
+
|
156
|
+
if attributes.key?(:'search_type')
|
157
|
+
self.search_type = attributes[:'search_type']
|
158
|
+
end
|
159
|
+
|
160
|
+
if attributes.key?(:'stop_tokens')
|
161
|
+
if (value = attributes[:'stop_tokens']).is_a?(Array)
|
162
|
+
self.stop_tokens = value
|
163
|
+
end
|
164
|
+
end
|
165
|
+
|
166
|
+
if attributes.key?(:'stream_response')
|
167
|
+
self.stream_response = attributes[:'stream_response']
|
168
|
+
end
|
169
|
+
|
170
|
+
if attributes.key?(:'temperature')
|
171
|
+
self.temperature = attributes[:'temperature']
|
172
|
+
end
|
173
|
+
|
174
|
+
if attributes.key?(:'topic_id')
|
175
|
+
self.topic_id = attributes[:'topic_id']
|
176
|
+
else
|
177
|
+
self.topic_id = nil
|
178
|
+
end
|
179
|
+
end
|
180
|
+
|
181
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
182
|
+
# @return Array for valid properties with the reasons
|
183
|
+
def list_invalid_properties
|
184
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
185
|
+
invalid_properties = Array.new
|
186
|
+
if !@max_tokens.nil? && @max_tokens < 0
|
187
|
+
invalid_properties.push('invalid value for "max_tokens", must be greater than or equal to 0.')
|
188
|
+
end
|
189
|
+
|
190
|
+
if @topic_id.nil?
|
191
|
+
invalid_properties.push('invalid value for "topic_id", topic_id cannot be nil.')
|
192
|
+
end
|
193
|
+
|
194
|
+
invalid_properties
|
195
|
+
end
|
196
|
+
|
197
|
+
# Check to see if the all the properties in the model are valid
|
198
|
+
# @return true if the model is valid
|
199
|
+
def valid?
|
200
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
201
|
+
return false if !@max_tokens.nil? && @max_tokens < 0
|
202
|
+
return false if @topic_id.nil?
|
203
|
+
true
|
204
|
+
end
|
205
|
+
|
206
|
+
# Custom attribute writer method with validation
|
207
|
+
# @param [Object] max_tokens Value to be assigned
|
208
|
+
def max_tokens=(max_tokens)
|
209
|
+
if !max_tokens.nil? && max_tokens < 0
|
210
|
+
fail ArgumentError, 'invalid value for "max_tokens", must be greater than or equal to 0.'
|
211
|
+
end
|
212
|
+
|
213
|
+
@max_tokens = max_tokens
|
214
|
+
end
|
215
|
+
|
216
|
+
# Checks equality by comparing each attribute.
|
217
|
+
# @param [Object] Object to be compared
|
218
|
+
def ==(o)
|
219
|
+
return true if self.equal?(o)
|
220
|
+
self.class == o.class &&
|
221
|
+
completion_first == o.completion_first &&
|
222
|
+
filters == o.filters &&
|
223
|
+
frequency_penalty == o.frequency_penalty &&
|
224
|
+
highlight_citations == o.highlight_citations &&
|
225
|
+
highlight_delimiters == o.highlight_delimiters &&
|
226
|
+
max_tokens == o.max_tokens &&
|
227
|
+
presence_penalty == o.presence_penalty &&
|
228
|
+
search_type == o.search_type &&
|
229
|
+
stop_tokens == o.stop_tokens &&
|
230
|
+
stream_response == o.stream_response &&
|
231
|
+
temperature == o.temperature &&
|
232
|
+
topic_id == o.topic_id
|
233
|
+
end
|
234
|
+
|
235
|
+
# @see the `==` method
|
236
|
+
# @param [Object] Object to be compared
|
237
|
+
def eql?(o)
|
238
|
+
self == o
|
239
|
+
end
|
240
|
+
|
241
|
+
# Calculates hash code according to all attributes.
|
242
|
+
# @return [Integer] Hash code
|
243
|
+
def hash
|
244
|
+
[completion_first, filters, frequency_penalty, highlight_citations, highlight_delimiters, max_tokens, presence_penalty, search_type, stop_tokens, stream_response, temperature, topic_id].hash
|
245
|
+
end
|
246
|
+
|
247
|
+
# Builds the object from hash
|
248
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
249
|
+
# @return [Object] Returns the model itself
|
250
|
+
def self.build_from_hash(attributes)
|
251
|
+
return nil unless attributes.is_a?(Hash)
|
252
|
+
attributes = attributes.transform_keys(&:to_sym)
|
253
|
+
transformed_hash = {}
|
254
|
+
openapi_types.each_pair do |key, type|
|
255
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
256
|
+
transformed_hash["#{key}"] = nil
|
257
|
+
elsif type =~ /\AArray<(.*)>/i
|
258
|
+
# check to ensure the input is an array given that the attribute
|
259
|
+
# is documented as an array but the input is not
|
260
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
261
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
262
|
+
end
|
263
|
+
elsif !attributes[attribute_map[key]].nil?
|
264
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
265
|
+
end
|
266
|
+
end
|
267
|
+
new(transformed_hash)
|
268
|
+
end
|
269
|
+
|
270
|
+
# Deserializes the data based on type
|
271
|
+
# @param string type Data type
|
272
|
+
# @param string value Value to be deserialized
|
273
|
+
# @return [Object] Deserialized data
|
274
|
+
def self._deserialize(type, value)
|
275
|
+
case type.to_sym
|
276
|
+
when :Time
|
277
|
+
Time.parse(value)
|
278
|
+
when :Date
|
279
|
+
Date.parse(value)
|
280
|
+
when :String
|
281
|
+
value.to_s
|
282
|
+
when :Integer
|
283
|
+
value.to_i
|
284
|
+
when :Float
|
285
|
+
value.to_f
|
286
|
+
when :Boolean
|
287
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
288
|
+
true
|
289
|
+
else
|
290
|
+
false
|
291
|
+
end
|
292
|
+
when :Object
|
293
|
+
# generic object (usually a Hash), return directly
|
294
|
+
value
|
295
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
296
|
+
inner_type = Regexp.last_match[:inner_type]
|
297
|
+
value.map { |v| _deserialize(inner_type, v) }
|
298
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
299
|
+
k_type = Regexp.last_match[:k_type]
|
300
|
+
v_type = Regexp.last_match[:v_type]
|
301
|
+
{}.tap do |hash|
|
302
|
+
value.each do |k, v|
|
303
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
304
|
+
end
|
305
|
+
end
|
306
|
+
else # model
|
307
|
+
# models (e.g. Pet) or oneOf
|
308
|
+
klass = TrieveRubyClient.const_get(type)
|
309
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
310
|
+
end
|
311
|
+
end
|
312
|
+
|
313
|
+
# Returns the string representation of the object
|
314
|
+
# @return [String] String presentation of the object
|
315
|
+
def to_s
|
316
|
+
to_hash.to_s
|
317
|
+
end
|
318
|
+
|
319
|
+
# to_body is an alias to to_hash (backward compatibility)
|
320
|
+
# @return [Hash] Returns the object in the form of hash
|
321
|
+
def to_body
|
322
|
+
to_hash
|
323
|
+
end
|
324
|
+
|
325
|
+
# Returns the object in the form of hash
|
326
|
+
# @return [Hash] Returns the object in the form of hash
|
327
|
+
def to_hash
|
328
|
+
hash = {}
|
329
|
+
self.class.attribute_map.each_pair do |attr, param|
|
330
|
+
value = self.send(attr)
|
331
|
+
if value.nil?
|
332
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
333
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
334
|
+
end
|
335
|
+
|
336
|
+
hash[param] = _to_hash(value)
|
337
|
+
end
|
338
|
+
hash
|
339
|
+
end
|
340
|
+
|
341
|
+
# Outputs non-array value in the form of hash
|
342
|
+
# For object, use to_hash. Otherwise, just return the value
|
343
|
+
# @param [Object] value Any valid value
|
344
|
+
# @return [Hash] Returns the value in the form of hash
|
345
|
+
def _to_hash(value)
|
346
|
+
if value.is_a?(Array)
|
347
|
+
value.compact.map { |v| _to_hash(v) }
|
348
|
+
elsif value.is_a?(Hash)
|
349
|
+
{}.tap do |hash|
|
350
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
351
|
+
end
|
352
|
+
elsif value.respond_to? :to_hash
|
353
|
+
value.to_hash
|
354
|
+
else
|
355
|
+
value
|
356
|
+
end
|
357
|
+
end
|
358
|
+
|
359
|
+
end
|
360
|
+
|
361
|
+
end
|