venice_client 1.0.23 → 1.0.24

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 (173) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +8 -1
  3. data/docs/AssistantMessage.md +2 -0
  4. data/docs/AssistantMessageReasoningDetailsInner.md +28 -0
  5. data/docs/ChatApi.md +1 -1
  6. data/docs/ChatCompletionContentPartInputAudio.md +22 -0
  7. data/docs/ChatCompletionContentPartVideoUrl.md +22 -0
  8. data/docs/ChatCompletionRequestMessagesInner.md +4 -2
  9. data/docs/CreateChatCompletion200Response.md +1 -1
  10. data/docs/CreateChatCompletion200ResponseChoicesInnerMessage.md +2 -0
  11. data/docs/GenerateImageRequest.md +2 -2
  12. data/docs/InputAudio.md +22 -0
  13. data/docs/InputAudioObject.md +20 -0
  14. data/docs/ObjectsInner.md +5 -1
  15. data/docs/UserMessage.md +2 -0
  16. data/docs/VideoURLObject.md +18 -0
  17. data/docs/VideoUrl.md +22 -0
  18. data/lib/venice_client/api/api_keys_api.rb +1 -1
  19. data/lib/venice_client/api/audio_api.rb +1 -1
  20. data/lib/venice_client/api/billing_api.rb +1 -1
  21. data/lib/venice_client/api/characters_api.rb +1 -1
  22. data/lib/venice_client/api/chat_api.rb +3 -3
  23. data/lib/venice_client/api/embeddings_api.rb +1 -1
  24. data/lib/venice_client/api/image_api.rb +1 -1
  25. data/lib/venice_client/api/models_api.rb +1 -1
  26. data/lib/venice_client/api/preview_api.rb +1 -1
  27. data/lib/venice_client/api/speech_api.rb +1 -1
  28. data/lib/venice_client/api/video_api.rb +1 -1
  29. data/lib/venice_client/api_client.rb +1 -1
  30. data/lib/venice_client/api_error.rb +1 -1
  31. data/lib/venice_client/configuration.rb +1 -1
  32. data/lib/venice_client/models/assistant_message.rb +15 -2
  33. data/lib/venice_client/models/assistant_message_content.rb +1 -1
  34. data/lib/venice_client/models/assistant_message_reasoning_details_inner.rb +282 -0
  35. data/lib/venice_client/models/audio_model_pricing.rb +1 -1
  36. data/lib/venice_client/models/audio_model_pricing_input.rb +1 -1
  37. data/lib/venice_client/models/billing_usage_request.rb +1 -1
  38. data/lib/venice_client/models/billing_usage_response.rb +1 -1
  39. data/lib/venice_client/models/cache_control.rb +1 -1
  40. data/lib/venice_client/models/chat_completion_content_part_input_audio.rb +297 -0
  41. data/lib/venice_client/models/chat_completion_content_part_video_url.rb +297 -0
  42. data/lib/venice_client/models/chat_completion_request.rb +1 -1
  43. data/lib/venice_client/models/chat_completion_request_messages_inner.rb +1 -1
  44. data/lib/venice_client/models/chat_completion_request_reasoning.rb +1 -1
  45. data/lib/venice_client/models/chat_completion_request_response_format.rb +1 -1
  46. data/lib/venice_client/models/chat_completion_request_stop.rb +1 -1
  47. data/lib/venice_client/models/chat_completion_request_stream_options.rb +1 -1
  48. data/lib/venice_client/models/chat_completion_request_tool_choice.rb +1 -1
  49. data/lib/venice_client/models/chat_completion_request_tool_choice_any_of.rb +1 -1
  50. data/lib/venice_client/models/chat_completion_request_tool_choice_any_of_function.rb +1 -1
  51. data/lib/venice_client/models/chat_completion_request_venice_parameters.rb +1 -1
  52. data/lib/venice_client/models/complete_video200_response.rb +1 -1
  53. data/lib/venice_client/models/complete_video_request.rb +1 -1
  54. data/lib/venice_client/models/create_api_key200_response.rb +1 -1
  55. data/lib/venice_client/models/create_api_key200_response_data.rb +1 -1
  56. data/lib/venice_client/models/create_api_key_request.rb +1 -1
  57. data/lib/venice_client/models/create_api_key_request_expires_at.rb +1 -1
  58. data/lib/venice_client/models/create_chat_completion200_response.rb +2 -19
  59. data/lib/venice_client/models/create_chat_completion200_response_choices_inner.rb +1 -1
  60. data/lib/venice_client/models/create_chat_completion200_response_choices_inner_logprobs.rb +1 -1
  61. data/lib/venice_client/models/create_chat_completion200_response_choices_inner_logprobs_top_logprobs_inner.rb +1 -1
  62. data/lib/venice_client/models/create_chat_completion200_response_choices_inner_message.rb +1 -1
  63. data/lib/venice_client/models/create_chat_completion200_response_usage.rb +1 -1
  64. data/lib/venice_client/models/create_chat_completion200_response_venice_parameters.rb +1 -1
  65. data/lib/venice_client/models/create_chat_completion200_response_venice_parameters_web_search_citations_inner.rb +1 -1
  66. data/lib/venice_client/models/create_embedding200_response.rb +1 -1
  67. data/lib/venice_client/models/create_embedding200_response_data_inner.rb +1 -1
  68. data/lib/venice_client/models/create_embedding200_response_usage.rb +1 -1
  69. data/lib/venice_client/models/create_embedding_request_schema.rb +1 -1
  70. data/lib/venice_client/models/create_embedding_request_schema_input.rb +1 -1
  71. data/lib/venice_client/models/create_embedding_request_schema_model.rb +1 -1
  72. data/lib/venice_client/models/create_speech_request_schema.rb +1 -1
  73. data/lib/venice_client/models/delete_api_key200_response.rb +1 -1
  74. data/lib/venice_client/models/detailed_error.rb +1 -1
  75. data/lib/venice_client/models/edit_image_request.rb +1 -1
  76. data/lib/venice_client/models/edit_image_request_image.rb +1 -1
  77. data/lib/venice_client/models/generate_image200_response.rb +1 -1
  78. data/lib/venice_client/models/generate_image200_response_timing.rb +1 -1
  79. data/lib/venice_client/models/generate_image_request.rb +2 -2
  80. data/lib/venice_client/models/get_api_key_by_id200_response.rb +1 -1
  81. data/lib/venice_client/models/get_api_key_by_id200_response_data.rb +1 -1
  82. data/lib/venice_client/models/get_api_key_generate_web3_key200_response.rb +1 -1
  83. data/lib/venice_client/models/get_api_key_generate_web3_key200_response_data.rb +1 -1
  84. data/lib/venice_client/models/get_api_key_rate_limit_logs200_response.rb +1 -1
  85. data/lib/venice_client/models/get_api_key_rate_limit_logs200_response_data_inner.rb +1 -1
  86. data/lib/venice_client/models/get_api_key_rate_limits200_response.rb +1 -1
  87. data/lib/venice_client/models/get_api_key_rate_limits200_response_data.rb +1 -1
  88. data/lib/venice_client/models/get_api_key_rate_limits200_response_data_api_tier.rb +1 -1
  89. data/lib/venice_client/models/get_api_key_rate_limits200_response_data_balances.rb +1 -1
  90. data/lib/venice_client/models/get_api_key_rate_limits200_response_data_rate_limits_inner.rb +1 -1
  91. data/lib/venice_client/models/get_api_key_rate_limits200_response_data_rate_limits_inner_rate_limits_inner.rb +1 -1
  92. data/lib/venice_client/models/get_api_keys200_response.rb +1 -1
  93. data/lib/venice_client/models/get_api_keys200_response_data_inner.rb +1 -1
  94. data/lib/venice_client/models/get_api_keys200_response_data_inner_consumption_limits.rb +1 -1
  95. data/lib/venice_client/models/get_api_keys200_response_data_inner_usage.rb +1 -1
  96. data/lib/venice_client/models/get_api_keys200_response_data_inner_usage_trailing_seven_days.rb +1 -1
  97. data/lib/venice_client/models/get_billing_usage200_response.rb +1 -1
  98. data/lib/venice_client/models/get_billing_usage200_response_data_inner.rb +1 -1
  99. data/lib/venice_client/models/get_billing_usage200_response_data_inner_inference_details.rb +1 -1
  100. data/lib/venice_client/models/get_billing_usage200_response_pagination.rb +1 -1
  101. data/lib/venice_client/models/get_character_by_slug200_response.rb +1 -1
  102. data/lib/venice_client/models/image_model_constraints.rb +1 -1
  103. data/lib/venice_client/models/image_model_constraints_steps.rb +1 -1
  104. data/lib/venice_client/models/image_model_pricing.rb +1 -1
  105. data/lib/venice_client/models/image_model_pricing_generation.rb +1 -1
  106. data/lib/venice_client/models/image_model_pricing_upscale.rb +1 -1
  107. data/lib/venice_client/models/image_model_pricing_upscale2x.rb +1 -1
  108. data/lib/venice_client/models/image_model_pricing_upscale4x.rb +1 -1
  109. data/lib/venice_client/models/image_styles_get200_response.rb +1 -1
  110. data/lib/venice_client/models/image_url.rb +1 -1
  111. data/lib/venice_client/models/image_url_object.rb +1 -1
  112. data/lib/venice_client/models/input_audio.rb +297 -0
  113. data/lib/venice_client/models/input_audio_object.rb +285 -0
  114. data/lib/venice_client/models/json_object.rb +1 -1
  115. data/lib/venice_client/models/json_schema.rb +1 -1
  116. data/lib/venice_client/models/list_characters200_response.rb +1 -1
  117. data/lib/venice_client/models/list_characters200_response_data_inner.rb +1 -1
  118. data/lib/venice_client/models/list_characters200_response_data_inner_stats.rb +1 -1
  119. data/lib/venice_client/models/list_model_compatibility_mapping200_response.rb +1 -1
  120. data/lib/venice_client/models/list_model_traits200_response.rb +1 -1
  121. data/lib/venice_client/models/list_models200_response.rb +1 -1
  122. data/lib/venice_client/models/list_models200_response_type.rb +1 -1
  123. data/lib/venice_client/models/list_models_type_parameter.rb +1 -1
  124. data/lib/venice_client/models/llm_model_pricing.rb +1 -1
  125. data/lib/venice_client/models/llm_model_pricing_input.rb +1 -1
  126. data/lib/venice_client/models/llm_model_pricing_output.rb +1 -1
  127. data/lib/venice_client/models/model_response.rb +1 -1
  128. data/lib/venice_client/models/model_response_model_spec.rb +1 -1
  129. data/lib/venice_client/models/model_response_model_spec_capabilities.rb +1 -1
  130. data/lib/venice_client/models/model_response_model_spec_constraints.rb +1 -1
  131. data/lib/venice_client/models/model_response_model_spec_pricing.rb +1 -1
  132. data/lib/venice_client/models/objects_inner.rb +4 -2
  133. data/lib/venice_client/models/post_api_key_generate_web3_key_request.rb +1 -1
  134. data/lib/venice_client/models/queue_video200_response.rb +1 -1
  135. data/lib/venice_client/models/queue_video_request.rb +1 -1
  136. data/lib/venice_client/models/quote_video200_response.rb +1 -1
  137. data/lib/venice_client/models/retrieve_video200_response.rb +1 -1
  138. data/lib/venice_client/models/retrieve_video_request.rb +1 -1
  139. data/lib/venice_client/models/simple_generate_image200_response.rb +1 -1
  140. data/lib/venice_client/models/simple_generate_image200_response_data_inner.rb +1 -1
  141. data/lib/venice_client/models/simple_generate_image200_response_data_inner_any_of.rb +1 -1
  142. data/lib/venice_client/models/simple_generate_image200_response_data_inner_any_of1.rb +1 -1
  143. data/lib/venice_client/models/simple_generate_image_request.rb +1 -1
  144. data/lib/venice_client/models/standard_error.rb +1 -1
  145. data/lib/venice_client/models/system_message.rb +2 -1
  146. data/lib/venice_client/models/system_message_content.rb +1 -1
  147. data/lib/venice_client/models/text.rb +1 -1
  148. data/lib/venice_client/models/text_model_constraints.rb +1 -1
  149. data/lib/venice_client/models/text_model_constraints_temperature.rb +1 -1
  150. data/lib/venice_client/models/text_model_constraints_top_p.rb +1 -1
  151. data/lib/venice_client/models/tool_call.rb +1 -1
  152. data/lib/venice_client/models/tool_call_function.rb +1 -1
  153. data/lib/venice_client/models/tool_message.rb +2 -1
  154. data/lib/venice_client/models/upscale_image_request.rb +1 -1
  155. data/lib/venice_client/models/upscale_image_request_enhance.rb +1 -1
  156. data/lib/venice_client/models/user_message.rb +12 -2
  157. data/lib/venice_client/models/user_message_content.rb +1 -1
  158. data/lib/venice_client/models/video_model_constraints.rb +1 -1
  159. data/lib/venice_client/models/video_url.rb +297 -0
  160. data/lib/venice_client/models/video_url_object.rb +239 -0
  161. data/lib/venice_client/version.rb +2 -2
  162. data/lib/venice_client.rb +8 -1
  163. data/spec/models/assistant_message_reasoning_details_inner_spec.rb +66 -0
  164. data/spec/models/chat_completion_content_part_input_audio_spec.rb +52 -0
  165. data/spec/models/chat_completion_content_part_video_url_spec.rb +52 -0
  166. data/spec/models/input_audio_object_spec.rb +46 -0
  167. data/spec/models/input_audio_spec.rb +52 -0
  168. data/spec/models/video_url_object_spec.rb +36 -0
  169. data/spec/models/video_url_spec.rb +52 -0
  170. data/spec/spec_helper.rb +1 -1
  171. data/swagger.yaml +307 -15
  172. data/venice_client.gemspec +1 -1
  173. metadata +29 -1
@@ -0,0 +1,297 @@
1
+ =begin
2
+ #Venice.ai API
3
+
4
+ #The Venice.ai API.
5
+
6
+ The version of the OpenAPI document: 20251218.042551
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.14.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module VeniceClient
17
+ # Audio input message type for models that support audio analysis. Audio must be base64-encoded.
18
+ class InputAudio
19
+ attr_accessor :cache_control
20
+
21
+ attr_accessor :input_audio
22
+
23
+ attr_accessor :type
24
+
25
+ class EnumAttributeValidator
26
+ attr_reader :datatype
27
+ attr_reader :allowable_values
28
+
29
+ def initialize(datatype, allowable_values)
30
+ @allowable_values = allowable_values.map do |value|
31
+ case datatype.to_s
32
+ when /Integer/i
33
+ value.to_i
34
+ when /Float/i
35
+ value.to_f
36
+ else
37
+ value
38
+ end
39
+ end
40
+ end
41
+
42
+ def valid?(value)
43
+ !value || allowable_values.include?(value)
44
+ end
45
+ end
46
+
47
+ # Attribute mapping from ruby-style variable name to JSON key.
48
+ def self.attribute_map
49
+ {
50
+ :'cache_control' => :'cache_control',
51
+ :'input_audio' => :'input_audio',
52
+ :'type' => :'type'
53
+ }
54
+ end
55
+
56
+ # Returns attribute mapping this model knows about
57
+ def self.acceptable_attribute_map
58
+ attribute_map
59
+ end
60
+
61
+ # Returns all the JSON keys this model knows about
62
+ def self.acceptable_attributes
63
+ acceptable_attribute_map.values
64
+ end
65
+
66
+ # Attribute type mapping.
67
+ def self.openapi_types
68
+ {
69
+ :'cache_control' => :'CacheControl',
70
+ :'input_audio' => :'InputAudioObject',
71
+ :'type' => :'String'
72
+ }
73
+ end
74
+
75
+ # List of attributes with nullable: true
76
+ def self.openapi_nullable
77
+ Set.new([
78
+ ])
79
+ end
80
+
81
+ # Initializes the object
82
+ # @param [Hash] attributes Model attributes in the form of hash
83
+ def initialize(attributes = {})
84
+ if (!attributes.is_a?(Hash))
85
+ fail ArgumentError, "The input argument (attributes) must be a hash in `VeniceClient::InputAudio` initialize method"
86
+ end
87
+
88
+ # check to see if the attribute exists and convert string to symbol for hash key
89
+ acceptable_attribute_map = self.class.acceptable_attribute_map
90
+ attributes = attributes.each_with_object({}) { |(k, v), h|
91
+ if (!acceptable_attribute_map.key?(k.to_sym))
92
+ fail ArgumentError, "`#{k}` is not a valid attribute in `VeniceClient::InputAudio`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
93
+ end
94
+ h[k.to_sym] = v
95
+ }
96
+
97
+ if attributes.key?(:'cache_control')
98
+ self.cache_control = attributes[:'cache_control']
99
+ end
100
+
101
+ if attributes.key?(:'input_audio')
102
+ self.input_audio = attributes[:'input_audio']
103
+ else
104
+ self.input_audio = nil
105
+ end
106
+
107
+ if attributes.key?(:'type')
108
+ self.type = attributes[:'type']
109
+ else
110
+ self.type = nil
111
+ end
112
+ end
113
+
114
+ # Show invalid properties with the reasons. Usually used together with valid?
115
+ # @return Array for valid properties with the reasons
116
+ def list_invalid_properties
117
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
118
+ invalid_properties = Array.new
119
+ if @input_audio.nil?
120
+ invalid_properties.push('invalid value for "input_audio", input_audio cannot be nil.')
121
+ end
122
+
123
+ if @type.nil?
124
+ invalid_properties.push('invalid value for "type", type cannot be nil.')
125
+ end
126
+
127
+ invalid_properties
128
+ end
129
+
130
+ # Check to see if the all the properties in the model are valid
131
+ # @return true if the model is valid
132
+ def valid?
133
+ warn '[DEPRECATED] the `valid?` method is obsolete'
134
+ return false if @input_audio.nil?
135
+ return false if @type.nil?
136
+ type_validator = EnumAttributeValidator.new('String', ["input_audio"])
137
+ return false unless type_validator.valid?(@type)
138
+ true
139
+ end
140
+
141
+ # Custom attribute writer method with validation
142
+ # @param [Object] input_audio Value to be assigned
143
+ def input_audio=(input_audio)
144
+ if input_audio.nil?
145
+ fail ArgumentError, 'input_audio cannot be nil'
146
+ end
147
+
148
+ @input_audio = input_audio
149
+ end
150
+
151
+ # Custom attribute writer method checking allowed values (enum).
152
+ # @param [Object] type Object to be assigned
153
+ def type=(type)
154
+ validator = EnumAttributeValidator.new('String', ["input_audio"])
155
+ unless validator.valid?(type)
156
+ fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
157
+ end
158
+ @type = type
159
+ end
160
+
161
+ # Checks equality by comparing each attribute.
162
+ # @param [Object] Object to be compared
163
+ def ==(o)
164
+ return true if self.equal?(o)
165
+ self.class == o.class &&
166
+ cache_control == o.cache_control &&
167
+ input_audio == o.input_audio &&
168
+ type == o.type
169
+ end
170
+
171
+ # @see the `==` method
172
+ # @param [Object] Object to be compared
173
+ def eql?(o)
174
+ self == o
175
+ end
176
+
177
+ # Calculates hash code according to all attributes.
178
+ # @return [Integer] Hash code
179
+ def hash
180
+ [cache_control, input_audio, type].hash
181
+ end
182
+
183
+ # Builds the object from hash
184
+ # @param [Hash] attributes Model attributes in the form of hash
185
+ # @return [Object] Returns the model itself
186
+ def self.build_from_hash(attributes)
187
+ return nil unless attributes.is_a?(Hash)
188
+ attributes = attributes.transform_keys(&:to_sym)
189
+ transformed_hash = {}
190
+ openapi_types.each_pair do |key, type|
191
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
192
+ transformed_hash["#{key}"] = nil
193
+ elsif type =~ /\AArray<(.*)>/i
194
+ # check to ensure the input is an array given that the attribute
195
+ # is documented as an array but the input is not
196
+ if attributes[attribute_map[key]].is_a?(Array)
197
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
198
+ end
199
+ elsif !attributes[attribute_map[key]].nil?
200
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
201
+ end
202
+ end
203
+ new(transformed_hash)
204
+ end
205
+
206
+ # Deserializes the data based on type
207
+ # @param string type Data type
208
+ # @param string value Value to be deserialized
209
+ # @return [Object] Deserialized data
210
+ def self._deserialize(type, value)
211
+ case type.to_sym
212
+ when :Time
213
+ Time.parse(value)
214
+ when :Date
215
+ Date.parse(value)
216
+ when :String
217
+ value.to_s
218
+ when :Integer
219
+ value.to_i
220
+ when :Float
221
+ value.to_f
222
+ when :Boolean
223
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
224
+ true
225
+ else
226
+ false
227
+ end
228
+ when :Object
229
+ # generic object (usually a Hash), return directly
230
+ value
231
+ when /\AArray<(?<inner_type>.+)>\z/
232
+ inner_type = Regexp.last_match[:inner_type]
233
+ value.map { |v| _deserialize(inner_type, v) }
234
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
235
+ k_type = Regexp.last_match[:k_type]
236
+ v_type = Regexp.last_match[:v_type]
237
+ {}.tap do |hash|
238
+ value.each do |k, v|
239
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
240
+ end
241
+ end
242
+ else # model
243
+ # models (e.g. Pet) or oneOf
244
+ klass = VeniceClient.const_get(type)
245
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
246
+ end
247
+ end
248
+
249
+ # Returns the string representation of the object
250
+ # @return [String] String presentation of the object
251
+ def to_s
252
+ to_hash.to_s
253
+ end
254
+
255
+ # to_body is an alias to to_hash (backward compatibility)
256
+ # @return [Hash] Returns the object in the form of hash
257
+ def to_body
258
+ to_hash
259
+ end
260
+
261
+ # Returns the object in the form of hash
262
+ # @return [Hash] Returns the object in the form of hash
263
+ def to_hash
264
+ hash = {}
265
+ self.class.attribute_map.each_pair do |attr, param|
266
+ value = self.send(attr)
267
+ if value.nil?
268
+ is_nullable = self.class.openapi_nullable.include?(attr)
269
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
270
+ end
271
+
272
+ hash[param] = _to_hash(value)
273
+ end
274
+ hash
275
+ end
276
+
277
+ # Outputs non-array value in the form of hash
278
+ # For object, use to_hash. Otherwise, just return the value
279
+ # @param [Object] value Any valid value
280
+ # @return [Hash] Returns the value in the form of hash
281
+ def _to_hash(value)
282
+ if value.is_a?(Array)
283
+ value.compact.map { |v| _to_hash(v) }
284
+ elsif value.is_a?(Hash)
285
+ {}.tap do |hash|
286
+ value.each { |k, v| hash[k] = _to_hash(v) }
287
+ end
288
+ elsif value.respond_to? :to_hash
289
+ value.to_hash
290
+ else
291
+ value
292
+ end
293
+ end
294
+
295
+ end
296
+
297
+ end
@@ -0,0 +1,285 @@
1
+ =begin
2
+ #Venice.ai API
3
+
4
+ #The Venice.ai API.
5
+
6
+ The version of the OpenAPI document: 20251218.042551
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.14.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module VeniceClient
17
+ # Object containing the base64-encoded audio data and format
18
+ class InputAudioObject
19
+ # Base64-encoded audio data. Direct URLs are not supported for audio content.
20
+ attr_accessor :data
21
+
22
+ # The format of the audio file. Common formats include wav, mp3, aac, ogg, flac, m4a. Defaults to wav.
23
+ attr_accessor :format
24
+
25
+ class EnumAttributeValidator
26
+ attr_reader :datatype
27
+ attr_reader :allowable_values
28
+
29
+ def initialize(datatype, allowable_values)
30
+ @allowable_values = allowable_values.map do |value|
31
+ case datatype.to_s
32
+ when /Integer/i
33
+ value.to_i
34
+ when /Float/i
35
+ value.to_f
36
+ else
37
+ value
38
+ end
39
+ end
40
+ end
41
+
42
+ def valid?(value)
43
+ !value || allowable_values.include?(value)
44
+ end
45
+ end
46
+
47
+ # Attribute mapping from ruby-style variable name to JSON key.
48
+ def self.attribute_map
49
+ {
50
+ :'data' => :'data',
51
+ :'format' => :'format'
52
+ }
53
+ end
54
+
55
+ # Returns attribute mapping this model knows about
56
+ def self.acceptable_attribute_map
57
+ attribute_map
58
+ end
59
+
60
+ # Returns all the JSON keys this model knows about
61
+ def self.acceptable_attributes
62
+ acceptable_attribute_map.values
63
+ end
64
+
65
+ # Attribute type mapping.
66
+ def self.openapi_types
67
+ {
68
+ :'data' => :'String',
69
+ :'format' => :'String'
70
+ }
71
+ end
72
+
73
+ # List of attributes with nullable: true
74
+ def self.openapi_nullable
75
+ Set.new([
76
+ ])
77
+ end
78
+
79
+ # Initializes the object
80
+ # @param [Hash] attributes Model attributes in the form of hash
81
+ def initialize(attributes = {})
82
+ if (!attributes.is_a?(Hash))
83
+ fail ArgumentError, "The input argument (attributes) must be a hash in `VeniceClient::InputAudioObject` initialize method"
84
+ end
85
+
86
+ # check to see if the attribute exists and convert string to symbol for hash key
87
+ acceptable_attribute_map = self.class.acceptable_attribute_map
88
+ attributes = attributes.each_with_object({}) { |(k, v), h|
89
+ if (!acceptable_attribute_map.key?(k.to_sym))
90
+ fail ArgumentError, "`#{k}` is not a valid attribute in `VeniceClient::InputAudioObject`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
91
+ end
92
+ h[k.to_sym] = v
93
+ }
94
+
95
+ if attributes.key?(:'data')
96
+ self.data = attributes[:'data']
97
+ else
98
+ self.data = nil
99
+ end
100
+
101
+ if attributes.key?(:'format')
102
+ self.format = attributes[:'format']
103
+ else
104
+ self.format = 'wav'
105
+ end
106
+ end
107
+
108
+ # Show invalid properties with the reasons. Usually used together with valid?
109
+ # @return Array for valid properties with the reasons
110
+ def list_invalid_properties
111
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
112
+ invalid_properties = Array.new
113
+ if @data.nil?
114
+ invalid_properties.push('invalid value for "data", data cannot be nil.')
115
+ end
116
+
117
+ invalid_properties
118
+ end
119
+
120
+ # Check to see if the all the properties in the model are valid
121
+ # @return true if the model is valid
122
+ def valid?
123
+ warn '[DEPRECATED] the `valid?` method is obsolete'
124
+ return false if @data.nil?
125
+ format_validator = EnumAttributeValidator.new('String', ["wav", "mp3", "aiff", "aac", "ogg", "flac", "m4a", "pcm16", "pcm24"])
126
+ return false unless format_validator.valid?(@format)
127
+ true
128
+ end
129
+
130
+ # Custom attribute writer method with validation
131
+ # @param [Object] data Value to be assigned
132
+ def data=(data)
133
+ if data.nil?
134
+ fail ArgumentError, 'data cannot be nil'
135
+ end
136
+
137
+ @data = data
138
+ end
139
+
140
+ # Custom attribute writer method checking allowed values (enum).
141
+ # @param [Object] format Object to be assigned
142
+ def format=(format)
143
+ validator = EnumAttributeValidator.new('String', ["wav", "mp3", "aiff", "aac", "ogg", "flac", "m4a", "pcm16", "pcm24"])
144
+ unless validator.valid?(format)
145
+ fail ArgumentError, "invalid value for \"format\", must be one of #{validator.allowable_values}."
146
+ end
147
+ @format = format
148
+ end
149
+
150
+ # Checks equality by comparing each attribute.
151
+ # @param [Object] Object to be compared
152
+ def ==(o)
153
+ return true if self.equal?(o)
154
+ self.class == o.class &&
155
+ data == o.data &&
156
+ format == o.format
157
+ end
158
+
159
+ # @see the `==` method
160
+ # @param [Object] Object to be compared
161
+ def eql?(o)
162
+ self == o
163
+ end
164
+
165
+ # Calculates hash code according to all attributes.
166
+ # @return [Integer] Hash code
167
+ def hash
168
+ [data, format].hash
169
+ end
170
+
171
+ # Builds the object from hash
172
+ # @param [Hash] attributes Model attributes in the form of hash
173
+ # @return [Object] Returns the model itself
174
+ def self.build_from_hash(attributes)
175
+ return nil unless attributes.is_a?(Hash)
176
+ attributes = attributes.transform_keys(&:to_sym)
177
+ transformed_hash = {}
178
+ openapi_types.each_pair do |key, type|
179
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
180
+ transformed_hash["#{key}"] = nil
181
+ elsif type =~ /\AArray<(.*)>/i
182
+ # check to ensure the input is an array given that the attribute
183
+ # is documented as an array but the input is not
184
+ if attributes[attribute_map[key]].is_a?(Array)
185
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
186
+ end
187
+ elsif !attributes[attribute_map[key]].nil?
188
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
189
+ end
190
+ end
191
+ new(transformed_hash)
192
+ end
193
+
194
+ # Deserializes the data based on type
195
+ # @param string type Data type
196
+ # @param string value Value to be deserialized
197
+ # @return [Object] Deserialized data
198
+ def self._deserialize(type, value)
199
+ case type.to_sym
200
+ when :Time
201
+ Time.parse(value)
202
+ when :Date
203
+ Date.parse(value)
204
+ when :String
205
+ value.to_s
206
+ when :Integer
207
+ value.to_i
208
+ when :Float
209
+ value.to_f
210
+ when :Boolean
211
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
212
+ true
213
+ else
214
+ false
215
+ end
216
+ when :Object
217
+ # generic object (usually a Hash), return directly
218
+ value
219
+ when /\AArray<(?<inner_type>.+)>\z/
220
+ inner_type = Regexp.last_match[:inner_type]
221
+ value.map { |v| _deserialize(inner_type, v) }
222
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
223
+ k_type = Regexp.last_match[:k_type]
224
+ v_type = Regexp.last_match[:v_type]
225
+ {}.tap do |hash|
226
+ value.each do |k, v|
227
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
228
+ end
229
+ end
230
+ else # model
231
+ # models (e.g. Pet) or oneOf
232
+ klass = VeniceClient.const_get(type)
233
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
234
+ end
235
+ end
236
+
237
+ # Returns the string representation of the object
238
+ # @return [String] String presentation of the object
239
+ def to_s
240
+ to_hash.to_s
241
+ end
242
+
243
+ # to_body is an alias to to_hash (backward compatibility)
244
+ # @return [Hash] Returns the object in the form of hash
245
+ def to_body
246
+ to_hash
247
+ end
248
+
249
+ # Returns the object in the form of hash
250
+ # @return [Hash] Returns the object in the form of hash
251
+ def to_hash
252
+ hash = {}
253
+ self.class.attribute_map.each_pair do |attr, param|
254
+ value = self.send(attr)
255
+ if value.nil?
256
+ is_nullable = self.class.openapi_nullable.include?(attr)
257
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
258
+ end
259
+
260
+ hash[param] = _to_hash(value)
261
+ end
262
+ hash
263
+ end
264
+
265
+ # Outputs non-array value in the form of hash
266
+ # For object, use to_hash. Otherwise, just return the value
267
+ # @param [Object] value Any valid value
268
+ # @return [Hash] Returns the value in the form of hash
269
+ def _to_hash(value)
270
+ if value.is_a?(Array)
271
+ value.compact.map { |v| _to_hash(v) }
272
+ elsif value.is_a?(Hash)
273
+ {}.tap do |hash|
274
+ value.each { |k, v| hash[k] = _to_hash(v) }
275
+ end
276
+ elsif value.respond_to? :to_hash
277
+ value.to_hash
278
+ else
279
+ value
280
+ end
281
+ end
282
+
283
+ end
284
+
285
+ end
@@ -3,7 +3,7 @@
3
3
 
4
4
  #The Venice.ai API.
5
5
 
6
- The version of the OpenAPI document: 20251209.153516
6
+ The version of the OpenAPI document: 20251218.042551
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.14.0
@@ -3,7 +3,7 @@
3
3
 
4
4
  #The Venice.ai API.
5
5
 
6
- The version of the OpenAPI document: 20251209.153516
6
+ The version of the OpenAPI document: 20251218.042551
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.14.0
@@ -3,7 +3,7 @@
3
3
 
4
4
  #The Venice.ai API.
5
5
 
6
- The version of the OpenAPI document: 20251209.153516
6
+ The version of the OpenAPI document: 20251218.042551
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.14.0
@@ -3,7 +3,7 @@
3
3
 
4
4
  #The Venice.ai API.
5
5
 
6
- The version of the OpenAPI document: 20251209.153516
6
+ The version of the OpenAPI document: 20251218.042551
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.14.0
@@ -3,7 +3,7 @@
3
3
 
4
4
  #The Venice.ai API.
5
5
 
6
- The version of the OpenAPI document: 20251209.153516
6
+ The version of the OpenAPI document: 20251218.042551
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.14.0
@@ -3,7 +3,7 @@
3
3
 
4
4
  #The Venice.ai API.
5
5
 
6
- The version of the OpenAPI document: 20251209.153516
6
+ The version of the OpenAPI document: 20251218.042551
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.14.0
@@ -3,7 +3,7 @@
3
3
 
4
4
  #The Venice.ai API.
5
5
 
6
- The version of the OpenAPI document: 20251209.153516
6
+ The version of the OpenAPI document: 20251218.042551
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.14.0
@@ -3,7 +3,7 @@
3
3
 
4
4
  #The Venice.ai API.
5
5
 
6
- The version of the OpenAPI document: 20251209.153516
6
+ The version of the OpenAPI document: 20251218.042551
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.14.0
@@ -3,7 +3,7 @@
3
3
 
4
4
  #The Venice.ai API.
5
5
 
6
- The version of the OpenAPI document: 20251209.153516
6
+ The version of the OpenAPI document: 20251218.042551
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.14.0
@@ -3,7 +3,7 @@
3
3
 
4
4
  #The Venice.ai API.
5
5
 
6
- The version of the OpenAPI document: 20251209.153516
6
+ The version of the OpenAPI document: 20251218.042551
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.14.0
@@ -3,7 +3,7 @@
3
3
 
4
4
  #The Venice.ai API.
5
5
 
6
- The version of the OpenAPI document: 20251209.153516
6
+ The version of the OpenAPI document: 20251218.042551
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.14.0
@@ -3,7 +3,7 @@
3
3
 
4
4
  #The Venice.ai API.
5
5
 
6
- The version of the OpenAPI document: 20251209.153516
6
+ The version of the OpenAPI document: 20251218.042551
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.14.0