carbon_ruby_sdk 0.1.17 → 0.1.19

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 41b973ad8e62b552db19546d3a3755e4c16c9212de8cf9ea371ce39d1a505387
4
- data.tar.gz: 18d9889d6e9f99f2c02d97408d4620d1c768eb7d2519f9cbebccedef375dd3c7
3
+ metadata.gz: 780eaed0011d89334b59a18257211702cc3d7a6fe51edf77f3f9664e7ba88587
4
+ data.tar.gz: 26fd3c24eb43a87f249a680d348012d01b50907d39caa93fb1567b9ca1bc8488
5
5
  SHA512:
6
- metadata.gz: 8e66f4386a86fb62c0da7a79ddb0dc197b6de76a90ba267913d79e2136ee58e92b42f5ddc591c45b5e171b450e557276c2429d91e8f49937eab0cd8b13c1b58f
7
- data.tar.gz: bb3f6bb1a28029ea0312dd539720c4d2f5cae934817d240eeee4b8b24a7ce27a663e584e2c44c7837a47f54f8d48784227eb7c13f0f50ef0164ca05c3174921e
6
+ metadata.gz: '09abc5f33ef39442d0212d4e07729b6c992da4385ba18e54b11ef912bdf71b317f9645804805d5d6ca4d41002d4ea5cb04803a145220107c3a1fe39c6e365ffd'
7
+ data.tar.gz: 4fd4c17f76483be12e2233987173206283c2d98a255189e7cd6701a52a328f1dbdd20913443f3015de19d705be619e67f3e0966c632a9387bd56ecd7a55fd882
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- carbon_ruby_sdk (0.1.17)
4
+ carbon_ruby_sdk (0.1.19)
5
5
  faraday (>= 1.0.1, < 3.0)
6
6
  faraday-multipart (~> 1.0, >= 1.0.4)
7
7
 
@@ -42,7 +42,7 @@ GEM
42
42
  rainbow (3.1.1)
43
43
  rake (13.0.6)
44
44
  regexp_parser (2.9.0)
45
- reline (0.5.0)
45
+ reline (0.4.2)
46
46
  io-console (~> 0.5)
47
47
  rexml (3.2.6)
48
48
  rspec (3.13.0)
@@ -67,14 +67,14 @@ GEM
67
67
  rubocop-ast (>= 1.2.0, < 2.0)
68
68
  ruby-progressbar (~> 1.7)
69
69
  unicode-display_width (>= 1.4.0, < 3.0)
70
- rubocop-ast (1.31.2)
71
- parser (>= 3.3.0.4)
70
+ rubocop-ast (1.30.0)
71
+ parser (>= 3.2.1.0)
72
72
  ruby-progressbar (1.13.0)
73
73
  unicode-display_width (2.5.0)
74
74
  uri (0.13.0)
75
75
 
76
76
  PLATFORMS
77
- arm64-darwin-22
77
+ arm64-darwin-21
78
78
 
79
79
  DEPENDENCIES
80
80
  carbon_ruby_sdk!
@@ -86,4 +86,4 @@ DEPENDENCIES
86
86
  rubocop (~> 1.12.1)
87
87
 
88
88
  BUNDLED WITH
89
- 2.4.19
89
+ 2.3.7
data/README.md CHANGED
@@ -6,7 +6,7 @@
6
6
 
7
7
  Connect external data to LLMs, no matter the source.
8
8
 
9
- [![npm](https://img.shields.io/badge/gem-v0.1.17-blue)](https://rubygems.org/gems/carbon_ruby_sdk/versions/0.1.17)
9
+ [![npm](https://img.shields.io/badge/gem-v0.1.19-blue)](https://rubygems.org/gems/carbon_ruby_sdk/versions/0.1.19)
10
10
 
11
11
  </div>
12
12
 
@@ -80,7 +80,7 @@ Connect external data to LLMs, no matter the source.
80
80
  Add to Gemfile:
81
81
 
82
82
  ```ruby
83
- gem 'carbon_ruby_sdk', '~> 0.1.17'
83
+ gem 'carbon_ruby_sdk', '~> 0.1.19'
84
84
  ```
85
85
 
86
86
  ## Getting Started<a id="getting-started"></a>
@@ -356,6 +356,7 @@ result = carbon.embeddings.get_documents(
356
356
  parent_file_ids: [
357
357
  1
358
358
  ],
359
+ include_all_children: false,
359
360
  tags_v2: {
360
361
  },
361
362
  include_tags: true,
@@ -397,6 +398,10 @@ Optional list of file IDs to limit the search to
397
398
  Optional list of parent file IDs to limit the search to. A parent file describes
398
399
  a file to which another file belongs (e.g. a folder)
399
400
 
401
+ ##### include_all_children: `Boolean`<a id="include_all_children-boolean"></a>
402
+ Flag to control whether or not to include all children of filtered files in the
403
+ embedding search.
404
+
400
405
  ##### tags_v2: `Object`<a id="tags_v2-object"></a>
401
406
  A set of tags to limit the search to. Use this instead of `tags`, which is
402
407
  deprecated.
@@ -1434,7 +1439,7 @@ Enable OCR for files that support it. Supported formats: pdf
1434
1439
  ##### parse_pdf_tables_with_ocr: `Boolean`<a id="parse_pdf_tables_with_ocr-boolean"></a>
1435
1440
  ##### enable_file_picker: `Boolean`<a id="enable_file_picker-boolean"></a>
1436
1441
  Enable integration's file picker for sources that support it. Supported sources:
1437
- DROPBOX, BOX, GOOGLE_DRIVE, SHAREPOINT, ONEDRIVE
1442
+ BOX, DROPBOX, SHAREPOINT, GOOGLE_DRIVE, ONEDRIVE
1438
1443
 
1439
1444
  #### 🔄 Return<a id="🔄-return"></a>
1440
1445
 
@@ -119,6 +119,7 @@ module Carbon
119
119
  # @param query_vector [Array<Float>] Optional query vector for which to get related chunks and embeddings. It must have been generated by the same model used to generate the embeddings across which the search is being conducted. Cannot provide both `query` and `query_vector`.
120
120
  # @param file_ids [Array<Integer>] Optional list of file IDs to limit the search to
121
121
  # @param parent_file_ids [Array<Integer>] Optional list of parent file IDs to limit the search to. A parent file describes a file to which another file belongs (e.g. a folder)
122
+ # @param include_all_children [Boolean] Flag to control whether or not to include all children of filtered files in the embedding search.
122
123
  # @param tags_v2 [Object] A set of tags to limit the search to. Use this instead of `tags`, which is deprecated.
123
124
  # @param include_tags [Boolean] Flag to control whether or not to include tags for each chunk in the response.
124
125
  # @param include_vectors [Boolean] Flag to control whether or not to include embedding vectors in the response.
@@ -129,7 +130,7 @@ module Carbon
129
130
  # @param embedding_model [EmbeddingGeneratorsNullable]
130
131
  # @param body [GetEmbeddingDocumentsBody]
131
132
  # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
132
- def get_documents(query:, k:, tags: SENTINEL, query_vector: SENTINEL, file_ids: SENTINEL, parent_file_ids: SENTINEL, tags_v2: SENTINEL, include_tags: SENTINEL, include_vectors: SENTINEL, include_raw_file: SENTINEL, hybrid_search: SENTINEL, hybrid_search_tuning_parameters: SENTINEL, media_type: 'TEXT', embedding_model: 'OPENAI', extra: {})
133
+ def get_documents(query:, k:, tags: SENTINEL, query_vector: SENTINEL, file_ids: SENTINEL, parent_file_ids: SENTINEL, include_all_children: false, tags_v2: SENTINEL, include_tags: SENTINEL, include_vectors: SENTINEL, include_raw_file: SENTINEL, hybrid_search: SENTINEL, hybrid_search_tuning_parameters: SENTINEL, media_type: 'TEXT', embedding_model: 'OPENAI', extra: {})
133
134
  _body = {}
134
135
  _body[:tags] = tags if tags != SENTINEL
135
136
  _body[:query] = query if query != SENTINEL
@@ -137,6 +138,7 @@ module Carbon
137
138
  _body[:k] = k if k != SENTINEL
138
139
  _body[:file_ids] = file_ids if file_ids != SENTINEL
139
140
  _body[:parent_file_ids] = parent_file_ids if parent_file_ids != SENTINEL
141
+ _body[:include_all_children] = include_all_children if include_all_children != SENTINEL
140
142
  _body[:tags_v2] = tags_v2 if tags_v2 != SENTINEL
141
143
  _body[:include_tags] = include_tags if include_tags != SENTINEL
142
144
  _body[:include_vectors] = include_vectors if include_vectors != SENTINEL
@@ -253,6 +255,7 @@ module Carbon
253
255
  # @param query_vector [Array<Float>] Optional query vector for which to get related chunks and embeddings. It must have been generated by the same model used to generate the embeddings across which the search is being conducted. Cannot provide both `query` and `query_vector`.
254
256
  # @param file_ids [Array<Integer>] Optional list of file IDs to limit the search to
255
257
  # @param parent_file_ids [Array<Integer>] Optional list of parent file IDs to limit the search to. A parent file describes a file to which another file belongs (e.g. a folder)
258
+ # @param include_all_children [Boolean] Flag to control whether or not to include all children of filtered files in the embedding search.
256
259
  # @param tags_v2 [Object] A set of tags to limit the search to. Use this instead of `tags`, which is deprecated.
257
260
  # @param include_tags [Boolean] Flag to control whether or not to include tags for each chunk in the response.
258
261
  # @param include_vectors [Boolean] Flag to control whether or not to include embedding vectors in the response.
@@ -263,7 +266,7 @@ module Carbon
263
266
  # @param embedding_model [EmbeddingGeneratorsNullable]
264
267
  # @param body [GetEmbeddingDocumentsBody]
265
268
  # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
266
- def get_documents_with_http_info(query:, k:, tags: SENTINEL, query_vector: SENTINEL, file_ids: SENTINEL, parent_file_ids: SENTINEL, tags_v2: SENTINEL, include_tags: SENTINEL, include_vectors: SENTINEL, include_raw_file: SENTINEL, hybrid_search: SENTINEL, hybrid_search_tuning_parameters: SENTINEL, media_type: 'TEXT', embedding_model: 'OPENAI', extra: {})
269
+ def get_documents_with_http_info(query:, k:, tags: SENTINEL, query_vector: SENTINEL, file_ids: SENTINEL, parent_file_ids: SENTINEL, include_all_children: false, tags_v2: SENTINEL, include_tags: SENTINEL, include_vectors: SENTINEL, include_raw_file: SENTINEL, hybrid_search: SENTINEL, hybrid_search_tuning_parameters: SENTINEL, media_type: 'TEXT', embedding_model: 'OPENAI', extra: {})
267
270
  _body = {}
268
271
  _body[:tags] = tags if tags != SENTINEL
269
272
  _body[:query] = query if query != SENTINEL
@@ -271,6 +274,7 @@ module Carbon
271
274
  _body[:k] = k if k != SENTINEL
272
275
  _body[:file_ids] = file_ids if file_ids != SENTINEL
273
276
  _body[:parent_file_ids] = parent_file_ids if parent_file_ids != SENTINEL
277
+ _body[:include_all_children] = include_all_children if include_all_children != SENTINEL
274
278
  _body[:tags_v2] = tags_v2 if tags_v2 != SENTINEL
275
279
  _body[:include_tags] = include_tags if include_tags != SENTINEL
276
280
  _body[:include_vectors] = include_vectors if include_vectors != SENTINEL
@@ -545,7 +545,7 @@ module Carbon
545
545
  # @param request_id [String] This request id will be added to all files that get synced using the generated OAuth URL
546
546
  # @param use_ocr [Boolean] Enable OCR for files that support it. Supported formats: pdf
547
547
  # @param parse_pdf_tables_with_ocr [Boolean]
548
- # @param enable_file_picker [Boolean] Enable integration's file picker for sources that support it. Supported sources: DROPBOX, BOX, GOOGLE_DRIVE, SHAREPOINT, ONEDRIVE
548
+ # @param enable_file_picker [Boolean] Enable integration's file picker for sources that support it. Supported sources: BOX, DROPBOX, SHAREPOINT, GOOGLE_DRIVE, ONEDRIVE
549
549
  # @param body [OAuthURLRequest]
550
550
  # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
551
551
  def get_oauth_url(service:, tags: SENTINEL, scope: SENTINEL, chunk_size: 1500, chunk_overlap: 20, skip_embedding_generation: false, embedding_model: 'OPENAI', zendesk_subdomain: SENTINEL, microsoft_tenant: SENTINEL, sharepoint_site_name: SENTINEL, confluence_subdomain: SENTINEL, generate_sparse_vectors: false, prepend_filename_to_chunks: false, max_items_per_chunk: SENTINEL, salesforce_domain: SENTINEL, sync_files_on_connection: true, set_page_as_boundary: false, data_source_id: SENTINEL, connecting_new_account: false, request_id: SENTINEL, use_ocr: false, parse_pdf_tables_with_ocr: false, enable_file_picker: true, extra: {})
@@ -607,7 +607,7 @@ module Carbon
607
607
  # @param request_id [String] This request id will be added to all files that get synced using the generated OAuth URL
608
608
  # @param use_ocr [Boolean] Enable OCR for files that support it. Supported formats: pdf
609
609
  # @param parse_pdf_tables_with_ocr [Boolean]
610
- # @param enable_file_picker [Boolean] Enable integration's file picker for sources that support it. Supported sources: DROPBOX, BOX, GOOGLE_DRIVE, SHAREPOINT, ONEDRIVE
610
+ # @param enable_file_picker [Boolean] Enable integration's file picker for sources that support it. Supported sources: BOX, DROPBOX, SHAREPOINT, GOOGLE_DRIVE, ONEDRIVE
611
611
  # @param body [OAuthURLRequest]
612
612
  # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
613
613
  def get_oauth_url_with_http_info(service:, tags: SENTINEL, scope: SENTINEL, chunk_size: 1500, chunk_overlap: 20, skip_embedding_generation: false, embedding_model: 'OPENAI', zendesk_subdomain: SENTINEL, microsoft_tenant: SENTINEL, sharepoint_site_name: SENTINEL, confluence_subdomain: SENTINEL, generate_sparse_vectors: false, prepend_filename_to_chunks: false, max_items_per_chunk: SENTINEL, salesforce_domain: SENTINEL, sync_files_on_connection: true, set_page_as_boundary: false, data_source_id: SENTINEL, connecting_new_account: false, request_id: SENTINEL, use_ocr: false, parse_pdf_tables_with_ocr: false, enable_file_picker: true, extra: {})
@@ -29,6 +29,9 @@ module Carbon
29
29
  # Optional list of parent file IDs to limit the search to. A parent file describes a file to which another file belongs (e.g. a folder)
30
30
  attr_accessor :parent_file_ids
31
31
 
32
+ # Flag to control whether or not to include all children of filtered files in the embedding search.
33
+ attr_accessor :include_all_children
34
+
32
35
  # A set of tags to limit the search to. Use this instead of `tags`, which is deprecated.
33
36
  attr_accessor :tags_v2
34
37
 
@@ -60,6 +63,7 @@ module Carbon
60
63
  :'k' => :'k',
61
64
  :'file_ids' => :'file_ids',
62
65
  :'parent_file_ids' => :'parent_file_ids',
66
+ :'include_all_children' => :'include_all_children',
63
67
  :'tags_v2' => :'tags_v2',
64
68
  :'include_tags' => :'include_tags',
65
69
  :'include_vectors' => :'include_vectors',
@@ -85,6 +89,7 @@ module Carbon
85
89
  :'k' => :'Integer',
86
90
  :'file_ids' => :'Array<Integer>',
87
91
  :'parent_file_ids' => :'Array<Integer>',
92
+ :'include_all_children' => :'Boolean',
88
93
  :'tags_v2' => :'Object',
89
94
  :'include_tags' => :'Boolean',
90
95
  :'include_vectors' => :'Boolean',
@@ -161,6 +166,12 @@ module Carbon
161
166
  end
162
167
  end
163
168
 
169
+ if attributes.key?(:'include_all_children')
170
+ self.include_all_children = attributes[:'include_all_children']
171
+ else
172
+ self.include_all_children = false
173
+ end
174
+
164
175
  if attributes.key?(:'tags_v2')
165
176
  self.tags_v2 = attributes[:'tags_v2']
166
177
  end
@@ -270,6 +281,7 @@ module Carbon
270
281
  k == o.k &&
271
282
  file_ids == o.file_ids &&
272
283
  parent_file_ids == o.parent_file_ids &&
284
+ include_all_children == o.include_all_children &&
273
285
  tags_v2 == o.tags_v2 &&
274
286
  include_tags == o.include_tags &&
275
287
  include_vectors == o.include_vectors &&
@@ -289,7 +301,7 @@ module Carbon
289
301
  # Calculates hash code according to all attributes.
290
302
  # @return [Integer] Hash code
291
303
  def hash
292
- [tags, query, query_vector, k, file_ids, parent_file_ids, tags_v2, include_tags, include_vectors, include_raw_file, hybrid_search, hybrid_search_tuning_parameters, media_type, embedding_model].hash
304
+ [tags, query, query_vector, k, file_ids, parent_file_ids, include_all_children, tags_v2, include_tags, include_vectors, include_raw_file, hybrid_search, hybrid_search_tuning_parameters, media_type, embedding_model].hash
293
305
  end
294
306
 
295
307
  # Builds the object from hash
@@ -61,7 +61,7 @@ module Carbon
61
61
 
62
62
  attr_accessor :parse_pdf_tables_with_ocr
63
63
 
64
- # Enable integration's file picker for sources that support it. Supported sources: DROPBOX, BOX, GOOGLE_DRIVE, SHAREPOINT, ONEDRIVE
64
+ # Enable integration's file picker for sources that support it. Supported sources: BOX, DROPBOX, SHAREPOINT, GOOGLE_DRIVE, ONEDRIVE
65
65
  attr_accessor :enable_file_picker
66
66
 
67
67
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -33,6 +33,8 @@ module Carbon
33
33
 
34
34
  attr_accessor :set_page_as_boundary
35
35
 
36
+ attr_accessor :request_id
37
+
36
38
  attr_accessor :enable_file_picker
37
39
 
38
40
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -48,6 +50,7 @@ module Carbon
48
50
  :'max_items_per_chunk' => :'max_items_per_chunk',
49
51
  :'sync_files_on_connection' => :'sync_files_on_connection',
50
52
  :'set_page_as_boundary' => :'set_page_as_boundary',
53
+ :'request_id' => :'request_id',
51
54
  :'enable_file_picker' => :'enable_file_picker'
52
55
  }
53
56
  end
@@ -70,6 +73,7 @@ module Carbon
70
73
  :'max_items_per_chunk' => :'Integer',
71
74
  :'sync_files_on_connection' => :'Boolean',
72
75
  :'set_page_as_boundary' => :'Boolean',
76
+ :'request_id' => :'String',
73
77
  :'enable_file_picker' => :'Boolean'
74
78
  }
75
79
  end
@@ -86,6 +90,7 @@ module Carbon
86
90
  :'prepend_filename_to_chunks',
87
91
  :'max_items_per_chunk',
88
92
  :'sync_files_on_connection',
93
+ :'request_id',
89
94
  ])
90
95
  end
91
96
 
@@ -160,6 +165,10 @@ module Carbon
160
165
  self.set_page_as_boundary = false
161
166
  end
162
167
 
168
+ if attributes.key?(:'request_id')
169
+ self.request_id = attributes[:'request_id']
170
+ end
171
+
163
172
  if attributes.key?(:'enable_file_picker')
164
173
  self.enable_file_picker = attributes[:'enable_file_picker']
165
174
  else
@@ -195,6 +204,7 @@ module Carbon
195
204
  max_items_per_chunk == o.max_items_per_chunk &&
196
205
  sync_files_on_connection == o.sync_files_on_connection &&
197
206
  set_page_as_boundary == o.set_page_as_boundary &&
207
+ request_id == o.request_id &&
198
208
  enable_file_picker == o.enable_file_picker
199
209
  end
200
210
 
@@ -207,7 +217,7 @@ module Carbon
207
217
  # Calculates hash code according to all attributes.
208
218
  # @return [Integer] Hash code
209
219
  def hash
210
- [tags, chunk_size, chunk_overlap, skip_embedding_generation, embedding_model, generate_sparse_vectors, prepend_filename_to_chunks, max_items_per_chunk, sync_files_on_connection, set_page_as_boundary, enable_file_picker].hash
220
+ [tags, chunk_size, chunk_overlap, skip_embedding_generation, embedding_model, generate_sparse_vectors, prepend_filename_to_chunks, max_items_per_chunk, sync_files_on_connection, set_page_as_boundary, request_id, enable_file_picker].hash
211
221
  end
212
222
 
213
223
  # Builds the object from hash
@@ -7,5 +7,5 @@ The version of the OpenAPI document: 1.0.0
7
7
  =end
8
8
 
9
9
  module Carbon
10
- VERSION = '0.1.17'
10
+ VERSION = '0.1.19'
11
11
  end
@@ -55,6 +55,12 @@ describe Carbon::GetEmbeddingDocumentsBody do
55
55
  end
56
56
  end
57
57
 
58
+ describe 'test attribute "include_all_children"' do
59
+ it 'should work' do
60
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
61
+ end
62
+ end
63
+
58
64
  describe 'test attribute "tags_v2"' do
59
65
  it 'should work' do
60
66
  # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
@@ -79,6 +79,12 @@ describe Carbon::SyncOptions do
79
79
  end
80
80
  end
81
81
 
82
+ describe 'test attribute "request_id"' do
83
+ it 'should work' do
84
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
85
+ end
86
+ end
87
+
82
88
  describe 'test attribute "enable_file_picker"' do
83
89
  it 'should work' do
84
90
  # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: carbon_ruby_sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.17
4
+ version: 0.1.19
5
5
  platform: ruby
6
6
  authors:
7
7
  - Konfig
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-04-12 00:00:00.000000000 Z
11
+ date: 2024-04-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -372,7 +372,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
372
372
  - !ruby/object:Gem::Version
373
373
  version: '0'
374
374
  requirements: []
375
- rubygems_version: 3.4.10
375
+ rubygems_version: 3.3.7
376
376
  signing_key:
377
377
  specification_version: 4
378
378
  summary: Carbon Ruby Gem