venice_client 1.0.5 → 1.0.7
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.
- checksums.yaml +4 -4
- data/.gitignore +2 -0
- data/.openapi-generator/FILES +18 -147
- data/Gemfile.lock +94 -0
- data/README.md +10 -11
- data/docs/APIKeysApi.md +70 -0
- data/docs/AssistantMessage.md +1 -1
- data/docs/BillingUsageResponse.md +2 -0
- data/docs/CharactersApi.md +70 -0
- data/docs/ChatCompletionRequestVeniceParameters.md +7 -5
- data/docs/CreateChatCompletion200ResponseVeniceParameters.md +2 -0
- data/docs/DetailedError.md +20 -0
- data/docs/EditImageRequest.md +1 -1
- data/docs/EditImageRequestImage.md +15 -0
- data/docs/GenerateImageRequest.md +3 -1
- data/docs/GetApiKeyById200Response.md +18 -0
- data/docs/GetApiKeyById200ResponseData.md +34 -0
- data/docs/GetApiKeyRateLimits200Response.md +2 -0
- data/docs/GetBillingUsage200Response.md +2 -0
- data/docs/GetCharacterBySlug200Response.md +20 -0
- data/docs/ImageApi.md +1 -1
- data/docs/ListCharacters200ResponseDataInner.md +5 -1
- data/docs/PreviewApi.md +70 -0
- data/docs/StandardError.md +18 -0
- data/docs/ToolCallFunction.md +3 -1
- data/lib/venice_client/api/api_keys_api.rb +64 -1
- data/lib/venice_client/api/audio_api.rb +1 -1
- data/lib/venice_client/api/billing_api.rb +1 -1
- data/lib/venice_client/api/characters_api.rb +64 -1
- data/lib/venice_client/api/chat_api.rb +1 -1
- data/lib/venice_client/api/embeddings_api.rb +1 -1
- data/lib/venice_client/api/image_api.rb +1 -1
- data/lib/venice_client/api/models_api.rb +1 -1
- data/lib/venice_client/api/preview_api.rb +64 -1
- data/lib/venice_client/api/speech_api.rb +1 -1
- data/lib/venice_client/api_client.rb +1 -1
- data/lib/venice_client/api_error.rb +1 -1
- data/lib/venice_client/configuration.rb +1 -1
- data/lib/venice_client/models/assistant_message.rb +3 -4
- data/lib/venice_client/models/assistant_message_content.rb +1 -1
- data/lib/venice_client/models/audio_model_pricing.rb +1 -1
- data/lib/venice_client/models/audio_model_pricing_input.rb +1 -1
- data/lib/venice_client/models/billing_usage_request.rb +1 -1
- data/lib/venice_client/models/billing_usage_response.rb +12 -2
- data/lib/venice_client/models/chat_completion_request.rb +1 -1
- data/lib/venice_client/models/chat_completion_request_messages_inner.rb +1 -1
- data/lib/venice_client/models/chat_completion_request_response_format.rb +1 -1
- data/lib/venice_client/models/chat_completion_request_stop.rb +1 -1
- data/lib/venice_client/models/chat_completion_request_stream_options.rb +1 -1
- data/lib/venice_client/models/chat_completion_request_tool_choice.rb +1 -1
- data/lib/venice_client/models/chat_completion_request_tool_choice_any_of.rb +1 -1
- data/lib/venice_client/models/chat_completion_request_tool_choice_any_of_function.rb +1 -1
- data/lib/venice_client/models/chat_completion_request_venice_parameters.rb +34 -21
- data/lib/venice_client/models/create_api_key200_response.rb +1 -1
- data/lib/venice_client/models/create_api_key200_response_data.rb +1 -1
- data/lib/venice_client/models/create_api_key_request.rb +2 -2
- data/lib/venice_client/models/create_api_key_request_expires_at.rb +1 -1
- data/lib/venice_client/models/create_chat_completion200_response.rb +1 -1
- data/lib/venice_client/models/create_chat_completion200_response_choices_inner.rb +1 -1
- data/lib/venice_client/models/create_chat_completion200_response_choices_inner_logprobs.rb +1 -1
- data/lib/venice_client/models/create_chat_completion200_response_choices_inner_logprobs_top_logprobs_inner.rb +1 -1
- data/lib/venice_client/models/create_chat_completion200_response_choices_inner_message.rb +1 -1
- data/lib/venice_client/models/create_chat_completion200_response_usage.rb +1 -1
- data/lib/venice_client/models/create_chat_completion200_response_venice_parameters.rb +54 -24
- data/lib/venice_client/models/create_chat_completion200_response_venice_parameters_web_search_citations_inner.rb +1 -1
- data/lib/venice_client/models/create_embedding200_response.rb +1 -1
- data/lib/venice_client/models/create_embedding200_response_data_inner.rb +1 -1
- data/lib/venice_client/models/create_embedding200_response_usage.rb +1 -1
- data/lib/venice_client/models/create_embedding_request_schema.rb +1 -1
- data/lib/venice_client/models/create_embedding_request_schema_input.rb +1 -1
- data/lib/venice_client/models/create_embedding_request_schema_model.rb +1 -1
- data/lib/venice_client/models/create_speech_request_schema.rb +1 -1
- data/lib/venice_client/models/delete_api_key200_response.rb +1 -1
- data/lib/venice_client/models/detailed_error.rb +248 -0
- data/lib/venice_client/models/edit_image_request.rb +2 -2
- data/lib/venice_client/models/edit_image_request_image.rb +104 -0
- data/lib/venice_client/models/generate_image200_response.rb +1 -1
- data/lib/venice_client/models/generate_image200_response_timing.rb +1 -1
- data/lib/venice_client/models/generate_image_request.rb +41 -3
- data/lib/venice_client/models/get_api_key_by_id200_response.rb +237 -0
- data/lib/venice_client/models/get_api_key_by_id200_response_data.rb +401 -0
- data/lib/venice_client/models/get_api_key_generate_web3_key200_response.rb +1 -1
- data/lib/venice_client/models/get_api_key_generate_web3_key200_response_data.rb +1 -1
- data/lib/venice_client/models/get_api_key_rate_limit_logs200_response.rb +1 -1
- data/lib/venice_client/models/get_api_key_rate_limit_logs200_response_data_inner.rb +1 -1
- data/lib/venice_client/models/get_api_key_rate_limits200_response.rb +12 -2
- data/lib/venice_client/models/get_api_key_rate_limits200_response_data.rb +1 -1
- data/lib/venice_client/models/get_api_key_rate_limits200_response_data_api_tier.rb +1 -1
- data/lib/venice_client/models/get_api_key_rate_limits200_response_data_balances.rb +1 -1
- data/lib/venice_client/models/get_api_key_rate_limits200_response_data_rate_limits_inner.rb +1 -1
- data/lib/venice_client/models/get_api_key_rate_limits200_response_data_rate_limits_inner_rate_limits_inner.rb +1 -1
- data/lib/venice_client/models/get_api_keys200_response.rb +1 -1
- data/lib/venice_client/models/get_api_keys200_response_data_inner.rb +1 -1
- data/lib/venice_client/models/get_api_keys200_response_data_inner_consumption_limits.rb +1 -1
- data/lib/venice_client/models/get_api_keys200_response_data_inner_usage.rb +1 -1
- data/lib/venice_client/models/get_api_keys200_response_data_inner_usage_trailing_seven_days.rb +1 -1
- data/lib/venice_client/models/get_billing_usage200_response.rb +12 -2
- data/lib/venice_client/models/get_billing_usage200_response_data_inner.rb +1 -1
- data/lib/venice_client/models/get_billing_usage200_response_data_inner_inference_details.rb +1 -1
- data/lib/venice_client/models/get_billing_usage200_response_pagination.rb +1 -1
- data/lib/venice_client/models/get_character_by_slug200_response.rb +287 -0
- data/lib/venice_client/models/image_model_constraints.rb +1 -1
- data/lib/venice_client/models/image_model_constraints_steps.rb +1 -1
- data/lib/venice_client/models/image_model_pricing.rb +1 -1
- data/lib/venice_client/models/image_model_pricing_generation.rb +1 -1
- data/lib/venice_client/models/image_model_pricing_upscale.rb +1 -1
- data/lib/venice_client/models/image_model_pricing_upscale2x.rb +1 -1
- data/lib/venice_client/models/image_model_pricing_upscale4x.rb +1 -1
- data/lib/venice_client/models/image_styles_get200_response.rb +1 -1
- data/lib/venice_client/models/image_url.rb +1 -1
- data/lib/venice_client/models/image_url_object.rb +1 -1
- data/lib/venice_client/models/json_object.rb +1 -1
- data/lib/venice_client/models/json_schema.rb +1 -1
- data/lib/venice_client/models/list_characters200_response.rb +1 -1
- data/lib/venice_client/models/list_characters200_response_data_inner.rb +45 -5
- data/lib/venice_client/models/list_characters200_response_data_inner_stats.rb +1 -1
- data/lib/venice_client/models/list_model_compatibility_mapping200_response.rb +1 -1
- data/lib/venice_client/models/list_model_traits200_response.rb +1 -1
- data/lib/venice_client/models/list_models200_response.rb +1 -1
- data/lib/venice_client/models/list_models200_response_type.rb +1 -1
- data/lib/venice_client/models/list_models_type_parameter.rb +1 -1
- data/lib/venice_client/models/llm_model_pricing.rb +1 -1
- data/lib/venice_client/models/llm_model_pricing_input.rb +1 -1
- data/lib/venice_client/models/llm_model_pricing_output.rb +1 -1
- data/lib/venice_client/models/model_response.rb +1 -1
- data/lib/venice_client/models/model_response_model_spec.rb +1 -1
- data/lib/venice_client/models/model_response_model_spec_capabilities.rb +3 -3
- data/lib/venice_client/models/model_response_model_spec_constraints.rb +1 -1
- data/lib/venice_client/models/model_response_model_spec_pricing.rb +1 -1
- data/lib/venice_client/models/objects_inner.rb +1 -1
- data/lib/venice_client/models/post_api_key_generate_web3_key_request.rb +1 -1
- data/lib/venice_client/models/simple_generate_image200_response.rb +1 -1
- data/lib/venice_client/models/simple_generate_image200_response_data_inner.rb +1 -1
- data/lib/venice_client/models/simple_generate_image200_response_data_inner_any_of.rb +1 -1
- data/lib/venice_client/models/simple_generate_image200_response_data_inner_any_of1.rb +1 -1
- data/lib/venice_client/models/simple_generate_image_request.rb +1 -1
- data/lib/venice_client/models/standard_error.rb +238 -0
- data/lib/venice_client/models/system_message.rb +1 -1
- data/lib/venice_client/models/system_message_content.rb +1 -1
- data/lib/venice_client/models/text.rb +1 -1
- data/lib/venice_client/models/text_model_constraints.rb +1 -1
- data/lib/venice_client/models/text_model_constraints_temperature.rb +1 -1
- data/lib/venice_client/models/text_model_constraints_top_p.rb +1 -1
- data/lib/venice_client/models/tool_call.rb +1 -1
- data/lib/venice_client/models/tool_call_function.rb +17 -5
- data/lib/venice_client/models/tool_message.rb +2 -1
- data/lib/venice_client/models/upscale_image_request.rb +1 -1
- data/lib/venice_client/models/upscale_image_request_enhance.rb +1 -1
- data/lib/venice_client/models/user_message.rb +1 -1
- data/lib/venice_client/models/user_message_content.rb +1 -1
- data/lib/venice_client/version.rb +2 -2
- data/lib/venice_client.rb +7 -11
- data/package-lock.json +2159 -0
- data/package.json +5 -0
- data/spec/models/detailed_error_spec.rb +42 -0
- data/spec/models/edit_image_request_image_spec.rb +21 -0
- data/spec/models/get_api_key_by_id200_response_data_spec.rb +88 -0
- data/spec/models/get_api_key_by_id200_response_spec.rb +36 -0
- data/spec/models/get_character_by_slug200_response_spec.rb +46 -0
- data/spec/models/standard_error_spec.rb +36 -0
- data/spec/spec_helper.rb +1 -1
- data/swagger.yaml +513 -714
- metadata +28 -1
|
@@ -3,15 +3,15 @@
|
|
|
3
3
|
|
|
4
4
|
#The Venice.ai API.
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document:
|
|
6
|
+
The version of the OpenAPI document: 20250918.173746
|
|
7
7
|
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.14.0
|
|
10
10
|
|
|
11
11
|
=end
|
|
12
12
|
|
|
13
|
-
require
|
|
14
|
-
require
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
15
|
|
|
16
16
|
module VeniceClient
|
|
17
17
|
# Unique parameters to Venice's API implementation.
|
|
@@ -28,6 +28,9 @@ module VeniceClient
|
|
|
28
28
|
# Did the request include search results in the stream?
|
|
29
29
|
attr_accessor :include_search_results_in_stream
|
|
30
30
|
|
|
31
|
+
# Did the request also return search results as a tool-call documents block?
|
|
32
|
+
attr_accessor :return_search_results_as_documents
|
|
33
|
+
|
|
31
34
|
# The character slug of a public Venice character.
|
|
32
35
|
attr_accessor :character_slug
|
|
33
36
|
|
|
@@ -69,10 +72,11 @@ module VeniceClient
|
|
|
69
72
|
:'enable_web_citations' => :'enable_web_citations',
|
|
70
73
|
:'include_venice_system_prompt' => :'include_venice_system_prompt',
|
|
71
74
|
:'include_search_results_in_stream' => :'include_search_results_in_stream',
|
|
75
|
+
:'return_search_results_as_documents' => :'return_search_results_as_documents',
|
|
72
76
|
:'character_slug' => :'character_slug',
|
|
73
77
|
:'strip_thinking_response' => :'strip_thinking_response',
|
|
74
78
|
:'disable_thinking' => :'disable_thinking',
|
|
75
|
-
:'web_search_citations' => :'web_search_citations'
|
|
79
|
+
:'web_search_citations' => :'web_search_citations'
|
|
76
80
|
}
|
|
77
81
|
end
|
|
78
82
|
|
|
@@ -93,16 +97,18 @@ module VeniceClient
|
|
|
93
97
|
:'enable_web_citations' => :'Boolean',
|
|
94
98
|
:'include_venice_system_prompt' => :'Boolean',
|
|
95
99
|
:'include_search_results_in_stream' => :'Boolean',
|
|
100
|
+
:'return_search_results_as_documents' => :'Boolean',
|
|
96
101
|
:'character_slug' => :'String',
|
|
97
102
|
:'strip_thinking_response' => :'Boolean',
|
|
98
103
|
:'disable_thinking' => :'Boolean',
|
|
99
|
-
:'web_search_citations' => :'Array<CreateChatCompletion200ResponseVeniceParametersWebSearchCitationsInner>'
|
|
104
|
+
:'web_search_citations' => :'Array<CreateChatCompletion200ResponseVeniceParametersWebSearchCitationsInner>'
|
|
100
105
|
}
|
|
101
106
|
end
|
|
102
107
|
|
|
103
108
|
# List of attributes with nullable: true
|
|
104
109
|
def self.openapi_nullable
|
|
105
|
-
Set.new([
|
|
110
|
+
Set.new([
|
|
111
|
+
])
|
|
106
112
|
end
|
|
107
113
|
|
|
108
114
|
# Initializes the object
|
|
@@ -145,6 +151,12 @@ module VeniceClient
|
|
|
145
151
|
self.include_search_results_in_stream = nil
|
|
146
152
|
end
|
|
147
153
|
|
|
154
|
+
if attributes.key?(:'return_search_results_as_documents')
|
|
155
|
+
self.return_search_results_as_documents = attributes[:'return_search_results_as_documents']
|
|
156
|
+
else
|
|
157
|
+
self.return_search_results_as_documents = nil
|
|
158
|
+
end
|
|
159
|
+
|
|
148
160
|
if attributes.key?(:'character_slug')
|
|
149
161
|
self.character_slug = attributes[:'character_slug']
|
|
150
162
|
end
|
|
@@ -171,7 +183,7 @@ module VeniceClient
|
|
|
171
183
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
172
184
|
# @return Array for valid properties with the reasons
|
|
173
185
|
def list_invalid_properties
|
|
174
|
-
warn
|
|
186
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
175
187
|
invalid_properties = Array.new
|
|
176
188
|
if @enable_web_search.nil?
|
|
177
189
|
invalid_properties.push('invalid value for "enable_web_search", enable_web_search cannot be nil.')
|
|
@@ -189,6 +201,10 @@ module VeniceClient
|
|
|
189
201
|
invalid_properties.push('invalid value for "include_search_results_in_stream", include_search_results_in_stream cannot be nil.')
|
|
190
202
|
end
|
|
191
203
|
|
|
204
|
+
if @return_search_results_as_documents.nil?
|
|
205
|
+
invalid_properties.push('invalid value for "return_search_results_as_documents", return_search_results_as_documents cannot be nil.')
|
|
206
|
+
end
|
|
207
|
+
|
|
192
208
|
if @strip_thinking_response.nil?
|
|
193
209
|
invalid_properties.push('invalid value for "strip_thinking_response", strip_thinking_response cannot be nil.')
|
|
194
210
|
end
|
|
@@ -203,13 +219,14 @@ module VeniceClient
|
|
|
203
219
|
# Check to see if the all the properties in the model are valid
|
|
204
220
|
# @return true if the model is valid
|
|
205
221
|
def valid?
|
|
206
|
-
warn
|
|
222
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
207
223
|
return false if @enable_web_search.nil?
|
|
208
|
-
enable_web_search_validator = EnumAttributeValidator.new(
|
|
224
|
+
enable_web_search_validator = EnumAttributeValidator.new('String', ["auto", "false", "true"])
|
|
209
225
|
return false unless enable_web_search_validator.valid?(@enable_web_search)
|
|
210
226
|
return false if @enable_web_citations.nil?
|
|
211
227
|
return false if @include_venice_system_prompt.nil?
|
|
212
228
|
return false if @include_search_results_in_stream.nil?
|
|
229
|
+
return false if @return_search_results_as_documents.nil?
|
|
213
230
|
return false if @strip_thinking_response.nil?
|
|
214
231
|
return false if @disable_thinking.nil?
|
|
215
232
|
true
|
|
@@ -218,7 +235,7 @@ module VeniceClient
|
|
|
218
235
|
# Custom attribute writer method checking allowed values (enum).
|
|
219
236
|
# @param [Object] enable_web_search Object to be assigned
|
|
220
237
|
def enable_web_search=(enable_web_search)
|
|
221
|
-
validator = EnumAttributeValidator.new(
|
|
238
|
+
validator = EnumAttributeValidator.new('String', ["auto", "false", "true"])
|
|
222
239
|
unless validator.valid?(enable_web_search)
|
|
223
240
|
fail ArgumentError, "invalid value for \"enable_web_search\", must be one of #{validator.allowable_values}."
|
|
224
241
|
end
|
|
@@ -229,7 +246,7 @@ module VeniceClient
|
|
|
229
246
|
# @param [Object] enable_web_citations Value to be assigned
|
|
230
247
|
def enable_web_citations=(enable_web_citations)
|
|
231
248
|
if enable_web_citations.nil?
|
|
232
|
-
fail ArgumentError,
|
|
249
|
+
fail ArgumentError, 'enable_web_citations cannot be nil'
|
|
233
250
|
end
|
|
234
251
|
|
|
235
252
|
@enable_web_citations = enable_web_citations
|
|
@@ -239,7 +256,7 @@ module VeniceClient
|
|
|
239
256
|
# @param [Object] include_venice_system_prompt Value to be assigned
|
|
240
257
|
def include_venice_system_prompt=(include_venice_system_prompt)
|
|
241
258
|
if include_venice_system_prompt.nil?
|
|
242
|
-
fail ArgumentError,
|
|
259
|
+
fail ArgumentError, 'include_venice_system_prompt cannot be nil'
|
|
243
260
|
end
|
|
244
261
|
|
|
245
262
|
@include_venice_system_prompt = include_venice_system_prompt
|
|
@@ -249,17 +266,27 @@ module VeniceClient
|
|
|
249
266
|
# @param [Object] include_search_results_in_stream Value to be assigned
|
|
250
267
|
def include_search_results_in_stream=(include_search_results_in_stream)
|
|
251
268
|
if include_search_results_in_stream.nil?
|
|
252
|
-
fail ArgumentError,
|
|
269
|
+
fail ArgumentError, 'include_search_results_in_stream cannot be nil'
|
|
253
270
|
end
|
|
254
271
|
|
|
255
272
|
@include_search_results_in_stream = include_search_results_in_stream
|
|
256
273
|
end
|
|
257
274
|
|
|
275
|
+
# Custom attribute writer method with validation
|
|
276
|
+
# @param [Object] return_search_results_as_documents Value to be assigned
|
|
277
|
+
def return_search_results_as_documents=(return_search_results_as_documents)
|
|
278
|
+
if return_search_results_as_documents.nil?
|
|
279
|
+
fail ArgumentError, 'return_search_results_as_documents cannot be nil'
|
|
280
|
+
end
|
|
281
|
+
|
|
282
|
+
@return_search_results_as_documents = return_search_results_as_documents
|
|
283
|
+
end
|
|
284
|
+
|
|
258
285
|
# Custom attribute writer method with validation
|
|
259
286
|
# @param [Object] strip_thinking_response Value to be assigned
|
|
260
287
|
def strip_thinking_response=(strip_thinking_response)
|
|
261
288
|
if strip_thinking_response.nil?
|
|
262
|
-
fail ArgumentError,
|
|
289
|
+
fail ArgumentError, 'strip_thinking_response cannot be nil'
|
|
263
290
|
end
|
|
264
291
|
|
|
265
292
|
@strip_thinking_response = strip_thinking_response
|
|
@@ -269,7 +296,7 @@ module VeniceClient
|
|
|
269
296
|
# @param [Object] disable_thinking Value to be assigned
|
|
270
297
|
def disable_thinking=(disable_thinking)
|
|
271
298
|
if disable_thinking.nil?
|
|
272
|
-
fail ArgumentError,
|
|
299
|
+
fail ArgumentError, 'disable_thinking cannot be nil'
|
|
273
300
|
end
|
|
274
301
|
|
|
275
302
|
@disable_thinking = disable_thinking
|
|
@@ -280,14 +307,15 @@ module VeniceClient
|
|
|
280
307
|
def ==(o)
|
|
281
308
|
return true if self.equal?(o)
|
|
282
309
|
self.class == o.class &&
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
310
|
+
enable_web_search == o.enable_web_search &&
|
|
311
|
+
enable_web_citations == o.enable_web_citations &&
|
|
312
|
+
include_venice_system_prompt == o.include_venice_system_prompt &&
|
|
313
|
+
include_search_results_in_stream == o.include_search_results_in_stream &&
|
|
314
|
+
return_search_results_as_documents == o.return_search_results_as_documents &&
|
|
315
|
+
character_slug == o.character_slug &&
|
|
316
|
+
strip_thinking_response == o.strip_thinking_response &&
|
|
317
|
+
disable_thinking == o.disable_thinking &&
|
|
318
|
+
web_search_citations == o.web_search_citations
|
|
291
319
|
end
|
|
292
320
|
|
|
293
321
|
# @see the `==` method
|
|
@@ -299,7 +327,7 @@ module VeniceClient
|
|
|
299
327
|
# Calculates hash code according to all attributes.
|
|
300
328
|
# @return [Integer] Hash code
|
|
301
329
|
def hash
|
|
302
|
-
[enable_web_search, enable_web_citations, include_venice_system_prompt, include_search_results_in_stream, character_slug, strip_thinking_response, disable_thinking, web_search_citations].hash
|
|
330
|
+
[enable_web_search, enable_web_citations, include_venice_system_prompt, include_search_results_in_stream, return_search_results_as_documents, character_slug, strip_thinking_response, disable_thinking, web_search_citations].hash
|
|
303
331
|
end
|
|
304
332
|
|
|
305
333
|
# Builds the object from hash
|
|
@@ -413,5 +441,7 @@ module VeniceClient
|
|
|
413
441
|
value
|
|
414
442
|
end
|
|
415
443
|
end
|
|
444
|
+
|
|
416
445
|
end
|
|
446
|
+
|
|
417
447
|
end
|
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Venice.ai API
|
|
3
|
+
|
|
4
|
+
#The Venice.ai API.
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 20250918.173746
|
|
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 DetailedError
|
|
18
|
+
# Details about the incorrect input
|
|
19
|
+
attr_accessor :details
|
|
20
|
+
|
|
21
|
+
# A description of the error
|
|
22
|
+
attr_accessor :error
|
|
23
|
+
|
|
24
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
25
|
+
def self.attribute_map
|
|
26
|
+
{
|
|
27
|
+
:'details' => :'details',
|
|
28
|
+
:'error' => :'error'
|
|
29
|
+
}
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# Returns attribute mapping this model knows about
|
|
33
|
+
def self.acceptable_attribute_map
|
|
34
|
+
attribute_map
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
# Returns all the JSON keys this model knows about
|
|
38
|
+
def self.acceptable_attributes
|
|
39
|
+
acceptable_attribute_map.values
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
# Attribute type mapping.
|
|
43
|
+
def self.openapi_types
|
|
44
|
+
{
|
|
45
|
+
:'details' => :'Object',
|
|
46
|
+
:'error' => :'String'
|
|
47
|
+
}
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
# List of attributes with nullable: true
|
|
51
|
+
def self.openapi_nullable
|
|
52
|
+
Set.new([
|
|
53
|
+
])
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
# Initializes the object
|
|
57
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
58
|
+
def initialize(attributes = {})
|
|
59
|
+
if (!attributes.is_a?(Hash))
|
|
60
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `VeniceClient::DetailedError` initialize method"
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
64
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
65
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
66
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
67
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `VeniceClient::DetailedError`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
68
|
+
end
|
|
69
|
+
h[k.to_sym] = v
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
if attributes.key?(:'details')
|
|
73
|
+
self.details = attributes[:'details']
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
if attributes.key?(:'error')
|
|
77
|
+
self.error = attributes[:'error']
|
|
78
|
+
else
|
|
79
|
+
self.error = nil
|
|
80
|
+
end
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
84
|
+
# @return Array for valid properties with the reasons
|
|
85
|
+
def list_invalid_properties
|
|
86
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
87
|
+
invalid_properties = Array.new
|
|
88
|
+
if @error.nil?
|
|
89
|
+
invalid_properties.push('invalid value for "error", error cannot be nil.')
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
invalid_properties
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
# Check to see if the all the properties in the model are valid
|
|
96
|
+
# @return true if the model is valid
|
|
97
|
+
def valid?
|
|
98
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
99
|
+
return false if @error.nil?
|
|
100
|
+
true
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
# Custom attribute writer method with validation
|
|
104
|
+
# @param [Object] error Value to be assigned
|
|
105
|
+
def error=(error)
|
|
106
|
+
if error.nil?
|
|
107
|
+
fail ArgumentError, 'error cannot be nil'
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
@error = error
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
# Checks equality by comparing each attribute.
|
|
114
|
+
# @param [Object] Object to be compared
|
|
115
|
+
def ==(o)
|
|
116
|
+
return true if self.equal?(o)
|
|
117
|
+
self.class == o.class &&
|
|
118
|
+
details == o.details &&
|
|
119
|
+
error == o.error
|
|
120
|
+
end
|
|
121
|
+
|
|
122
|
+
# @see the `==` method
|
|
123
|
+
# @param [Object] Object to be compared
|
|
124
|
+
def eql?(o)
|
|
125
|
+
self == o
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
# Calculates hash code according to all attributes.
|
|
129
|
+
# @return [Integer] Hash code
|
|
130
|
+
def hash
|
|
131
|
+
[details, error].hash
|
|
132
|
+
end
|
|
133
|
+
|
|
134
|
+
# Builds the object from hash
|
|
135
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
136
|
+
# @return [Object] Returns the model itself
|
|
137
|
+
def self.build_from_hash(attributes)
|
|
138
|
+
return nil unless attributes.is_a?(Hash)
|
|
139
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
140
|
+
transformed_hash = {}
|
|
141
|
+
openapi_types.each_pair do |key, type|
|
|
142
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
143
|
+
transformed_hash["#{key}"] = nil
|
|
144
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
145
|
+
# check to ensure the input is an array given that the attribute
|
|
146
|
+
# is documented as an array but the input is not
|
|
147
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
148
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
149
|
+
end
|
|
150
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
151
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
152
|
+
end
|
|
153
|
+
end
|
|
154
|
+
new(transformed_hash)
|
|
155
|
+
end
|
|
156
|
+
|
|
157
|
+
# Deserializes the data based on type
|
|
158
|
+
# @param string type Data type
|
|
159
|
+
# @param string value Value to be deserialized
|
|
160
|
+
# @return [Object] Deserialized data
|
|
161
|
+
def self._deserialize(type, value)
|
|
162
|
+
case type.to_sym
|
|
163
|
+
when :Time
|
|
164
|
+
Time.parse(value)
|
|
165
|
+
when :Date
|
|
166
|
+
Date.parse(value)
|
|
167
|
+
when :String
|
|
168
|
+
value.to_s
|
|
169
|
+
when :Integer
|
|
170
|
+
value.to_i
|
|
171
|
+
when :Float
|
|
172
|
+
value.to_f
|
|
173
|
+
when :Boolean
|
|
174
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
175
|
+
true
|
|
176
|
+
else
|
|
177
|
+
false
|
|
178
|
+
end
|
|
179
|
+
when :Object
|
|
180
|
+
# generic object (usually a Hash), return directly
|
|
181
|
+
value
|
|
182
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
183
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
184
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
185
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
186
|
+
k_type = Regexp.last_match[:k_type]
|
|
187
|
+
v_type = Regexp.last_match[:v_type]
|
|
188
|
+
{}.tap do |hash|
|
|
189
|
+
value.each do |k, v|
|
|
190
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
191
|
+
end
|
|
192
|
+
end
|
|
193
|
+
else # model
|
|
194
|
+
# models (e.g. Pet) or oneOf
|
|
195
|
+
klass = VeniceClient.const_get(type)
|
|
196
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
197
|
+
end
|
|
198
|
+
end
|
|
199
|
+
|
|
200
|
+
# Returns the string representation of the object
|
|
201
|
+
# @return [String] String presentation of the object
|
|
202
|
+
def to_s
|
|
203
|
+
to_hash.to_s
|
|
204
|
+
end
|
|
205
|
+
|
|
206
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
207
|
+
# @return [Hash] Returns the object in the form of hash
|
|
208
|
+
def to_body
|
|
209
|
+
to_hash
|
|
210
|
+
end
|
|
211
|
+
|
|
212
|
+
# Returns the object in the form of hash
|
|
213
|
+
# @return [Hash] Returns the object in the form of hash
|
|
214
|
+
def to_hash
|
|
215
|
+
hash = {}
|
|
216
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
217
|
+
value = self.send(attr)
|
|
218
|
+
if value.nil?
|
|
219
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
220
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
221
|
+
end
|
|
222
|
+
|
|
223
|
+
hash[param] = _to_hash(value)
|
|
224
|
+
end
|
|
225
|
+
hash
|
|
226
|
+
end
|
|
227
|
+
|
|
228
|
+
# Outputs non-array value in the form of hash
|
|
229
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
230
|
+
# @param [Object] value Any valid value
|
|
231
|
+
# @return [Hash] Returns the value in the form of hash
|
|
232
|
+
def _to_hash(value)
|
|
233
|
+
if value.is_a?(Array)
|
|
234
|
+
value.compact.map { |v| _to_hash(v) }
|
|
235
|
+
elsif value.is_a?(Hash)
|
|
236
|
+
{}.tap do |hash|
|
|
237
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
238
|
+
end
|
|
239
|
+
elsif value.respond_to? :to_hash
|
|
240
|
+
value.to_hash
|
|
241
|
+
else
|
|
242
|
+
value
|
|
243
|
+
end
|
|
244
|
+
end
|
|
245
|
+
|
|
246
|
+
end
|
|
247
|
+
|
|
248
|
+
end
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#The Venice.ai API.
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document:
|
|
6
|
+
The version of the OpenAPI document: 20250918.173746
|
|
7
7
|
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.14.0
|
|
@@ -43,7 +43,7 @@ module VeniceClient
|
|
|
43
43
|
def self.openapi_types
|
|
44
44
|
{
|
|
45
45
|
:'prompt' => :'String',
|
|
46
|
-
:'image' => :'
|
|
46
|
+
:'image' => :'EditImageRequestImage'
|
|
47
47
|
}
|
|
48
48
|
end
|
|
49
49
|
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Venice.ai API
|
|
3
|
+
|
|
4
|
+
#The Venice.ai API.
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 20250918.173746
|
|
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
|
+
# The image to edit. Can be either a file upload, a base64-encoded string, or a URL starting with http:// or https://. Image dimensions must be at least 65536 pixels and must not exceed 33177600 pixels. Image URLs must be less than 10MB.
|
|
18
|
+
module EditImageRequestImage
|
|
19
|
+
class << self
|
|
20
|
+
# List of class defined in anyOf (OpenAPI v3)
|
|
21
|
+
def openapi_any_of
|
|
22
|
+
[
|
|
23
|
+
:'String'
|
|
24
|
+
]
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
# Builds the object
|
|
28
|
+
# @param [Mixed] Data to be matched against the list of anyOf items
|
|
29
|
+
# @return [Object] Returns the model or the data itself
|
|
30
|
+
def build(data)
|
|
31
|
+
# Go through the list of anyOf items and attempt to identify the appropriate one.
|
|
32
|
+
# Note:
|
|
33
|
+
# - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 })
|
|
34
|
+
# due to the way the deserialization is made in the base_object template (it just casts without verifying).
|
|
35
|
+
# - TODO: scalar values are de facto behaving as if they were nullable.
|
|
36
|
+
# - TODO: logging when debugging is set.
|
|
37
|
+
openapi_any_of.each do |klass|
|
|
38
|
+
begin
|
|
39
|
+
next if klass == :AnyType # "nullable: true"
|
|
40
|
+
typed_data = find_and_cast_into_type(klass, data)
|
|
41
|
+
return typed_data if typed_data
|
|
42
|
+
rescue # rescue all errors so we keep iterating even if the current item lookup raises
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
openapi_any_of.include?(:AnyType) ? data : nil
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
private
|
|
50
|
+
|
|
51
|
+
SchemaMismatchError = Class.new(StandardError)
|
|
52
|
+
|
|
53
|
+
# Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse.
|
|
54
|
+
def find_and_cast_into_type(klass, data)
|
|
55
|
+
return if data.nil?
|
|
56
|
+
|
|
57
|
+
case klass.to_s
|
|
58
|
+
when 'Boolean'
|
|
59
|
+
return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass)
|
|
60
|
+
when 'Float'
|
|
61
|
+
return data if data.instance_of?(Float)
|
|
62
|
+
when 'Integer'
|
|
63
|
+
return data if data.instance_of?(Integer)
|
|
64
|
+
when 'Time'
|
|
65
|
+
return Time.parse(data)
|
|
66
|
+
when 'Date'
|
|
67
|
+
return Date.iso8601(data)
|
|
68
|
+
when 'String'
|
|
69
|
+
return data if data.instance_of?(String)
|
|
70
|
+
when 'Object' # "type: object"
|
|
71
|
+
return data if data.instance_of?(Hash)
|
|
72
|
+
when /\AArray<(?<sub_type>.+)>\z/ # "type: array"
|
|
73
|
+
if data.instance_of?(Array)
|
|
74
|
+
sub_type = Regexp.last_match[:sub_type]
|
|
75
|
+
return data.map { |item| find_and_cast_into_type(sub_type, item) }
|
|
76
|
+
end
|
|
77
|
+
when /\AHash<String, (?<sub_type>.+)>\z/ # "type: object" with "additionalProperties: { ... }"
|
|
78
|
+
if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) }
|
|
79
|
+
sub_type = Regexp.last_match[:sub_type]
|
|
80
|
+
return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type, v) }
|
|
81
|
+
end
|
|
82
|
+
else # model
|
|
83
|
+
const = VeniceClient.const_get(klass)
|
|
84
|
+
if const
|
|
85
|
+
if const.respond_to?(:openapi_any_of) # nested anyOf model
|
|
86
|
+
model = const.build(data)
|
|
87
|
+
return model if model
|
|
88
|
+
else
|
|
89
|
+
# raise if data contains keys that are not known to the model
|
|
90
|
+
raise if const.respond_to?(:acceptable_attributes) && !(data.keys - const.acceptable_attributes).empty?
|
|
91
|
+
model = const.build_from_hash(data)
|
|
92
|
+
return model if model
|
|
93
|
+
end
|
|
94
|
+
end
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
raise # if no match by now, raise
|
|
98
|
+
rescue
|
|
99
|
+
raise SchemaMismatchError, "#{data} doesn't match the #{klass} type"
|
|
100
|
+
end
|
|
101
|
+
end
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
end
|