ragie_ruby_sdk 1.0.15 → 1.0.17

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.
Files changed (55) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +20 -5
  3. data/docs/BetaApi.md +140 -0
  4. data/docs/CodeInterpreterOutput.md +28 -0
  5. data/docs/CodeInterpreterOutputLogs.md +20 -0
  6. data/docs/FileSearchOutput.md +26 -0
  7. data/docs/FileSearchResult.md +26 -0
  8. data/docs/FinalAnswerStepsInner.md +4 -0
  9. data/docs/PartitionsApi.md +140 -0
  10. data/docs/QueryDetails.md +24 -0
  11. data/docs/ReasoningOutput.md +28 -0
  12. data/docs/ReasoningSummary.md +20 -0
  13. data/docs/ReasoningText.md +20 -0
  14. data/docs/Response.md +1 -1
  15. data/docs/ResponseOutputInner.md +40 -0
  16. data/docs/{ResponseOutput.md → ResponseOutputMessage.md} +2 -2
  17. data/docs/SearchEffort.md +15 -0
  18. data/docs/SearchStep.md +1 -1
  19. data/docs/SearchStepWithQueryDetails.md +24 -0
  20. data/lib/ragie_ruby_sdk/api/beta_api.rb +126 -0
  21. data/lib/ragie_ruby_sdk/api/partitions_api.rb +126 -0
  22. data/lib/ragie_ruby_sdk/models/code_interpreter_output.rb +389 -0
  23. data/lib/ragie_ruby_sdk/models/code_interpreter_output_logs.rb +283 -0
  24. data/lib/ragie_ruby_sdk/models/file_search_output.rb +368 -0
  25. data/lib/ragie_ruby_sdk/models/file_search_result.rb +348 -0
  26. data/lib/ragie_ruby_sdk/models/final_answer_steps_inner.rb +1 -0
  27. data/lib/ragie_ruby_sdk/models/metadata_value.rb +1 -0
  28. data/lib/ragie_ruby_sdk/models/query_details.rb +341 -0
  29. data/lib/ragie_ruby_sdk/models/reasoning_output.rb +391 -0
  30. data/lib/ragie_ruby_sdk/models/reasoning_summary.rb +283 -0
  31. data/lib/ragie_ruby_sdk/models/reasoning_text.rb +283 -0
  32. data/lib/ragie_ruby_sdk/models/response.rb +1 -1
  33. data/lib/ragie_ruby_sdk/models/response_output_inner.rb +105 -0
  34. data/lib/ragie_ruby_sdk/models/{response_output.rb → response_output_message.rb} +3 -3
  35. data/lib/ragie_ruby_sdk/models/search_effort.rb +41 -0
  36. data/lib/ragie_ruby_sdk/models/search_step.rb +3 -3
  37. data/lib/ragie_ruby_sdk/models/search_step_with_query_details.rb +306 -0
  38. data/lib/ragie_ruby_sdk/version.rb +1 -1
  39. data/lib/ragie_ruby_sdk.rb +12 -1
  40. data/spec/api/beta_api_spec.rb +24 -0
  41. data/spec/api/partitions_api_spec.rb +24 -0
  42. data/spec/models/code_interpreter_output_logs_spec.rb +46 -0
  43. data/spec/models/code_interpreter_output_spec.rb +74 -0
  44. data/spec/models/file_search_output_spec.rb +68 -0
  45. data/spec/models/file_search_result_spec.rb +60 -0
  46. data/spec/models/query_details_spec.rb +54 -0
  47. data/spec/models/reasoning_output_spec.rb +74 -0
  48. data/spec/models/reasoning_summary_spec.rb +46 -0
  49. data/spec/models/reasoning_text_spec.rb +46 -0
  50. data/spec/models/response_output_inner_spec.rb +21 -0
  51. data/spec/models/{response_output_spec.rb → response_output_message_spec.rb} +6 -6
  52. data/spec/models/search_effort_spec.rb +30 -0
  53. data/spec/models/search_step_spec.rb +1 -1
  54. data/spec/models/search_step_with_query_details_spec.rb +58 -0
  55. metadata +49 -5
@@ -24,6 +24,7 @@ module RagieRubySdk
24
24
  :'EvaluatedAnswerStep',
25
25
  :'PlanStep',
26
26
  :'SearchStep',
27
+ :'SearchStepWithQueryDetails',
27
28
  :'SurrenderStep'
28
29
  ]
29
30
  end
@@ -21,6 +21,7 @@ module RagieRubySdk
21
21
  [
22
22
  :'Array<String>',
23
23
  :'Boolean',
24
+ :'Float',
24
25
  :'Integer',
25
26
  :'String'
26
27
  ]
@@ -0,0 +1,341 @@
1
+ =begin
2
+ #Ragie API
3
+
4
+ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.17.0-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module RagieRubySdk
17
+ class QueryDetails
18
+ attr_accessor :query
19
+
20
+ attr_accessor :search_effort
21
+
22
+ attr_accessor :metadata_filter
23
+
24
+ attr_accessor :search_results
25
+
26
+ class EnumAttributeValidator
27
+ attr_reader :datatype
28
+ attr_reader :allowable_values
29
+
30
+ def initialize(datatype, allowable_values)
31
+ @allowable_values = allowable_values.map do |value|
32
+ case datatype.to_s
33
+ when /Integer/i
34
+ value.to_i
35
+ when /Float/i
36
+ value.to_f
37
+ else
38
+ value
39
+ end
40
+ end
41
+ end
42
+
43
+ def valid?(value)
44
+ !value || allowable_values.include?(value)
45
+ end
46
+ end
47
+
48
+ # Attribute mapping from ruby-style variable name to JSON key.
49
+ def self.attribute_map
50
+ {
51
+ :'query' => :'query',
52
+ :'search_effort' => :'search_effort',
53
+ :'metadata_filter' => :'metadata_filter',
54
+ :'search_results' => :'search_results'
55
+ }
56
+ end
57
+
58
+ # Returns attribute mapping this model knows about
59
+ def self.acceptable_attribute_map
60
+ attribute_map
61
+ end
62
+
63
+ # Returns all the JSON keys this model knows about
64
+ def self.acceptable_attributes
65
+ acceptable_attribute_map.values
66
+ end
67
+
68
+ # Attribute type mapping.
69
+ def self.openapi_types
70
+ {
71
+ :'query' => :'String',
72
+ :'search_effort' => :'SearchEffort',
73
+ :'metadata_filter' => :'Hash<String, Object>',
74
+ :'search_results' => :'Array<RagieEvidence>'
75
+ }
76
+ end
77
+
78
+ # List of attributes with nullable: true
79
+ def self.openapi_nullable
80
+ Set.new([
81
+ ])
82
+ end
83
+
84
+ # Initializes the object
85
+ # @param [Hash] attributes Model attributes in the form of hash
86
+ def initialize(attributes = {})
87
+ if (!attributes.is_a?(Hash))
88
+ fail ArgumentError, "The input argument (attributes) must be a hash in `RagieRubySdk::QueryDetails` initialize method"
89
+ end
90
+
91
+ # check to see if the attribute exists and convert string to symbol for hash key
92
+ acceptable_attribute_map = self.class.acceptable_attribute_map
93
+ attributes = attributes.each_with_object({}) { |(k, v), h|
94
+ if (!acceptable_attribute_map.key?(k.to_sym))
95
+ fail ArgumentError, "`#{k}` is not a valid attribute in `RagieRubySdk::QueryDetails`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
96
+ end
97
+ h[k.to_sym] = v
98
+ }
99
+
100
+ if attributes.key?(:'query')
101
+ self.query = attributes[:'query']
102
+ else
103
+ self.query = nil
104
+ end
105
+
106
+ if attributes.key?(:'search_effort')
107
+ self.search_effort = attributes[:'search_effort']
108
+ else
109
+ self.search_effort = nil
110
+ end
111
+
112
+ if attributes.key?(:'metadata_filter')
113
+ if (value = attributes[:'metadata_filter']).is_a?(Hash)
114
+ self.metadata_filter = value
115
+ end
116
+ else
117
+ self.metadata_filter = nil
118
+ end
119
+
120
+ if attributes.key?(:'search_results')
121
+ if (value = attributes[:'search_results']).is_a?(Array)
122
+ self.search_results = value
123
+ end
124
+ else
125
+ self.search_results = nil
126
+ end
127
+ end
128
+
129
+ # Show invalid properties with the reasons. Usually used together with valid?
130
+ # @return Array for valid properties with the reasons
131
+ def list_invalid_properties
132
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
133
+ invalid_properties = Array.new
134
+ if @query.nil?
135
+ invalid_properties.push('invalid value for "query", query cannot be nil.')
136
+ end
137
+
138
+ if @search_effort.nil?
139
+ invalid_properties.push('invalid value for "search_effort", search_effort cannot be nil.')
140
+ end
141
+
142
+ if @metadata_filter.nil?
143
+ invalid_properties.push('invalid value for "metadata_filter", metadata_filter cannot be nil.')
144
+ end
145
+
146
+ if @search_results.nil?
147
+ invalid_properties.push('invalid value for "search_results", search_results cannot be nil.')
148
+ end
149
+
150
+ invalid_properties
151
+ end
152
+
153
+ # Check to see if the all the properties in the model are valid
154
+ # @return true if the model is valid
155
+ def valid?
156
+ warn '[DEPRECATED] the `valid?` method is obsolete'
157
+ return false if @query.nil?
158
+ return false if @search_effort.nil?
159
+ return false if @metadata_filter.nil?
160
+ return false if @search_results.nil?
161
+ true
162
+ end
163
+
164
+ # Custom attribute writer method with validation
165
+ # @param [Object] query Value to be assigned
166
+ def query=(query)
167
+ if query.nil?
168
+ fail ArgumentError, 'query cannot be nil'
169
+ end
170
+
171
+ @query = query
172
+ end
173
+
174
+ # Custom attribute writer method with validation
175
+ # @param [Object] search_effort Value to be assigned
176
+ def search_effort=(search_effort)
177
+ if search_effort.nil?
178
+ fail ArgumentError, 'search_effort cannot be nil'
179
+ end
180
+
181
+ @search_effort = search_effort
182
+ end
183
+
184
+ # Custom attribute writer method with validation
185
+ # @param [Object] metadata_filter Value to be assigned
186
+ def metadata_filter=(metadata_filter)
187
+ if metadata_filter.nil?
188
+ fail ArgumentError, 'metadata_filter cannot be nil'
189
+ end
190
+
191
+ @metadata_filter = metadata_filter
192
+ end
193
+
194
+ # Custom attribute writer method with validation
195
+ # @param [Object] search_results Value to be assigned
196
+ def search_results=(search_results)
197
+ if search_results.nil?
198
+ fail ArgumentError, 'search_results cannot be nil'
199
+ end
200
+
201
+ @search_results = search_results
202
+ end
203
+
204
+ # Checks equality by comparing each attribute.
205
+ # @param [Object] Object to be compared
206
+ def ==(o)
207
+ return true if self.equal?(o)
208
+ self.class == o.class &&
209
+ query == o.query &&
210
+ search_effort == o.search_effort &&
211
+ metadata_filter == o.metadata_filter &&
212
+ search_results == o.search_results
213
+ end
214
+
215
+ # @see the `==` method
216
+ # @param [Object] Object to be compared
217
+ def eql?(o)
218
+ self == o
219
+ end
220
+
221
+ # Calculates hash code according to all attributes.
222
+ # @return [Integer] Hash code
223
+ def hash
224
+ [query, search_effort, metadata_filter, search_results].hash
225
+ end
226
+
227
+ # Builds the object from hash
228
+ # @param [Hash] attributes Model attributes in the form of hash
229
+ # @return [Object] Returns the model itself
230
+ def self.build_from_hash(attributes)
231
+ return nil unless attributes.is_a?(Hash)
232
+ attributes = attributes.transform_keys(&:to_sym)
233
+ transformed_hash = {}
234
+ openapi_types.each_pair do |key, type|
235
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
236
+ transformed_hash["#{key}"] = nil
237
+ elsif type =~ /\AArray<(.*)>/i
238
+ # check to ensure the input is an array given that the attribute
239
+ # is documented as an array but the input is not
240
+ if attributes[attribute_map[key]].is_a?(Array)
241
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
242
+ end
243
+ elsif !attributes[attribute_map[key]].nil?
244
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
245
+ end
246
+ end
247
+ new(transformed_hash)
248
+ end
249
+
250
+ # Deserializes the data based on type
251
+ # @param string type Data type
252
+ # @param string value Value to be deserialized
253
+ # @return [Object] Deserialized data
254
+ def self._deserialize(type, value)
255
+ case type.to_sym
256
+ when :Time
257
+ Time.parse(value)
258
+ when :Date
259
+ Date.parse(value)
260
+ when :String
261
+ value.to_s
262
+ when :Integer
263
+ value.to_i
264
+ when :Float
265
+ value.to_f
266
+ when :Boolean
267
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
268
+ true
269
+ else
270
+ false
271
+ end
272
+ when :Object
273
+ # generic object (usually a Hash), return directly
274
+ value
275
+ when /\AArray<(?<inner_type>.+)>\z/
276
+ inner_type = Regexp.last_match[:inner_type]
277
+ value.map { |v| _deserialize(inner_type, v) }
278
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
279
+ k_type = Regexp.last_match[:k_type]
280
+ v_type = Regexp.last_match[:v_type]
281
+ {}.tap do |hash|
282
+ value.each do |k, v|
283
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
284
+ end
285
+ end
286
+ else # model
287
+ # models (e.g. Pet) or oneOf
288
+ klass = RagieRubySdk.const_get(type)
289
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
290
+ end
291
+ end
292
+
293
+ # Returns the string representation of the object
294
+ # @return [String] String presentation of the object
295
+ def to_s
296
+ to_hash.to_s
297
+ end
298
+
299
+ # to_body is an alias to to_hash (backward compatibility)
300
+ # @return [Hash] Returns the object in the form of hash
301
+ def to_body
302
+ to_hash
303
+ end
304
+
305
+ # Returns the object in the form of hash
306
+ # @return [Hash] Returns the object in the form of hash
307
+ def to_hash
308
+ hash = {}
309
+ self.class.attribute_map.each_pair do |attr, param|
310
+ value = self.send(attr)
311
+ if value.nil?
312
+ is_nullable = self.class.openapi_nullable.include?(attr)
313
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
314
+ end
315
+
316
+ hash[param] = _to_hash(value)
317
+ end
318
+ hash
319
+ end
320
+
321
+ # Outputs non-array value in the form of hash
322
+ # For object, use to_hash. Otherwise, just return the value
323
+ # @param [Object] value Any valid value
324
+ # @return [Hash] Returns the value in the form of hash
325
+ def _to_hash(value)
326
+ if value.is_a?(Array)
327
+ value.compact.map { |v| _to_hash(v) }
328
+ elsif value.is_a?(Hash)
329
+ {}.tap do |hash|
330
+ value.each { |k, v| hash[k] = _to_hash(v) }
331
+ end
332
+ elsif value.respond_to? :to_hash
333
+ value.to_hash
334
+ else
335
+ value
336
+ end
337
+ end
338
+
339
+ end
340
+
341
+ end