ragie_ruby_sdk 1.0.11 → 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 (206) 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/access_token_credentials_spec.rb +1 -1
  61. data/spec/models/agent_hopps_models_models_usage_spec.rb +36 -0
  62. data/spec/models/answer_spec.rb +42 -0
  63. data/spec/models/answer_step_spec.rb +64 -0
  64. data/spec/models/async_document_metadata_update_spec.rb +1 -1
  65. data/spec/models/audio_modality_data_spec.rb +1 -1
  66. data/spec/models/authenticator_confluence_connection_spec.rb +1 -1
  67. data/spec/models/authenticator_dropbox_connection_spec.rb +1 -1
  68. data/spec/models/authenticator_gmail_connection_spec.rb +1 -1
  69. data/spec/models/authenticator_google_drive_connection_spec.rb +1 -1
  70. data/spec/models/authenticator_hubspot_connection_spec.rb +1 -1
  71. data/spec/models/authenticator_jira_connection_spec.rb +1 -1
  72. data/spec/models/authenticator_list_spec.rb +1 -1
  73. data/spec/models/authenticator_notion_connection_spec.rb +1 -1
  74. data/spec/models/authenticator_onedrive_connection_spec.rb +1 -1
  75. data/spec/models/authenticator_salesforce_connection_spec.rb +1 -1
  76. data/spec/models/authenticator_sharepoint_connection_spec.rb +1 -1
  77. data/spec/models/authenticator_slack_connection_spec.rb +1 -1
  78. data/spec/models/backblaze_credentials_spec.rb +1 -1
  79. data/spec/models/base_get_authenticator_spec.rb +1 -1
  80. data/spec/models/body_create_document_spec.rb +1 -1
  81. data/spec/models/body_update_document_file_spec.rb +1 -1
  82. data/spec/models/bucket_data_spec.rb +1 -1
  83. data/spec/models/code_interpreter_evidence_spec.rb +64 -0
  84. data/spec/models/code_step_spec.rb +70 -0
  85. data/spec/models/confluence_data_spec.rb +1 -1
  86. data/spec/models/connection_base_spec.rb +1 -1
  87. data/spec/models/connection_limit_exceeded_webhook_payload_spec.rb +1 -1
  88. data/spec/models/connection_limit_exceeded_webhook_spec.rb +1 -1
  89. data/spec/models/connection_limit_params_spec.rb +1 -1
  90. data/spec/models/connection_list_spec.rb +1 -1
  91. data/spec/models/connection_spec.rb +1 -1
  92. data/spec/models/connection_stats_spec.rb +1 -1
  93. data/spec/models/connection_sync_finished_webhook_payload_spec.rb +1 -1
  94. data/spec/models/connection_sync_finished_webhook_spec.rb +1 -1
  95. data/spec/models/connection_sync_progress_webhook_payload_spec.rb +1 -1
  96. data/spec/models/connection_sync_progress_webhook_spec.rb +1 -1
  97. data/spec/models/connection_sync_started_webhook_payload_spec.rb +1 -1
  98. data/spec/models/connection_sync_started_webhook_spec.rb +1 -1
  99. data/spec/models/connector_source_spec.rb +1 -1
  100. data/spec/models/connector_source_type_info_spec.rb +1 -1
  101. data/spec/models/create_authenticator_connection_spec.rb +1 -1
  102. data/spec/models/create_document_from_url_params_spec.rb +1 -1
  103. data/spec/models/create_document_raw_params_spec.rb +1 -1
  104. data/spec/models/create_google_authenticator_spec.rb +1 -1
  105. data/spec/models/create_instruction_params_spec.rb +1 -1
  106. data/spec/models/create_partition_params_spec.rb +1 -1
  107. data/spec/models/delete_connection_payload_spec.rb +1 -1
  108. data/spec/models/document_chunk_detail_spec.rb +1 -1
  109. data/spec/models/document_chunk_list_spec.rb +1 -1
  110. data/spec/models/document_chunk_spec.rb +1 -1
  111. data/spec/models/document_delete_spec.rb +1 -1
  112. data/spec/models/document_delete_webhook_payload_spec.rb +1 -1
  113. data/spec/models/document_delete_webhook_spec.rb +1 -1
  114. data/spec/models/document_file_update_spec.rb +1 -1
  115. data/spec/models/document_get_spec.rb +1 -1
  116. data/spec/models/document_list_spec.rb +1 -1
  117. data/spec/models/document_metadata_update_spec.rb +1 -1
  118. data/spec/models/document_raw_update_spec.rb +1 -1
  119. data/spec/models/document_spec.rb +1 -1
  120. data/spec/models/document_summary_spec.rb +1 -1
  121. data/spec/models/document_update_webhook_payload_spec.rb +1 -1
  122. data/spec/models/document_update_webhook_spec.rb +1 -1
  123. data/spec/models/document_url_update_spec.rb +1 -1
  124. data/spec/models/document_with_content_spec.rb +1 -1
  125. data/spec/models/entity_extracted_webhook_payload_spec.rb +1 -1
  126. data/spec/models/entity_extracted_webhook_spec.rb +1 -1
  127. data/spec/models/entity_list_spec.rb +1 -1
  128. data/spec/models/entity_spec.rb +1 -1
  129. data/spec/models/error_message_spec.rb +1 -1
  130. data/spec/models/evaluated_answer_step_spec.rb +76 -0
  131. data/spec/models/final_answer_evidence_inner_spec.rb +21 -0
  132. data/spec/models/final_answer_spec.rb +54 -0
  133. data/spec/models/final_answer_steps_inner_spec.rb +21 -0
  134. data/spec/models/folder_data_spec.rb +1 -1
  135. data/spec/models/freshdesk_credentials_spec.rb +1 -1
  136. data/spec/models/freshdesk_data_spec.rb +1 -1
  137. data/spec/models/gmail_data_spec.rb +1 -1
  138. data/spec/models/google_folder_data_spec.rb +1 -1
  139. data/spec/models/http_validation_error_spec.rb +1 -1
  140. data/spec/models/hubspot_data_spec.rb +1 -1
  141. data/spec/models/input_token_details_spec.rb +36 -0
  142. data/spec/models/instruction_spec.rb +1 -1
  143. data/spec/models/intercom_credentials_spec.rb +1 -1
  144. data/spec/models/intercom_data_spec.rb +7 -1
  145. data/spec/models/link_spec.rb +1 -1
  146. data/spec/models/list_connector_source_type_info_spec.rb +1 -1
  147. data/spec/models/media_mode_param_spec.rb +1 -1
  148. data/spec/models/mode2_one_of_spec.rb +1 -1
  149. data/spec/models/model_usage_spec.rb +48 -0
  150. data/spec/models/o_auth_credentials_spec.rb +1 -1
  151. data/spec/models/o_auth_refresh_token_credentials_spec.rb +1 -1
  152. data/spec/models/o_auth_url_create_spec.rb +1 -1
  153. data/spec/models/o_auth_url_response_spec.rb +1 -1
  154. data/spec/models/onedrive_data_spec.rb +1 -1
  155. data/spec/models/output_token_details_spec.rb +36 -0
  156. data/spec/models/pagination_spec.rb +1 -1
  157. data/spec/models/partition_detail_spec.rb +1 -1
  158. data/spec/models/partition_limit_exceeded_webhook_payload_spec.rb +1 -1
  159. data/spec/models/partition_limit_exceeded_webhook_spec.rb +1 -1
  160. data/spec/models/partition_limit_params_spec.rb +1 -1
  161. data/spec/models/partition_limit_reset_webhook_payload_spec.rb +1 -1
  162. data/spec/models/partition_limit_reset_webhook_spec.rb +1 -1
  163. data/spec/models/partition_limits_spec.rb +1 -1
  164. data/spec/models/partition_list_spec.rb +1 -1
  165. data/spec/models/partition_spec.rb +1 -1
  166. data/spec/models/partition_stats_spec.rb +1 -1
  167. data/spec/models/patch_document_metadata_params_spec.rb +1 -1
  168. data/spec/models/plan_step_spec.rb +58 -0
  169. data/spec/models/public_backblaze_connection_spec.rb +1 -1
  170. data/spec/models/public_create_connection_spec.rb +1 -1
  171. data/spec/models/public_freshdesk_connection_spec.rb +1 -1
  172. data/spec/models/public_gcs_connection_spec.rb +1 -1
  173. data/spec/models/public_intercom_connection_spec.rb +1 -1
  174. data/spec/models/public_s3_compatible_connection_spec.rb +1 -1
  175. data/spec/models/public_zendesk_connection_spec.rb +1 -1
  176. data/spec/models/ragie_api_schema_response_usage_spec.rb +60 -0
  177. data/spec/models/ragie_evidence_spec.rb +88 -0
  178. data/spec/models/reasoning_spec.rb +46 -0
  179. data/spec/models/request_spec.rb +70 -0
  180. data/spec/models/response_content_spec.rb +52 -0
  181. data/spec/models/response_ok_spec.rb +1 -1
  182. data/spec/models/response_output_spec.rb +62 -0
  183. data/spec/models/response_spec.rb +188 -0
  184. data/spec/models/retrieval_spec.rb +1 -1
  185. data/spec/models/retrieve_params_spec.rb +1 -1
  186. data/spec/models/s3_compatible_credentials_spec.rb +1 -1
  187. data/spec/models/scored_chunk_spec.rb +1 -1
  188. data/spec/models/search_result_link_spec.rb +42 -0
  189. data/spec/models/search_spec.rb +36 -0
  190. data/spec/models/search_step_spec.rb +58 -0
  191. data/spec/models/set_connection_enabled_payload_spec.rb +1 -1
  192. data/spec/models/sharepoint_data_spec.rb +1 -1
  193. data/spec/models/sharepoint_file_data_spec.rb +1 -1
  194. data/spec/models/sharepoint_site_data_spec.rb +1 -1
  195. data/spec/models/slack_data_spec.rb +1 -1
  196. data/spec/models/surrender_step_spec.rb +58 -0
  197. data/spec/models/tool_spec.rb +46 -0
  198. data/spec/models/update_document_from_url_params_spec.rb +1 -1
  199. data/spec/models/update_document_raw_params_spec.rb +1 -1
  200. data/spec/models/update_instruction_params_spec.rb +1 -1
  201. data/spec/models/validation_error_spec.rb +1 -1
  202. data/spec/models/video_modality_data_spec.rb +1 -1
  203. data/spec/models/word_timestamp_spec.rb +1 -1
  204. data/spec/models/zendesk_credentials_spec.rb +1 -1
  205. data/spec/models/zendesk_data_spec.rb +1 -1
  206. metadata +105 -1
@@ -0,0 +1,638 @@
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 Response
18
+ attr_accessor :id
19
+
20
+ attr_accessor :object
21
+
22
+ attr_accessor :created_at
23
+
24
+ attr_accessor :status
25
+
26
+ attr_accessor :error
27
+
28
+ attr_accessor :incomplete_details
29
+
30
+ attr_accessor :instructions
31
+
32
+ attr_accessor :max_output_tokens
33
+
34
+ attr_accessor :model
35
+
36
+ attr_accessor :output
37
+
38
+ attr_accessor :output_parsed
39
+
40
+ attr_accessor :tools
41
+
42
+ attr_accessor :reasoning
43
+
44
+ attr_accessor :parallel_tool_calls
45
+
46
+ attr_accessor :store
47
+
48
+ attr_accessor :temperature
49
+
50
+ attr_accessor :previous_response_id
51
+
52
+ attr_accessor :tool_choice
53
+
54
+ attr_accessor :top_p
55
+
56
+ attr_accessor :truncation
57
+
58
+ attr_accessor :usage
59
+
60
+ attr_accessor :user
61
+
62
+ attr_accessor :metadata
63
+
64
+ class EnumAttributeValidator
65
+ attr_reader :datatype
66
+ attr_reader :allowable_values
67
+
68
+ def initialize(datatype, allowable_values)
69
+ @allowable_values = allowable_values.map do |value|
70
+ case datatype.to_s
71
+ when /Integer/i
72
+ value.to_i
73
+ when /Float/i
74
+ value.to_f
75
+ else
76
+ value
77
+ end
78
+ end
79
+ end
80
+
81
+ def valid?(value)
82
+ !value || allowable_values.include?(value)
83
+ end
84
+ end
85
+
86
+ # Attribute mapping from ruby-style variable name to JSON key.
87
+ def self.attribute_map
88
+ {
89
+ :'id' => :'id',
90
+ :'object' => :'object',
91
+ :'created_at' => :'created_at',
92
+ :'status' => :'status',
93
+ :'error' => :'error',
94
+ :'incomplete_details' => :'incomplete_details',
95
+ :'instructions' => :'instructions',
96
+ :'max_output_tokens' => :'max_output_tokens',
97
+ :'model' => :'model',
98
+ :'output' => :'output',
99
+ :'output_parsed' => :'output_parsed',
100
+ :'tools' => :'tools',
101
+ :'reasoning' => :'reasoning',
102
+ :'parallel_tool_calls' => :'parallel_tool_calls',
103
+ :'store' => :'store',
104
+ :'temperature' => :'temperature',
105
+ :'previous_response_id' => :'previous_response_id',
106
+ :'tool_choice' => :'tool_choice',
107
+ :'top_p' => :'top_p',
108
+ :'truncation' => :'truncation',
109
+ :'usage' => :'usage',
110
+ :'user' => :'user',
111
+ :'metadata' => :'metadata'
112
+ }
113
+ end
114
+
115
+ # Returns attribute mapping this model knows about
116
+ def self.acceptable_attribute_map
117
+ attribute_map
118
+ end
119
+
120
+ # Returns all the JSON keys this model knows about
121
+ def self.acceptable_attributes
122
+ acceptable_attribute_map.values
123
+ end
124
+
125
+ # Attribute type mapping.
126
+ def self.openapi_types
127
+ {
128
+ :'id' => :'String',
129
+ :'object' => :'String',
130
+ :'created_at' => :'Integer',
131
+ :'status' => :'String',
132
+ :'error' => :'String',
133
+ :'incomplete_details' => :'Object',
134
+ :'instructions' => :'String',
135
+ :'max_output_tokens' => :'Object',
136
+ :'model' => :'String',
137
+ :'output' => :'Array<ResponseOutput>',
138
+ :'output_parsed' => :'FinalAnswer',
139
+ :'tools' => :'Array<Tool>',
140
+ :'reasoning' => :'Reasoning',
141
+ :'parallel_tool_calls' => :'Boolean',
142
+ :'store' => :'Boolean',
143
+ :'temperature' => :'Float',
144
+ :'previous_response_id' => :'String',
145
+ :'tool_choice' => :'String',
146
+ :'top_p' => :'Float',
147
+ :'truncation' => :'String',
148
+ :'usage' => :'RagieApiSchemaResponseUsage',
149
+ :'user' => :'Object',
150
+ :'metadata' => :'Hash<String, Object>'
151
+ }
152
+ end
153
+
154
+ # List of attributes with nullable: true
155
+ def self.openapi_nullable
156
+ Set.new([
157
+ :'error',
158
+ :'incomplete_details',
159
+ :'instructions',
160
+ :'max_output_tokens',
161
+ :'output_parsed',
162
+ :'previous_response_id',
163
+ :'user',
164
+ ])
165
+ end
166
+
167
+ # Initializes the object
168
+ # @param [Hash] attributes Model attributes in the form of hash
169
+ def initialize(attributes = {})
170
+ if (!attributes.is_a?(Hash))
171
+ fail ArgumentError, "The input argument (attributes) must be a hash in `RagieRubySdk::Response` initialize method"
172
+ end
173
+
174
+ # check to see if the attribute exists and convert string to symbol for hash key
175
+ acceptable_attribute_map = self.class.acceptable_attribute_map
176
+ attributes = attributes.each_with_object({}) { |(k, v), h|
177
+ if (!acceptable_attribute_map.key?(k.to_sym))
178
+ fail ArgumentError, "`#{k}` is not a valid attribute in `RagieRubySdk::Response`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
179
+ end
180
+ h[k.to_sym] = v
181
+ }
182
+
183
+ if attributes.key?(:'id')
184
+ self.id = attributes[:'id']
185
+ else
186
+ self.id = nil
187
+ end
188
+
189
+ if attributes.key?(:'object')
190
+ self.object = attributes[:'object']
191
+ else
192
+ self.object = 'response'
193
+ end
194
+
195
+ if attributes.key?(:'created_at')
196
+ self.created_at = attributes[:'created_at']
197
+ else
198
+ self.created_at = nil
199
+ end
200
+
201
+ if attributes.key?(:'status')
202
+ self.status = attributes[:'status']
203
+ else
204
+ self.status = nil
205
+ end
206
+
207
+ if attributes.key?(:'error')
208
+ self.error = attributes[:'error']
209
+ end
210
+
211
+ if attributes.key?(:'incomplete_details')
212
+ self.incomplete_details = attributes[:'incomplete_details']
213
+ end
214
+
215
+ if attributes.key?(:'instructions')
216
+ self.instructions = attributes[:'instructions']
217
+ end
218
+
219
+ if attributes.key?(:'max_output_tokens')
220
+ self.max_output_tokens = attributes[:'max_output_tokens']
221
+ end
222
+
223
+ if attributes.key?(:'model')
224
+ self.model = attributes[:'model']
225
+ else
226
+ self.model = 'deep-search'
227
+ end
228
+
229
+ if attributes.key?(:'output')
230
+ if (value = attributes[:'output']).is_a?(Array)
231
+ self.output = value
232
+ end
233
+ else
234
+ self.output = nil
235
+ end
236
+
237
+ if attributes.key?(:'output_parsed')
238
+ self.output_parsed = attributes[:'output_parsed']
239
+ end
240
+
241
+ if attributes.key?(:'tools')
242
+ if (value = attributes[:'tools']).is_a?(Array)
243
+ self.tools = value
244
+ end
245
+ else
246
+ self.tools = nil
247
+ end
248
+
249
+ if attributes.key?(:'reasoning')
250
+ self.reasoning = attributes[:'reasoning']
251
+ else
252
+ self.reasoning = nil
253
+ end
254
+
255
+ if attributes.key?(:'parallel_tool_calls')
256
+ self.parallel_tool_calls = attributes[:'parallel_tool_calls']
257
+ else
258
+ self.parallel_tool_calls = false
259
+ end
260
+
261
+ if attributes.key?(:'store')
262
+ self.store = attributes[:'store']
263
+ else
264
+ self.store = false
265
+ end
266
+
267
+ if attributes.key?(:'temperature')
268
+ self.temperature = attributes[:'temperature']
269
+ else
270
+ self.temperature = 1.0
271
+ end
272
+
273
+ if attributes.key?(:'previous_response_id')
274
+ self.previous_response_id = attributes[:'previous_response_id']
275
+ end
276
+
277
+ if attributes.key?(:'tool_choice')
278
+ self.tool_choice = attributes[:'tool_choice']
279
+ else
280
+ self.tool_choice = 'auto'
281
+ end
282
+
283
+ if attributes.key?(:'top_p')
284
+ self.top_p = attributes[:'top_p']
285
+ else
286
+ self.top_p = 1.0
287
+ end
288
+
289
+ if attributes.key?(:'truncation')
290
+ self.truncation = attributes[:'truncation']
291
+ else
292
+ self.truncation = 'disabled'
293
+ end
294
+
295
+ if attributes.key?(:'usage')
296
+ self.usage = attributes[:'usage']
297
+ else
298
+ self.usage = nil
299
+ end
300
+
301
+ if attributes.key?(:'user')
302
+ self.user = attributes[:'user']
303
+ end
304
+
305
+ if attributes.key?(:'metadata')
306
+ if (value = attributes[:'metadata']).is_a?(Hash)
307
+ self.metadata = value
308
+ end
309
+ end
310
+ end
311
+
312
+ # Show invalid properties with the reasons. Usually used together with valid?
313
+ # @return Array for valid properties with the reasons
314
+ def list_invalid_properties
315
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
316
+ invalid_properties = Array.new
317
+ if @id.nil?
318
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
319
+ end
320
+
321
+ if @created_at.nil?
322
+ invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
323
+ end
324
+
325
+ if @status.nil?
326
+ invalid_properties.push('invalid value for "status", status cannot be nil.')
327
+ end
328
+
329
+ if @output.nil?
330
+ invalid_properties.push('invalid value for "output", output cannot be nil.')
331
+ end
332
+
333
+ if @tools.nil?
334
+ invalid_properties.push('invalid value for "tools", tools cannot be nil.')
335
+ end
336
+
337
+ if @reasoning.nil?
338
+ invalid_properties.push('invalid value for "reasoning", reasoning cannot be nil.')
339
+ end
340
+
341
+ if @usage.nil?
342
+ invalid_properties.push('invalid value for "usage", usage cannot be nil.')
343
+ end
344
+
345
+ invalid_properties
346
+ end
347
+
348
+ # Check to see if the all the properties in the model are valid
349
+ # @return true if the model is valid
350
+ def valid?
351
+ warn '[DEPRECATED] the `valid?` method is obsolete'
352
+ return false if @id.nil?
353
+ object_validator = EnumAttributeValidator.new('String', ["response"])
354
+ return false unless object_validator.valid?(@object)
355
+ return false if @created_at.nil?
356
+ return false if @status.nil?
357
+ status_validator = EnumAttributeValidator.new('String', ["completed", "failed", "in_progress"])
358
+ return false unless status_validator.valid?(@status)
359
+ model_validator = EnumAttributeValidator.new('String', ["deep-search"])
360
+ return false unless model_validator.valid?(@model)
361
+ return false if @output.nil?
362
+ return false if @tools.nil?
363
+ return false if @reasoning.nil?
364
+ tool_choice_validator = EnumAttributeValidator.new('String', ["auto"])
365
+ return false unless tool_choice_validator.valid?(@tool_choice)
366
+ truncation_validator = EnumAttributeValidator.new('String', ["disabled"])
367
+ return false unless truncation_validator.valid?(@truncation)
368
+ return false if @usage.nil?
369
+ true
370
+ end
371
+
372
+ # Custom attribute writer method with validation
373
+ # @param [Object] id Value to be assigned
374
+ def id=(id)
375
+ if id.nil?
376
+ fail ArgumentError, 'id cannot be nil'
377
+ end
378
+
379
+ @id = id
380
+ end
381
+
382
+ # Custom attribute writer method checking allowed values (enum).
383
+ # @param [Object] object Object to be assigned
384
+ def object=(object)
385
+ validator = EnumAttributeValidator.new('String', ["response"])
386
+ unless validator.valid?(object)
387
+ fail ArgumentError, "invalid value for \"object\", must be one of #{validator.allowable_values}."
388
+ end
389
+ @object = object
390
+ end
391
+
392
+ # Custom attribute writer method with validation
393
+ # @param [Object] created_at Value to be assigned
394
+ def created_at=(created_at)
395
+ if created_at.nil?
396
+ fail ArgumentError, 'created_at cannot be nil'
397
+ end
398
+
399
+ @created_at = created_at
400
+ end
401
+
402
+ # Custom attribute writer method checking allowed values (enum).
403
+ # @param [Object] status Object to be assigned
404
+ def status=(status)
405
+ validator = EnumAttributeValidator.new('String', ["completed", "failed", "in_progress"])
406
+ unless validator.valid?(status)
407
+ fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
408
+ end
409
+ @status = status
410
+ end
411
+
412
+ # Custom attribute writer method checking allowed values (enum).
413
+ # @param [Object] model Object to be assigned
414
+ def model=(model)
415
+ validator = EnumAttributeValidator.new('String', ["deep-search"])
416
+ unless validator.valid?(model)
417
+ fail ArgumentError, "invalid value for \"model\", must be one of #{validator.allowable_values}."
418
+ end
419
+ @model = model
420
+ end
421
+
422
+ # Custom attribute writer method with validation
423
+ # @param [Object] output Value to be assigned
424
+ def output=(output)
425
+ if output.nil?
426
+ fail ArgumentError, 'output cannot be nil'
427
+ end
428
+
429
+ @output = output
430
+ end
431
+
432
+ # Custom attribute writer method with validation
433
+ # @param [Object] tools Value to be assigned
434
+ def tools=(tools)
435
+ if tools.nil?
436
+ fail ArgumentError, 'tools cannot be nil'
437
+ end
438
+
439
+ @tools = tools
440
+ end
441
+
442
+ # Custom attribute writer method with validation
443
+ # @param [Object] reasoning Value to be assigned
444
+ def reasoning=(reasoning)
445
+ if reasoning.nil?
446
+ fail ArgumentError, 'reasoning cannot be nil'
447
+ end
448
+
449
+ @reasoning = reasoning
450
+ end
451
+
452
+ # Custom attribute writer method checking allowed values (enum).
453
+ # @param [Object] tool_choice Object to be assigned
454
+ def tool_choice=(tool_choice)
455
+ validator = EnumAttributeValidator.new('String', ["auto"])
456
+ unless validator.valid?(tool_choice)
457
+ fail ArgumentError, "invalid value for \"tool_choice\", must be one of #{validator.allowable_values}."
458
+ end
459
+ @tool_choice = tool_choice
460
+ end
461
+
462
+ # Custom attribute writer method checking allowed values (enum).
463
+ # @param [Object] truncation Object to be assigned
464
+ def truncation=(truncation)
465
+ validator = EnumAttributeValidator.new('String', ["disabled"])
466
+ unless validator.valid?(truncation)
467
+ fail ArgumentError, "invalid value for \"truncation\", must be one of #{validator.allowable_values}."
468
+ end
469
+ @truncation = truncation
470
+ end
471
+
472
+ # Custom attribute writer method with validation
473
+ # @param [Object] usage Value to be assigned
474
+ def usage=(usage)
475
+ if usage.nil?
476
+ fail ArgumentError, 'usage cannot be nil'
477
+ end
478
+
479
+ @usage = usage
480
+ end
481
+
482
+ # Checks equality by comparing each attribute.
483
+ # @param [Object] Object to be compared
484
+ def ==(o)
485
+ return true if self.equal?(o)
486
+ self.class == o.class &&
487
+ id == o.id &&
488
+ object == o.object &&
489
+ created_at == o.created_at &&
490
+ status == o.status &&
491
+ error == o.error &&
492
+ incomplete_details == o.incomplete_details &&
493
+ instructions == o.instructions &&
494
+ max_output_tokens == o.max_output_tokens &&
495
+ model == o.model &&
496
+ output == o.output &&
497
+ output_parsed == o.output_parsed &&
498
+ tools == o.tools &&
499
+ reasoning == o.reasoning &&
500
+ parallel_tool_calls == o.parallel_tool_calls &&
501
+ store == o.store &&
502
+ temperature == o.temperature &&
503
+ previous_response_id == o.previous_response_id &&
504
+ tool_choice == o.tool_choice &&
505
+ top_p == o.top_p &&
506
+ truncation == o.truncation &&
507
+ usage == o.usage &&
508
+ user == o.user &&
509
+ metadata == o.metadata
510
+ end
511
+
512
+ # @see the `==` method
513
+ # @param [Object] Object to be compared
514
+ def eql?(o)
515
+ self == o
516
+ end
517
+
518
+ # Calculates hash code according to all attributes.
519
+ # @return [Integer] Hash code
520
+ def hash
521
+ [id, object, created_at, status, error, incomplete_details, instructions, max_output_tokens, model, output, output_parsed, tools, reasoning, parallel_tool_calls, store, temperature, previous_response_id, tool_choice, top_p, truncation, usage, user, metadata].hash
522
+ end
523
+
524
+ # Builds the object from hash
525
+ # @param [Hash] attributes Model attributes in the form of hash
526
+ # @return [Object] Returns the model itself
527
+ def self.build_from_hash(attributes)
528
+ return nil unless attributes.is_a?(Hash)
529
+ attributes = attributes.transform_keys(&:to_sym)
530
+ transformed_hash = {}
531
+ openapi_types.each_pair do |key, type|
532
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
533
+ transformed_hash["#{key}"] = nil
534
+ elsif type =~ /\AArray<(.*)>/i
535
+ # check to ensure the input is an array given that the attribute
536
+ # is documented as an array but the input is not
537
+ if attributes[attribute_map[key]].is_a?(Array)
538
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
539
+ end
540
+ elsif !attributes[attribute_map[key]].nil?
541
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
542
+ end
543
+ end
544
+ new(transformed_hash)
545
+ end
546
+
547
+ # Deserializes the data based on type
548
+ # @param string type Data type
549
+ # @param string value Value to be deserialized
550
+ # @return [Object] Deserialized data
551
+ def self._deserialize(type, value)
552
+ case type.to_sym
553
+ when :Time
554
+ Time.parse(value)
555
+ when :Date
556
+ Date.parse(value)
557
+ when :String
558
+ value.to_s
559
+ when :Integer
560
+ value.to_i
561
+ when :Float
562
+ value.to_f
563
+ when :Boolean
564
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
565
+ true
566
+ else
567
+ false
568
+ end
569
+ when :Object
570
+ # generic object (usually a Hash), return directly
571
+ value
572
+ when /\AArray<(?<inner_type>.+)>\z/
573
+ inner_type = Regexp.last_match[:inner_type]
574
+ value.map { |v| _deserialize(inner_type, v) }
575
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
576
+ k_type = Regexp.last_match[:k_type]
577
+ v_type = Regexp.last_match[:v_type]
578
+ {}.tap do |hash|
579
+ value.each do |k, v|
580
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
581
+ end
582
+ end
583
+ else # model
584
+ # models (e.g. Pet) or oneOf
585
+ klass = RagieRubySdk.const_get(type)
586
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
587
+ end
588
+ end
589
+
590
+ # Returns the string representation of the object
591
+ # @return [String] String presentation of the object
592
+ def to_s
593
+ to_hash.to_s
594
+ end
595
+
596
+ # to_body is an alias to to_hash (backward compatibility)
597
+ # @return [Hash] Returns the object in the form of hash
598
+ def to_body
599
+ to_hash
600
+ end
601
+
602
+ # Returns the object in the form of hash
603
+ # @return [Hash] Returns the object in the form of hash
604
+ def to_hash
605
+ hash = {}
606
+ self.class.attribute_map.each_pair do |attr, param|
607
+ value = self.send(attr)
608
+ if value.nil?
609
+ is_nullable = self.class.openapi_nullable.include?(attr)
610
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
611
+ end
612
+
613
+ hash[param] = _to_hash(value)
614
+ end
615
+ hash
616
+ end
617
+
618
+ # Outputs non-array value in the form of hash
619
+ # For object, use to_hash. Otherwise, just return the value
620
+ # @param [Object] value Any valid value
621
+ # @return [Hash] Returns the value in the form of hash
622
+ def _to_hash(value)
623
+ if value.is_a?(Array)
624
+ value.compact.map { |v| _to_hash(v) }
625
+ elsif value.is_a?(Hash)
626
+ {}.tap do |hash|
627
+ value.each { |k, v| hash[k] = _to_hash(v) }
628
+ end
629
+ elsif value.respond_to? :to_hash
630
+ value.to_hash
631
+ else
632
+ value
633
+ end
634
+ end
635
+
636
+ end
637
+
638
+ end