ragie_ruby_sdk 1.0.12 → 1.0.13

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 (86) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +31 -4
  3. data/docs/AgentHoppsModelsModelsUsage.md +18 -0
  4. data/docs/Answer.md +20 -0
  5. data/docs/AnswerStep.md +26 -0
  6. data/docs/CodeInterpreterEvidence.md +26 -0
  7. data/docs/CodeStep.md +28 -0
  8. data/docs/EvaluatedAnswerStep.md +30 -0
  9. data/docs/FinalAnswer.md +24 -0
  10. data/docs/FinalAnswerEvidenceInner.md +40 -0
  11. data/docs/FinalAnswerStepsInner.md +42 -0
  12. data/docs/InputTokenDetails.md +18 -0
  13. data/docs/IntercomData.md +3 -1
  14. data/docs/ModelUsage.md +22 -0
  15. data/docs/OutputTokenDetails.md +18 -0
  16. data/docs/PlanStep.md +24 -0
  17. data/docs/RagieApiSchemaResponseUsage.md +26 -0
  18. data/docs/RagieEvidence.md +34 -0
  19. data/docs/Reasoning.md +20 -0
  20. data/docs/Request.md +28 -0
  21. data/docs/Response.md +62 -0
  22. data/docs/ResponseContent.md +22 -0
  23. data/docs/ResponseOutput.md +24 -0
  24. data/docs/ResponsesApi.md +147 -0
  25. data/docs/Search.md +18 -0
  26. data/docs/SearchResultLink.md +20 -0
  27. data/docs/SearchStep.md +24 -0
  28. data/docs/SurrenderStep.md +24 -0
  29. data/docs/Tool.md +20 -0
  30. data/lib/ragie_ruby_sdk/api/responses_api.rb +153 -0
  31. data/lib/ragie_ruby_sdk/models/agent_hopps_models_models_usage.rb +222 -0
  32. data/lib/ragie_ruby_sdk/models/answer.rb +265 -0
  33. data/lib/ragie_ruby_sdk/models/answer_step.rb +346 -0
  34. data/lib/ragie_ruby_sdk/models/code_interpreter_evidence.rb +360 -0
  35. data/lib/ragie_ruby_sdk/models/code_step.rb +359 -0
  36. data/lib/ragie_ruby_sdk/models/evaluated_answer_step.rb +398 -0
  37. data/lib/ragie_ruby_sdk/models/final_answer.rb +319 -0
  38. data/lib/ragie_ruby_sdk/models/final_answer_evidence_inner.rb +103 -0
  39. data/lib/ragie_ruby_sdk/models/final_answer_steps_inner.rb +107 -0
  40. data/lib/ragie_ruby_sdk/models/input_token_details.rb +222 -0
  41. data/lib/ragie_ruby_sdk/models/intercom_data.rb +14 -4
  42. data/lib/ragie_ruby_sdk/models/model_usage.rb +289 -0
  43. data/lib/ragie_ruby_sdk/models/output_token_details.rb +222 -0
  44. data/lib/ragie_ruby_sdk/models/plan_step.rb +336 -0
  45. data/lib/ragie_ruby_sdk/models/ragie_api_schema_response_usage.rb +307 -0
  46. data/lib/ragie_ruby_sdk/models/ragie_evidence.rb +419 -0
  47. data/lib/ragie_ruby_sdk/models/reasoning.rb +271 -0
  48. data/lib/ragie_ruby_sdk/models/request.rb +328 -0
  49. data/lib/ragie_ruby_sdk/models/response.rb +638 -0
  50. data/lib/ragie_ruby_sdk/models/response_content.rb +293 -0
  51. data/lib/ragie_ruby_sdk/models/response_output.rb +333 -0
  52. data/lib/ragie_ruby_sdk/models/search.rb +239 -0
  53. data/lib/ragie_ruby_sdk/models/search_result_link.rb +263 -0
  54. data/lib/ragie_ruby_sdk/models/search_step.rb +334 -0
  55. data/lib/ragie_ruby_sdk/models/surrender_step.rb +334 -0
  56. data/lib/ragie_ruby_sdk/models/tool.rb +289 -0
  57. data/lib/ragie_ruby_sdk/version.rb +1 -1
  58. data/lib/ragie_ruby_sdk.rb +26 -0
  59. data/spec/api/responses_api_spec.rb +59 -0
  60. data/spec/models/agent_hopps_models_models_usage_spec.rb +36 -0
  61. data/spec/models/answer_spec.rb +42 -0
  62. data/spec/models/answer_step_spec.rb +64 -0
  63. data/spec/models/code_interpreter_evidence_spec.rb +64 -0
  64. data/spec/models/code_step_spec.rb +70 -0
  65. data/spec/models/evaluated_answer_step_spec.rb +76 -0
  66. data/spec/models/final_answer_evidence_inner_spec.rb +21 -0
  67. data/spec/models/final_answer_spec.rb +54 -0
  68. data/spec/models/final_answer_steps_inner_spec.rb +21 -0
  69. data/spec/models/input_token_details_spec.rb +36 -0
  70. data/spec/models/intercom_data_spec.rb +6 -0
  71. data/spec/models/model_usage_spec.rb +48 -0
  72. data/spec/models/output_token_details_spec.rb +36 -0
  73. data/spec/models/plan_step_spec.rb +58 -0
  74. data/spec/models/ragie_api_schema_response_usage_spec.rb +60 -0
  75. data/spec/models/ragie_evidence_spec.rb +88 -0
  76. data/spec/models/reasoning_spec.rb +46 -0
  77. data/spec/models/request_spec.rb +70 -0
  78. data/spec/models/response_content_spec.rb +52 -0
  79. data/spec/models/response_output_spec.rb +62 -0
  80. data/spec/models/response_spec.rb +188 -0
  81. data/spec/models/search_result_link_spec.rb +42 -0
  82. data/spec/models/search_spec.rb +36 -0
  83. data/spec/models/search_step_spec.rb +58 -0
  84. data/spec/models/surrender_step_spec.rb +58 -0
  85. data/spec/models/tool_spec.rb +46 -0
  86. metadata +105 -1
@@ -0,0 +1,359 @@
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.16.0-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module RagieRubySdk
17
+ class CodeStep
18
+ attr_accessor :type
19
+
20
+ attr_accessor :think
21
+
22
+ attr_accessor :current_question
23
+
24
+ # The natural language description of the code issue you need to solve.
25
+ attr_accessor :code_issue
26
+
27
+ # The code you generated to solve the code issue.
28
+ attr_accessor :code
29
+
30
+ # The result of the code you generated after executing it.
31
+ attr_accessor :code_result
32
+
33
+ class EnumAttributeValidator
34
+ attr_reader :datatype
35
+ attr_reader :allowable_values
36
+
37
+ def initialize(datatype, allowable_values)
38
+ @allowable_values = allowable_values.map do |value|
39
+ case datatype.to_s
40
+ when /Integer/i
41
+ value.to_i
42
+ when /Float/i
43
+ value.to_f
44
+ else
45
+ value
46
+ end
47
+ end
48
+ end
49
+
50
+ def valid?(value)
51
+ !value || allowable_values.include?(value)
52
+ end
53
+ end
54
+
55
+ # Attribute mapping from ruby-style variable name to JSON key.
56
+ def self.attribute_map
57
+ {
58
+ :'type' => :'type',
59
+ :'think' => :'think',
60
+ :'current_question' => :'current_question',
61
+ :'code_issue' => :'code_issue',
62
+ :'code' => :'code',
63
+ :'code_result' => :'code_result'
64
+ }
65
+ end
66
+
67
+ # Returns attribute mapping this model knows about
68
+ def self.acceptable_attribute_map
69
+ attribute_map
70
+ end
71
+
72
+ # Returns all the JSON keys this model knows about
73
+ def self.acceptable_attributes
74
+ acceptable_attribute_map.values
75
+ end
76
+
77
+ # Attribute type mapping.
78
+ def self.openapi_types
79
+ {
80
+ :'type' => :'String',
81
+ :'think' => :'String',
82
+ :'current_question' => :'String',
83
+ :'code_issue' => :'String',
84
+ :'code' => :'String',
85
+ :'code_result' => :'String'
86
+ }
87
+ end
88
+
89
+ # List of attributes with nullable: true
90
+ def self.openapi_nullable
91
+ Set.new([
92
+ ])
93
+ end
94
+
95
+ # Initializes the object
96
+ # @param [Hash] attributes Model attributes in the form of hash
97
+ def initialize(attributes = {})
98
+ if (!attributes.is_a?(Hash))
99
+ fail ArgumentError, "The input argument (attributes) must be a hash in `RagieRubySdk::CodeStep` initialize method"
100
+ end
101
+
102
+ # check to see if the attribute exists and convert string to symbol for hash key
103
+ acceptable_attribute_map = self.class.acceptable_attribute_map
104
+ attributes = attributes.each_with_object({}) { |(k, v), h|
105
+ if (!acceptable_attribute_map.key?(k.to_sym))
106
+ fail ArgumentError, "`#{k}` is not a valid attribute in `RagieRubySdk::CodeStep`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
107
+ end
108
+ h[k.to_sym] = v
109
+ }
110
+
111
+ if attributes.key?(:'type')
112
+ self.type = attributes[:'type']
113
+ else
114
+ self.type = 'code'
115
+ end
116
+
117
+ if attributes.key?(:'think')
118
+ self.think = attributes[:'think']
119
+ else
120
+ self.think = nil
121
+ end
122
+
123
+ if attributes.key?(:'current_question')
124
+ self.current_question = attributes[:'current_question']
125
+ else
126
+ self.current_question = nil
127
+ end
128
+
129
+ if attributes.key?(:'code_issue')
130
+ self.code_issue = attributes[:'code_issue']
131
+ else
132
+ self.code_issue = nil
133
+ end
134
+
135
+ if attributes.key?(:'code')
136
+ self.code = attributes[:'code']
137
+ else
138
+ self.code = ''
139
+ end
140
+
141
+ if attributes.key?(:'code_result')
142
+ self.code_result = attributes[:'code_result']
143
+ else
144
+ self.code_result = ''
145
+ end
146
+ end
147
+
148
+ # Show invalid properties with the reasons. Usually used together with valid?
149
+ # @return Array for valid properties with the reasons
150
+ def list_invalid_properties
151
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
152
+ invalid_properties = Array.new
153
+ if @think.nil?
154
+ invalid_properties.push('invalid value for "think", think cannot be nil.')
155
+ end
156
+
157
+ if @current_question.nil?
158
+ invalid_properties.push('invalid value for "current_question", current_question cannot be nil.')
159
+ end
160
+
161
+ if @code_issue.nil?
162
+ invalid_properties.push('invalid value for "code_issue", code_issue cannot be nil.')
163
+ end
164
+
165
+ invalid_properties
166
+ end
167
+
168
+ # Check to see if the all the properties in the model are valid
169
+ # @return true if the model is valid
170
+ def valid?
171
+ warn '[DEPRECATED] the `valid?` method is obsolete'
172
+ type_validator = EnumAttributeValidator.new('String', ["code"])
173
+ return false unless type_validator.valid?(@type)
174
+ return false if @think.nil?
175
+ return false if @current_question.nil?
176
+ return false if @code_issue.nil?
177
+ true
178
+ end
179
+
180
+ # Custom attribute writer method checking allowed values (enum).
181
+ # @param [Object] type Object to be assigned
182
+ def type=(type)
183
+ validator = EnumAttributeValidator.new('String', ["code"])
184
+ unless validator.valid?(type)
185
+ fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
186
+ end
187
+ @type = type
188
+ end
189
+
190
+ # Custom attribute writer method with validation
191
+ # @param [Object] think Value to be assigned
192
+ def think=(think)
193
+ if think.nil?
194
+ fail ArgumentError, 'think cannot be nil'
195
+ end
196
+
197
+ @think = think
198
+ end
199
+
200
+ # Custom attribute writer method with validation
201
+ # @param [Object] current_question Value to be assigned
202
+ def current_question=(current_question)
203
+ if current_question.nil?
204
+ fail ArgumentError, 'current_question cannot be nil'
205
+ end
206
+
207
+ @current_question = current_question
208
+ end
209
+
210
+ # Custom attribute writer method with validation
211
+ # @param [Object] code_issue Value to be assigned
212
+ def code_issue=(code_issue)
213
+ if code_issue.nil?
214
+ fail ArgumentError, 'code_issue cannot be nil'
215
+ end
216
+
217
+ @code_issue = code_issue
218
+ end
219
+
220
+ # Checks equality by comparing each attribute.
221
+ # @param [Object] Object to be compared
222
+ def ==(o)
223
+ return true if self.equal?(o)
224
+ self.class == o.class &&
225
+ type == o.type &&
226
+ think == o.think &&
227
+ current_question == o.current_question &&
228
+ code_issue == o.code_issue &&
229
+ code == o.code &&
230
+ code_result == o.code_result
231
+ end
232
+
233
+ # @see the `==` method
234
+ # @param [Object] Object to be compared
235
+ def eql?(o)
236
+ self == o
237
+ end
238
+
239
+ # Calculates hash code according to all attributes.
240
+ # @return [Integer] Hash code
241
+ def hash
242
+ [type, think, current_question, code_issue, code, code_result].hash
243
+ end
244
+
245
+ # Builds the object from hash
246
+ # @param [Hash] attributes Model attributes in the form of hash
247
+ # @return [Object] Returns the model itself
248
+ def self.build_from_hash(attributes)
249
+ return nil unless attributes.is_a?(Hash)
250
+ attributes = attributes.transform_keys(&:to_sym)
251
+ transformed_hash = {}
252
+ openapi_types.each_pair do |key, type|
253
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
254
+ transformed_hash["#{key}"] = nil
255
+ elsif type =~ /\AArray<(.*)>/i
256
+ # check to ensure the input is an array given that the attribute
257
+ # is documented as an array but the input is not
258
+ if attributes[attribute_map[key]].is_a?(Array)
259
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
260
+ end
261
+ elsif !attributes[attribute_map[key]].nil?
262
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
263
+ end
264
+ end
265
+ new(transformed_hash)
266
+ end
267
+
268
+ # Deserializes the data based on type
269
+ # @param string type Data type
270
+ # @param string value Value to be deserialized
271
+ # @return [Object] Deserialized data
272
+ def self._deserialize(type, value)
273
+ case type.to_sym
274
+ when :Time
275
+ Time.parse(value)
276
+ when :Date
277
+ Date.parse(value)
278
+ when :String
279
+ value.to_s
280
+ when :Integer
281
+ value.to_i
282
+ when :Float
283
+ value.to_f
284
+ when :Boolean
285
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
286
+ true
287
+ else
288
+ false
289
+ end
290
+ when :Object
291
+ # generic object (usually a Hash), return directly
292
+ value
293
+ when /\AArray<(?<inner_type>.+)>\z/
294
+ inner_type = Regexp.last_match[:inner_type]
295
+ value.map { |v| _deserialize(inner_type, v) }
296
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
297
+ k_type = Regexp.last_match[:k_type]
298
+ v_type = Regexp.last_match[:v_type]
299
+ {}.tap do |hash|
300
+ value.each do |k, v|
301
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
302
+ end
303
+ end
304
+ else # model
305
+ # models (e.g. Pet) or oneOf
306
+ klass = RagieRubySdk.const_get(type)
307
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
308
+ end
309
+ end
310
+
311
+ # Returns the string representation of the object
312
+ # @return [String] String presentation of the object
313
+ def to_s
314
+ to_hash.to_s
315
+ end
316
+
317
+ # to_body is an alias to to_hash (backward compatibility)
318
+ # @return [Hash] Returns the object in the form of hash
319
+ def to_body
320
+ to_hash
321
+ end
322
+
323
+ # Returns the object in the form of hash
324
+ # @return [Hash] Returns the object in the form of hash
325
+ def to_hash
326
+ hash = {}
327
+ self.class.attribute_map.each_pair do |attr, param|
328
+ value = self.send(attr)
329
+ if value.nil?
330
+ is_nullable = self.class.openapi_nullable.include?(attr)
331
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
332
+ end
333
+
334
+ hash[param] = _to_hash(value)
335
+ end
336
+ hash
337
+ end
338
+
339
+ # Outputs non-array value in the form of hash
340
+ # For object, use to_hash. Otherwise, just return the value
341
+ # @param [Object] value Any valid value
342
+ # @return [Hash] Returns the value in the form of hash
343
+ def _to_hash(value)
344
+ if value.is_a?(Array)
345
+ value.compact.map { |v| _to_hash(v) }
346
+ elsif value.is_a?(Hash)
347
+ {}.tap do |hash|
348
+ value.each { |k, v| hash[k] = _to_hash(v) }
349
+ end
350
+ elsif value.respond_to? :to_hash
351
+ value.to_hash
352
+ else
353
+ value
354
+ end
355
+ end
356
+
357
+ end
358
+
359
+ end