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