ragie_ruby_sdk 1.0.12 → 1.0.14

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 +250 -0
  33. data/lib/ragie_ruby_sdk/models/answer_step.rb +346 -0
  34. data/lib/ragie_ruby_sdk/models/code_interpreter_evidence.rb +363 -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 +272 -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 +320 -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 +426 -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 +335 -0
  55. data/lib/ragie_ruby_sdk/models/surrender_step.rb +335 -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,222 @@
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 AgentHoppsModelsModelsUsage
18
+ attr_accessor :models
19
+
20
+ # Attribute mapping from ruby-style variable name to JSON key.
21
+ def self.attribute_map
22
+ {
23
+ :'models' => :'models'
24
+ }
25
+ end
26
+
27
+ # Returns attribute mapping this model knows about
28
+ def self.acceptable_attribute_map
29
+ attribute_map
30
+ end
31
+
32
+ # Returns all the JSON keys this model knows about
33
+ def self.acceptable_attributes
34
+ acceptable_attribute_map.values
35
+ end
36
+
37
+ # Attribute type mapping.
38
+ def self.openapi_types
39
+ {
40
+ :'models' => :'Array<ModelUsage>'
41
+ }
42
+ end
43
+
44
+ # List of attributes with nullable: true
45
+ def self.openapi_nullable
46
+ Set.new([
47
+ ])
48
+ end
49
+
50
+ # Initializes the object
51
+ # @param [Hash] attributes Model attributes in the form of hash
52
+ def initialize(attributes = {})
53
+ if (!attributes.is_a?(Hash))
54
+ fail ArgumentError, "The input argument (attributes) must be a hash in `RagieRubySdk::AgentHoppsModelsModelsUsage` initialize method"
55
+ end
56
+
57
+ # check to see if the attribute exists and convert string to symbol for hash key
58
+ acceptable_attribute_map = self.class.acceptable_attribute_map
59
+ attributes = attributes.each_with_object({}) { |(k, v), h|
60
+ if (!acceptable_attribute_map.key?(k.to_sym))
61
+ fail ArgumentError, "`#{k}` is not a valid attribute in `RagieRubySdk::AgentHoppsModelsModelsUsage`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
62
+ end
63
+ h[k.to_sym] = v
64
+ }
65
+
66
+ if attributes.key?(:'models')
67
+ if (value = attributes[:'models']).is_a?(Array)
68
+ self.models = value
69
+ end
70
+ end
71
+ end
72
+
73
+ # Show invalid properties with the reasons. Usually used together with valid?
74
+ # @return Array for valid properties with the reasons
75
+ def list_invalid_properties
76
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
77
+ invalid_properties = Array.new
78
+ invalid_properties
79
+ end
80
+
81
+ # Check to see if the all the properties in the model are valid
82
+ # @return true if the model is valid
83
+ def valid?
84
+ warn '[DEPRECATED] the `valid?` method is obsolete'
85
+ true
86
+ end
87
+
88
+ # Checks equality by comparing each attribute.
89
+ # @param [Object] Object to be compared
90
+ def ==(o)
91
+ return true if self.equal?(o)
92
+ self.class == o.class &&
93
+ models == o.models
94
+ end
95
+
96
+ # @see the `==` method
97
+ # @param [Object] Object to be compared
98
+ def eql?(o)
99
+ self == o
100
+ end
101
+
102
+ # Calculates hash code according to all attributes.
103
+ # @return [Integer] Hash code
104
+ def hash
105
+ [models].hash
106
+ end
107
+
108
+ # Builds the object from hash
109
+ # @param [Hash] attributes Model attributes in the form of hash
110
+ # @return [Object] Returns the model itself
111
+ def self.build_from_hash(attributes)
112
+ return nil unless attributes.is_a?(Hash)
113
+ attributes = attributes.transform_keys(&:to_sym)
114
+ transformed_hash = {}
115
+ openapi_types.each_pair do |key, type|
116
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
117
+ transformed_hash["#{key}"] = nil
118
+ elsif type =~ /\AArray<(.*)>/i
119
+ # check to ensure the input is an array given that the attribute
120
+ # is documented as an array but the input is not
121
+ if attributes[attribute_map[key]].is_a?(Array)
122
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
123
+ end
124
+ elsif !attributes[attribute_map[key]].nil?
125
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
126
+ end
127
+ end
128
+ new(transformed_hash)
129
+ end
130
+
131
+ # Deserializes the data based on type
132
+ # @param string type Data type
133
+ # @param string value Value to be deserialized
134
+ # @return [Object] Deserialized data
135
+ def self._deserialize(type, value)
136
+ case type.to_sym
137
+ when :Time
138
+ Time.parse(value)
139
+ when :Date
140
+ Date.parse(value)
141
+ when :String
142
+ value.to_s
143
+ when :Integer
144
+ value.to_i
145
+ when :Float
146
+ value.to_f
147
+ when :Boolean
148
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
149
+ true
150
+ else
151
+ false
152
+ end
153
+ when :Object
154
+ # generic object (usually a Hash), return directly
155
+ value
156
+ when /\AArray<(?<inner_type>.+)>\z/
157
+ inner_type = Regexp.last_match[:inner_type]
158
+ value.map { |v| _deserialize(inner_type, v) }
159
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
160
+ k_type = Regexp.last_match[:k_type]
161
+ v_type = Regexp.last_match[:v_type]
162
+ {}.tap do |hash|
163
+ value.each do |k, v|
164
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
165
+ end
166
+ end
167
+ else # model
168
+ # models (e.g. Pet) or oneOf
169
+ klass = RagieRubySdk.const_get(type)
170
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
171
+ end
172
+ end
173
+
174
+ # Returns the string representation of the object
175
+ # @return [String] String presentation of the object
176
+ def to_s
177
+ to_hash.to_s
178
+ end
179
+
180
+ # to_body is an alias to to_hash (backward compatibility)
181
+ # @return [Hash] Returns the object in the form of hash
182
+ def to_body
183
+ to_hash
184
+ end
185
+
186
+ # Returns the object in the form of hash
187
+ # @return [Hash] Returns the object in the form of hash
188
+ def to_hash
189
+ hash = {}
190
+ self.class.attribute_map.each_pair do |attr, param|
191
+ value = self.send(attr)
192
+ if value.nil?
193
+ is_nullable = self.class.openapi_nullable.include?(attr)
194
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
195
+ end
196
+
197
+ hash[param] = _to_hash(value)
198
+ end
199
+ hash
200
+ end
201
+
202
+ # Outputs non-array value in the form of hash
203
+ # For object, use to_hash. Otherwise, just return the value
204
+ # @param [Object] value Any valid value
205
+ # @return [Hash] Returns the value in the form of hash
206
+ def _to_hash(value)
207
+ if value.is_a?(Array)
208
+ value.compact.map { |v| _to_hash(v) }
209
+ elsif value.is_a?(Hash)
210
+ {}.tap do |hash|
211
+ value.each { |k, v| hash[k] = _to_hash(v) }
212
+ end
213
+ elsif value.respond_to? :to_hash
214
+ value.to_hash
215
+ else
216
+ value
217
+ end
218
+ end
219
+
220
+ end
221
+
222
+ end
@@ -0,0 +1,250 @@
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 Answer
18
+ # An answer to a question.
19
+ attr_accessor :text
20
+
21
+ # The evidence used to derive the answer.
22
+ attr_accessor :evidence
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'text' => :'text',
28
+ :'evidence' => :'evidence'
29
+ }
30
+ end
31
+
32
+ # Returns attribute mapping this model knows about
33
+ def self.acceptable_attribute_map
34
+ attribute_map
35
+ end
36
+
37
+ # Returns all the JSON keys this model knows about
38
+ def self.acceptable_attributes
39
+ acceptable_attribute_map.values
40
+ end
41
+
42
+ # Attribute type mapping.
43
+ def self.openapi_types
44
+ {
45
+ :'text' => :'String',
46
+ :'evidence' => :'Array<String>'
47
+ }
48
+ end
49
+
50
+ # List of attributes with nullable: true
51
+ def self.openapi_nullable
52
+ Set.new([
53
+ ])
54
+ end
55
+
56
+ # Initializes the object
57
+ # @param [Hash] attributes Model attributes in the form of hash
58
+ def initialize(attributes = {})
59
+ if (!attributes.is_a?(Hash))
60
+ fail ArgumentError, "The input argument (attributes) must be a hash in `RagieRubySdk::Answer` initialize method"
61
+ end
62
+
63
+ # check to see if the attribute exists and convert string to symbol for hash key
64
+ acceptable_attribute_map = self.class.acceptable_attribute_map
65
+ attributes = attributes.each_with_object({}) { |(k, v), h|
66
+ if (!acceptable_attribute_map.key?(k.to_sym))
67
+ fail ArgumentError, "`#{k}` is not a valid attribute in `RagieRubySdk::Answer`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
68
+ end
69
+ h[k.to_sym] = v
70
+ }
71
+
72
+ if attributes.key?(:'text')
73
+ self.text = attributes[:'text']
74
+ else
75
+ self.text = nil
76
+ end
77
+
78
+ if attributes.key?(:'evidence')
79
+ if (value = attributes[:'evidence']).is_a?(Array)
80
+ self.evidence = value
81
+ end
82
+ end
83
+ end
84
+
85
+ # Show invalid properties with the reasons. Usually used together with valid?
86
+ # @return Array for valid properties with the reasons
87
+ def list_invalid_properties
88
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
89
+ invalid_properties = Array.new
90
+ if @text.nil?
91
+ invalid_properties.push('invalid value for "text", text cannot be nil.')
92
+ end
93
+
94
+ invalid_properties
95
+ end
96
+
97
+ # Check to see if the all the properties in the model are valid
98
+ # @return true if the model is valid
99
+ def valid?
100
+ warn '[DEPRECATED] the `valid?` method is obsolete'
101
+ return false if @text.nil?
102
+ true
103
+ end
104
+
105
+ # Custom attribute writer method with validation
106
+ # @param [Object] text Value to be assigned
107
+ def text=(text)
108
+ if text.nil?
109
+ fail ArgumentError, 'text cannot be nil'
110
+ end
111
+
112
+ @text = text
113
+ end
114
+
115
+ # Checks equality by comparing each attribute.
116
+ # @param [Object] Object to be compared
117
+ def ==(o)
118
+ return true if self.equal?(o)
119
+ self.class == o.class &&
120
+ text == o.text &&
121
+ evidence == o.evidence
122
+ end
123
+
124
+ # @see the `==` method
125
+ # @param [Object] Object to be compared
126
+ def eql?(o)
127
+ self == o
128
+ end
129
+
130
+ # Calculates hash code according to all attributes.
131
+ # @return [Integer] Hash code
132
+ def hash
133
+ [text, evidence].hash
134
+ end
135
+
136
+ # Builds the object from hash
137
+ # @param [Hash] attributes Model attributes in the form of hash
138
+ # @return [Object] Returns the model itself
139
+ def self.build_from_hash(attributes)
140
+ return nil unless attributes.is_a?(Hash)
141
+ attributes = attributes.transform_keys(&:to_sym)
142
+ transformed_hash = {}
143
+ openapi_types.each_pair do |key, type|
144
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
145
+ transformed_hash["#{key}"] = nil
146
+ elsif type =~ /\AArray<(.*)>/i
147
+ # check to ensure the input is an array given that the attribute
148
+ # is documented as an array but the input is not
149
+ if attributes[attribute_map[key]].is_a?(Array)
150
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
151
+ end
152
+ elsif !attributes[attribute_map[key]].nil?
153
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
154
+ end
155
+ end
156
+ new(transformed_hash)
157
+ end
158
+
159
+ # Deserializes the data based on type
160
+ # @param string type Data type
161
+ # @param string value Value to be deserialized
162
+ # @return [Object] Deserialized data
163
+ def self._deserialize(type, value)
164
+ case type.to_sym
165
+ when :Time
166
+ Time.parse(value)
167
+ when :Date
168
+ Date.parse(value)
169
+ when :String
170
+ value.to_s
171
+ when :Integer
172
+ value.to_i
173
+ when :Float
174
+ value.to_f
175
+ when :Boolean
176
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
177
+ true
178
+ else
179
+ false
180
+ end
181
+ when :Object
182
+ # generic object (usually a Hash), return directly
183
+ value
184
+ when /\AArray<(?<inner_type>.+)>\z/
185
+ inner_type = Regexp.last_match[:inner_type]
186
+ value.map { |v| _deserialize(inner_type, v) }
187
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
188
+ k_type = Regexp.last_match[:k_type]
189
+ v_type = Regexp.last_match[:v_type]
190
+ {}.tap do |hash|
191
+ value.each do |k, v|
192
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
193
+ end
194
+ end
195
+ else # model
196
+ # models (e.g. Pet) or oneOf
197
+ klass = RagieRubySdk.const_get(type)
198
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
199
+ end
200
+ end
201
+
202
+ # Returns the string representation of the object
203
+ # @return [String] String presentation of the object
204
+ def to_s
205
+ to_hash.to_s
206
+ end
207
+
208
+ # to_body is an alias to to_hash (backward compatibility)
209
+ # @return [Hash] Returns the object in the form of hash
210
+ def to_body
211
+ to_hash
212
+ end
213
+
214
+ # Returns the object in the form of hash
215
+ # @return [Hash] Returns the object in the form of hash
216
+ def to_hash
217
+ hash = {}
218
+ self.class.attribute_map.each_pair do |attr, param|
219
+ value = self.send(attr)
220
+ if value.nil?
221
+ is_nullable = self.class.openapi_nullable.include?(attr)
222
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
223
+ end
224
+
225
+ hash[param] = _to_hash(value)
226
+ end
227
+ hash
228
+ end
229
+
230
+ # Outputs non-array value in the form of hash
231
+ # For object, use to_hash. Otherwise, just return the value
232
+ # @param [Object] value Any valid value
233
+ # @return [Hash] Returns the value in the form of hash
234
+ def _to_hash(value)
235
+ if value.is_a?(Array)
236
+ value.compact.map { |v| _to_hash(v) }
237
+ elsif value.is_a?(Hash)
238
+ {}.tap do |hash|
239
+ value.each { |k, v| hash[k] = _to_hash(v) }
240
+ end
241
+ elsif value.respond_to? :to_hash
242
+ value.to_hash
243
+ else
244
+ value
245
+ end
246
+ end
247
+
248
+ end
249
+
250
+ end