venice_client 1.0.19 → 1.0.21
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/README.md +15 -1
- data/docs/AudioModelPricingInput.md +0 -2
- data/docs/CacheControl.md +20 -0
- data/docs/ChatApi.md +1 -1
- data/docs/ChatCompletionRequest.md +7 -1
- data/docs/ChatCompletionRequestReasoning.md +18 -0
- data/docs/ChatCompletionRequestVeniceParameters.md +3 -1
- data/docs/CompleteVideo200Response.md +18 -0
- data/docs/CompleteVideoRequest.md +20 -0
- data/docs/CreateChatCompletion200Response.md +1 -1
- data/docs/CreateChatCompletion200ResponseVeniceParameters.md +2 -0
- data/docs/GenerateImageRequest.md +9 -3
- data/docs/GetApiKeyRateLimitLogs200ResponseDataInner.md +1 -1
- data/docs/GetApiKeyRateLimits200Response.md +0 -2
- data/docs/GetApiKeyRateLimits200ResponseDataBalances.md +0 -2
- data/docs/GetApiKeyRateLimits200ResponseDataRateLimitsInner.md +1 -1
- data/docs/ImageApi.md +1 -1
- data/docs/ImageModelPricingGeneration.md +0 -2
- data/docs/ImageModelPricingUpscale2x.md +0 -2
- data/docs/ImageModelPricingUpscale4x.md +0 -2
- data/docs/ImageUrl.md +2 -0
- data/docs/LLMModelPricingInput.md +0 -2
- data/docs/LLMModelPricingOutput.md +0 -2
- data/docs/ModelResponseModelSpec.md +2 -0
- data/docs/ModelResponseModelSpecConstraints.md +13 -1
- data/docs/ModelsApi.md +2 -2
- data/docs/QueueVideo200Response.md +20 -0
- data/docs/QueueVideoRequest.md +32 -0
- data/docs/QuoteVideo200Response.md +18 -0
- data/docs/RetrieveVideo200Response.md +22 -0
- data/docs/RetrieveVideoRequest.md +22 -0
- data/docs/SimpleGenerateImageRequest.md +1 -1
- data/docs/Text.md +2 -0
- data/docs/VideoApi.md +295 -0
- data/docs/VideoModelConstraints.md +28 -0
- data/lib/venice_client/api/api_keys_api.rb +1 -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 +1 -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 +3 -3
- data/lib/venice_client/api/preview_api.rb +1 -1
- data/lib/venice_client/api/speech_api.rb +1 -1
- data/lib/venice_client/api/video_api.rb +278 -0
- 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 +8 -8
- 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 +2 -29
- data/lib/venice_client/models/billing_usage_request.rb +1 -1
- data/lib/venice_client/models/billing_usage_response.rb +1 -1
- data/lib/venice_client/models/cache_control.rb +273 -0
- data/lib/venice_client/models/chat_completion_request.rb +65 -2
- data/lib/venice_client/models/chat_completion_request_messages_inner.rb +2 -2
- data/lib/venice_client/models/chat_completion_request_reasoning.rb +256 -0
- 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 +15 -3
- data/lib/venice_client/models/complete_video200_response.rb +238 -0
- data/lib/venice_client/models/complete_video_request.rb +265 -0
- 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 +1 -1
- data/lib/venice_client/models/create_api_key_request_expires_at.rb +1 -1
- data/lib/venice_client/models/create_chat_completion200_response.rb +11 -19
- data/lib/venice_client/models/create_chat_completion200_response_choices_inner.rb +7 -7
- 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 +2 -2
- 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 +29 -2
- 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 +1 -1
- data/lib/venice_client/models/edit_image_request.rb +1 -1
- data/lib/venice_client/models/edit_image_request_image.rb +1 -1
- 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 +44 -42
- data/lib/venice_client/models/get_api_key_by_id200_response.rb +1 -1
- data/lib/venice_client/models/get_api_key_by_id200_response_data.rb +1 -1
- 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 +2 -2
- data/lib/venice_client/models/get_api_key_rate_limits200_response.rb +2 -12
- 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 +2 -12
- 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 +1 -1
- 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 +1 -1
- 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 +2 -29
- data/lib/venice_client/models/image_model_pricing_upscale.rb +1 -1
- data/lib/venice_client/models/image_model_pricing_upscale2x.rb +2 -29
- data/lib/venice_client/models/image_model_pricing_upscale4x.rb +2 -29
- data/lib/venice_client/models/image_styles_get200_response.rb +1 -1
- data/lib/venice_client/models/image_url.rb +12 -3
- 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 +1 -1
- 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 +2 -29
- data/lib/venice_client/models/llm_model_pricing_output.rb +2 -29
- data/lib/venice_client/models/model_response.rb +3 -3
- data/lib/venice_client/models/model_response_model_spec.rb +46 -2
- data/lib/venice_client/models/model_response_model_spec_capabilities.rb +3 -3
- data/lib/venice_client/models/model_response_model_spec_constraints.rb +3 -2
- 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/queue_video200_response.rb +265 -0
- data/lib/venice_client/models/queue_video_request.rb +438 -0
- data/lib/venice_client/models/quote_video200_response.rb +237 -0
- data/lib/venice_client/models/retrieve_video200_response.rb +316 -0
- data/lib/venice_client/models/retrieve_video_request.rb +277 -0
- 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 +1 -1
- data/lib/venice_client/models/system_message.rb +8 -8
- data/lib/venice_client/models/system_message_content.rb +1 -1
- data/lib/venice_client/models/text.rb +12 -3
- 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 +1 -1
- data/lib/venice_client/models/tool_message.rb +8 -8
- 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 +8 -8
- data/lib/venice_client/models/user_message_content.rb +1 -1
- data/lib/venice_client/models/video_model_constraints.rb +404 -0
- data/lib/venice_client/version.rb +2 -2
- data/lib/venice_client.rb +12 -1
- data/spec/api/video_api_spec.rb +83 -0
- data/spec/models/cache_control_spec.rb +46 -0
- data/spec/models/chat_completion_request_reasoning_spec.rb +40 -0
- data/spec/models/complete_video200_response_spec.rb +36 -0
- data/spec/models/complete_video_request_spec.rb +42 -0
- data/spec/models/queue_video200_response_spec.rb +42 -0
- data/spec/models/queue_video_request_spec.rb +86 -0
- data/spec/models/quote_video200_response_spec.rb +36 -0
- data/spec/models/retrieve_video200_response_spec.rb +52 -0
- data/spec/models/retrieve_video_request_spec.rb +48 -0
- data/spec/models/video_model_constraints_spec.rb +70 -0
- data/spec/spec_helper.rb +1 -1
- data/swagger.yaml +587 -76
- data/venice_client.gemspec +1 -1
- metadata +46 -2
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Venice.ai API
|
|
3
|
+
|
|
4
|
+
#The Venice.ai API.
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 20251209.153516
|
|
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 RetrieveVideoRequest
|
|
18
|
+
# The ID of the model used for video generation.
|
|
19
|
+
attr_accessor :model
|
|
20
|
+
|
|
21
|
+
# The ID of the video generation request.
|
|
22
|
+
attr_accessor :queue_id
|
|
23
|
+
|
|
24
|
+
# If true, the video media will be deleted from storage after the request is completed. If false, you can use the complete endpoint to remove the media once you have successfully downloaded the video.
|
|
25
|
+
attr_accessor :delete_media_on_completion
|
|
26
|
+
|
|
27
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
28
|
+
def self.attribute_map
|
|
29
|
+
{
|
|
30
|
+
:'model' => :'model',
|
|
31
|
+
:'queue_id' => :'queue_id',
|
|
32
|
+
:'delete_media_on_completion' => :'delete_media_on_completion'
|
|
33
|
+
}
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# Returns attribute mapping this model knows about
|
|
37
|
+
def self.acceptable_attribute_map
|
|
38
|
+
attribute_map
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
# Returns all the JSON keys this model knows about
|
|
42
|
+
def self.acceptable_attributes
|
|
43
|
+
acceptable_attribute_map.values
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
# Attribute type mapping.
|
|
47
|
+
def self.openapi_types
|
|
48
|
+
{
|
|
49
|
+
:'model' => :'String',
|
|
50
|
+
:'queue_id' => :'String',
|
|
51
|
+
:'delete_media_on_completion' => :'Boolean'
|
|
52
|
+
}
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
# List of attributes with nullable: true
|
|
56
|
+
def self.openapi_nullable
|
|
57
|
+
Set.new([
|
|
58
|
+
])
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
# Initializes the object
|
|
62
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
63
|
+
def initialize(attributes = {})
|
|
64
|
+
if (!attributes.is_a?(Hash))
|
|
65
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `VeniceClient::RetrieveVideoRequest` initialize method"
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
69
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
70
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
71
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
72
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `VeniceClient::RetrieveVideoRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
73
|
+
end
|
|
74
|
+
h[k.to_sym] = v
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
if attributes.key?(:'model')
|
|
78
|
+
self.model = attributes[:'model']
|
|
79
|
+
else
|
|
80
|
+
self.model = nil
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
if attributes.key?(:'queue_id')
|
|
84
|
+
self.queue_id = attributes[:'queue_id']
|
|
85
|
+
else
|
|
86
|
+
self.queue_id = nil
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
if attributes.key?(:'delete_media_on_completion')
|
|
90
|
+
self.delete_media_on_completion = attributes[:'delete_media_on_completion']
|
|
91
|
+
else
|
|
92
|
+
self.delete_media_on_completion = false
|
|
93
|
+
end
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
97
|
+
# @return Array for valid properties with the reasons
|
|
98
|
+
def list_invalid_properties
|
|
99
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
100
|
+
invalid_properties = Array.new
|
|
101
|
+
if @model.nil?
|
|
102
|
+
invalid_properties.push('invalid value for "model", model cannot be nil.')
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
if @queue_id.nil?
|
|
106
|
+
invalid_properties.push('invalid value for "queue_id", queue_id cannot be nil.')
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
invalid_properties
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
# Check to see if the all the properties in the model are valid
|
|
113
|
+
# @return true if the model is valid
|
|
114
|
+
def valid?
|
|
115
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
116
|
+
return false if @model.nil?
|
|
117
|
+
return false if @queue_id.nil?
|
|
118
|
+
true
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
# Custom attribute writer method with validation
|
|
122
|
+
# @param [Object] model Value to be assigned
|
|
123
|
+
def model=(model)
|
|
124
|
+
if model.nil?
|
|
125
|
+
fail ArgumentError, 'model cannot be nil'
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
@model = model
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
# Custom attribute writer method with validation
|
|
132
|
+
# @param [Object] queue_id Value to be assigned
|
|
133
|
+
def queue_id=(queue_id)
|
|
134
|
+
if queue_id.nil?
|
|
135
|
+
fail ArgumentError, 'queue_id cannot be nil'
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
@queue_id = queue_id
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
# Checks equality by comparing each attribute.
|
|
142
|
+
# @param [Object] Object to be compared
|
|
143
|
+
def ==(o)
|
|
144
|
+
return true if self.equal?(o)
|
|
145
|
+
self.class == o.class &&
|
|
146
|
+
model == o.model &&
|
|
147
|
+
queue_id == o.queue_id &&
|
|
148
|
+
delete_media_on_completion == o.delete_media_on_completion
|
|
149
|
+
end
|
|
150
|
+
|
|
151
|
+
# @see the `==` method
|
|
152
|
+
# @param [Object] Object to be compared
|
|
153
|
+
def eql?(o)
|
|
154
|
+
self == o
|
|
155
|
+
end
|
|
156
|
+
|
|
157
|
+
# Calculates hash code according to all attributes.
|
|
158
|
+
# @return [Integer] Hash code
|
|
159
|
+
def hash
|
|
160
|
+
[model, queue_id, delete_media_on_completion].hash
|
|
161
|
+
end
|
|
162
|
+
|
|
163
|
+
# Builds the object from hash
|
|
164
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
165
|
+
# @return [Object] Returns the model itself
|
|
166
|
+
def self.build_from_hash(attributes)
|
|
167
|
+
return nil unless attributes.is_a?(Hash)
|
|
168
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
169
|
+
transformed_hash = {}
|
|
170
|
+
openapi_types.each_pair do |key, type|
|
|
171
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
172
|
+
transformed_hash["#{key}"] = nil
|
|
173
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
174
|
+
# check to ensure the input is an array given that the attribute
|
|
175
|
+
# is documented as an array but the input is not
|
|
176
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
177
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
178
|
+
end
|
|
179
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
180
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
181
|
+
end
|
|
182
|
+
end
|
|
183
|
+
new(transformed_hash)
|
|
184
|
+
end
|
|
185
|
+
|
|
186
|
+
# Deserializes the data based on type
|
|
187
|
+
# @param string type Data type
|
|
188
|
+
# @param string value Value to be deserialized
|
|
189
|
+
# @return [Object] Deserialized data
|
|
190
|
+
def self._deserialize(type, value)
|
|
191
|
+
case type.to_sym
|
|
192
|
+
when :Time
|
|
193
|
+
Time.parse(value)
|
|
194
|
+
when :Date
|
|
195
|
+
Date.parse(value)
|
|
196
|
+
when :String
|
|
197
|
+
value.to_s
|
|
198
|
+
when :Integer
|
|
199
|
+
value.to_i
|
|
200
|
+
when :Float
|
|
201
|
+
value.to_f
|
|
202
|
+
when :Boolean
|
|
203
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
204
|
+
true
|
|
205
|
+
else
|
|
206
|
+
false
|
|
207
|
+
end
|
|
208
|
+
when :Object
|
|
209
|
+
# generic object (usually a Hash), return directly
|
|
210
|
+
value
|
|
211
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
212
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
213
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
214
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
215
|
+
k_type = Regexp.last_match[:k_type]
|
|
216
|
+
v_type = Regexp.last_match[:v_type]
|
|
217
|
+
{}.tap do |hash|
|
|
218
|
+
value.each do |k, v|
|
|
219
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
220
|
+
end
|
|
221
|
+
end
|
|
222
|
+
else # model
|
|
223
|
+
# models (e.g. Pet) or oneOf
|
|
224
|
+
klass = VeniceClient.const_get(type)
|
|
225
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
226
|
+
end
|
|
227
|
+
end
|
|
228
|
+
|
|
229
|
+
# Returns the string representation of the object
|
|
230
|
+
# @return [String] String presentation of the object
|
|
231
|
+
def to_s
|
|
232
|
+
to_hash.to_s
|
|
233
|
+
end
|
|
234
|
+
|
|
235
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
236
|
+
# @return [Hash] Returns the object in the form of hash
|
|
237
|
+
def to_body
|
|
238
|
+
to_hash
|
|
239
|
+
end
|
|
240
|
+
|
|
241
|
+
# Returns the object in the form of hash
|
|
242
|
+
# @return [Hash] Returns the object in the form of hash
|
|
243
|
+
def to_hash
|
|
244
|
+
hash = {}
|
|
245
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
246
|
+
value = self.send(attr)
|
|
247
|
+
if value.nil?
|
|
248
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
249
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
250
|
+
end
|
|
251
|
+
|
|
252
|
+
hash[param] = _to_hash(value)
|
|
253
|
+
end
|
|
254
|
+
hash
|
|
255
|
+
end
|
|
256
|
+
|
|
257
|
+
# Outputs non-array value in the form of hash
|
|
258
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
259
|
+
# @param [Object] value Any valid value
|
|
260
|
+
# @return [Hash] Returns the value in the form of hash
|
|
261
|
+
def _to_hash(value)
|
|
262
|
+
if value.is_a?(Array)
|
|
263
|
+
value.compact.map { |v| _to_hash(v) }
|
|
264
|
+
elsif value.is_a?(Hash)
|
|
265
|
+
{}.tap do |hash|
|
|
266
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
267
|
+
end
|
|
268
|
+
elsif value.respond_to? :to_hash
|
|
269
|
+
value.to_hash
|
|
270
|
+
else
|
|
271
|
+
value
|
|
272
|
+
end
|
|
273
|
+
end
|
|
274
|
+
|
|
275
|
+
end
|
|
276
|
+
|
|
277
|
+
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: 20251209.153516
|
|
7
7
|
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.14.0
|
|
@@ -88,9 +88,9 @@ module VeniceClient
|
|
|
88
88
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
89
89
|
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
90
90
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
91
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
92
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `VeniceClient::SystemMessage`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
93
|
+
end
|
|
94
94
|
h[k.to_sym] = v
|
|
95
95
|
}
|
|
96
96
|
|
|
@@ -151,10 +151,10 @@ module VeniceClient
|
|
|
151
151
|
# Custom attribute writer method checking allowed values (enum).
|
|
152
152
|
# @param [Object] role Object to be assigned
|
|
153
153
|
def role=(role)
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
154
|
+
validator = EnumAttributeValidator.new('String', ["system"])
|
|
155
|
+
unless validator.valid?(role)
|
|
156
|
+
fail ArgumentError, "invalid value for \"role\", must be one of #{validator.allowable_values}."
|
|
157
|
+
end
|
|
158
158
|
@role = role
|
|
159
159
|
end
|
|
160
160
|
|
|
@@ -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: 20251209.153516
|
|
7
7
|
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.14.0
|
|
@@ -14,8 +14,10 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module VeniceClient
|
|
17
|
-
# Text message type.
|
|
17
|
+
# Text message type. Supports optional cache_control for prompt caching on supported providers.
|
|
18
18
|
class Text
|
|
19
|
+
attr_accessor :cache_control
|
|
20
|
+
|
|
19
21
|
# The prompt text of the message. Must be at-least one character in length
|
|
20
22
|
attr_accessor :text
|
|
21
23
|
|
|
@@ -46,6 +48,7 @@ module VeniceClient
|
|
|
46
48
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
47
49
|
def self.attribute_map
|
|
48
50
|
{
|
|
51
|
+
:'cache_control' => :'cache_control',
|
|
49
52
|
:'text' => :'text',
|
|
50
53
|
:'type' => :'type'
|
|
51
54
|
}
|
|
@@ -64,6 +67,7 @@ module VeniceClient
|
|
|
64
67
|
# Attribute type mapping.
|
|
65
68
|
def self.openapi_types
|
|
66
69
|
{
|
|
70
|
+
:'cache_control' => :'CacheControl',
|
|
67
71
|
:'text' => :'String',
|
|
68
72
|
:'type' => :'String'
|
|
69
73
|
}
|
|
@@ -91,6 +95,10 @@ module VeniceClient
|
|
|
91
95
|
h[k.to_sym] = v
|
|
92
96
|
}
|
|
93
97
|
|
|
98
|
+
if attributes.key?(:'cache_control')
|
|
99
|
+
self.cache_control = attributes[:'cache_control']
|
|
100
|
+
end
|
|
101
|
+
|
|
94
102
|
if attributes.key?(:'text')
|
|
95
103
|
self.text = attributes[:'text']
|
|
96
104
|
else
|
|
@@ -165,6 +173,7 @@ module VeniceClient
|
|
|
165
173
|
def ==(o)
|
|
166
174
|
return true if self.equal?(o)
|
|
167
175
|
self.class == o.class &&
|
|
176
|
+
cache_control == o.cache_control &&
|
|
168
177
|
text == o.text &&
|
|
169
178
|
type == o.type
|
|
170
179
|
end
|
|
@@ -178,7 +187,7 @@ module VeniceClient
|
|
|
178
187
|
# Calculates hash code according to all attributes.
|
|
179
188
|
# @return [Integer] Hash code
|
|
180
189
|
def hash
|
|
181
|
-
[text, type].hash
|
|
190
|
+
[cache_control, text, type].hash
|
|
182
191
|
end
|
|
183
192
|
|
|
184
193
|
# Builds the object from hash
|
|
@@ -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: 20251209.153516
|
|
7
7
|
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.14.0
|
|
@@ -102,9 +102,9 @@ module VeniceClient
|
|
|
102
102
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
103
103
|
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
104
104
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
105
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
106
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `VeniceClient::ToolMessage`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
107
|
+
end
|
|
108
108
|
h[k.to_sym] = v
|
|
109
109
|
}
|
|
110
110
|
|
|
@@ -186,10 +186,10 @@ module VeniceClient
|
|
|
186
186
|
# Custom attribute writer method checking allowed values (enum).
|
|
187
187
|
# @param [Object] role Object to be assigned
|
|
188
188
|
def role=(role)
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
189
|
+
validator = EnumAttributeValidator.new('String', ["tool"])
|
|
190
|
+
unless validator.valid?(role)
|
|
191
|
+
fail ArgumentError, "invalid value for \"role\", must be one of #{validator.allowable_values}."
|
|
192
|
+
end
|
|
193
193
|
@role = role
|
|
194
194
|
end
|
|
195
195
|
|
|
@@ -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: 20251209.153516
|
|
7
7
|
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.14.0
|
|
@@ -84,9 +84,9 @@ module VeniceClient
|
|
|
84
84
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
85
85
|
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
86
86
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
87
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
88
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `VeniceClient::UserMessage`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
89
|
+
end
|
|
90
90
|
h[k.to_sym] = v
|
|
91
91
|
}
|
|
92
92
|
|
|
@@ -143,10 +143,10 @@ module VeniceClient
|
|
|
143
143
|
# Custom attribute writer method checking allowed values (enum).
|
|
144
144
|
# @param [Object] role Object to be assigned
|
|
145
145
|
def role=(role)
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
146
|
+
validator = EnumAttributeValidator.new('String', ["user"])
|
|
147
|
+
unless validator.valid?(role)
|
|
148
|
+
fail ArgumentError, "invalid value for \"role\", must be one of #{validator.allowable_values}."
|
|
149
|
+
end
|
|
150
150
|
@role = role
|
|
151
151
|
end
|
|
152
152
|
|