venice_client 1.0.0 → 1.0.2
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 +39 -0
- data/.gitlab-ci.yml +26 -0
- data/.openapi-generator/FILES +395 -0
- data/.openapi-generator/VERSION +1 -0
- data/.openapi-generator-ignore +23 -0
- data/.rspec +2 -0
- data/.rubocop.yml +148 -0
- data/.travis.yml +11 -0
- data/README.md +120 -390
- data/Rakefile +2 -0
- data/docs/APIKeysApi.md +236 -89
- data/docs/AssistantMessage.md +26 -0
- data/docs/AssistantMessageContent.md +15 -0
- data/docs/AudioApi.md +40 -19
- data/docs/AudioModelPricing.md +18 -0
- data/docs/AudioModelPricingInput.md +22 -0
- data/docs/BillingApi.md +50 -29
- data/docs/BillingUsageRequest.md +24 -8
- data/docs/BillingUsageResponse.md +16 -4
- data/docs/CharactersApi.md +36 -14
- data/docs/ChatApi.md +43 -22
- data/docs/ChatCompletionRequest.md +66 -28
- data/docs/ChatCompletionRequestMessagesInner.md +28 -0
- data/docs/ChatCompletionRequestResponseFormat.md +49 -0
- data/docs/ChatCompletionRequestStop.md +15 -0
- data/docs/ChatCompletionRequestStreamOptions.md +14 -3
- data/docs/ChatCompletionRequestToolChoice.md +20 -0
- data/docs/ChatCompletionRequestToolChoiceAnyOf.md +20 -0
- data/docs/ChatCompletionRequestToolChoiceAnyOfFunction.md +18 -0
- data/docs/ChatCompletionRequestVeniceParameters.md +26 -8
- data/docs/CreateApiKey200Response.md +20 -0
- data/docs/CreateApiKey200ResponseData.md +28 -0
- data/docs/CreateApiKeyRequest.md +24 -0
- data/docs/CreateApiKeyRequestExpiresAt.md +15 -0
- data/docs/CreateChatCompletion200Response.md +32 -0
- data/docs/CreateChatCompletion200ResponseChoicesInner.md +26 -0
- data/docs/CreateChatCompletion200ResponseChoicesInnerLogprobs.md +24 -0
- data/docs/CreateChatCompletion200ResponseChoicesInnerLogprobsTopLogprobsInner.md +22 -0
- data/docs/CreateChatCompletion200ResponseChoicesInnerMessage.md +28 -0
- data/docs/CreateChatCompletion200ResponseUsage.md +24 -0
- data/docs/CreateChatCompletion200ResponseVeniceParameters.md +32 -0
- data/docs/CreateChatCompletion200ResponseVeniceParametersWebSearchCitationsInner.md +24 -0
- data/docs/CreateChatCompletion400Response.md +20 -0
- data/docs/CreateChatCompletion401Response.md +18 -0
- data/docs/CreateChatCompletion402Response.md +18 -0
- data/docs/CreateChatCompletion415Response.md +18 -0
- data/docs/CreateChatCompletion429Response.md +18 -0
- data/docs/CreateChatCompletion500Response.md +18 -0
- data/docs/CreateChatCompletion503Response.md +18 -0
- data/docs/CreateChatCompletion504Response.md +18 -0
- data/docs/CreateEmbedding200Response.md +24 -0
- data/docs/CreateEmbedding200ResponseDataInner.md +22 -0
- data/docs/CreateEmbedding200ResponseUsage.md +20 -0
- data/docs/CreateEmbeddingRequestSchema.md +22 -7
- data/docs/CreateEmbeddingRequestSchemaInput.md +15 -0
- data/docs/CreateEmbeddingRequestSchemaModel.md +15 -0
- data/docs/CreateSpeech403Response.md +18 -0
- data/docs/CreateSpeechRequestSchema.md +24 -8
- data/docs/DeleteApiKey200Response.md +18 -0
- data/docs/EditImageRequest.md +20 -0
- data/docs/EmbeddingsApi.md +44 -23
- data/docs/GenerateImage200Response.md +24 -0
- data/docs/GenerateImage200ResponseTiming.md +24 -0
- data/docs/GenerateImageRequest.md +44 -18
- data/docs/GetApiKeyGenerateWeb3Key200Response.md +20 -0
- data/docs/GetApiKeyGenerateWeb3Key200ResponseData.md +18 -0
- data/docs/GetApiKeyRateLimitLogs200Response.md +20 -0
- data/docs/GetApiKeyRateLimitLogs200ResponseDataInner.md +26 -0
- data/docs/GetApiKeyRateLimits200Response.md +18 -0
- data/docs/GetApiKeyRateLimits200ResponseData.md +28 -0
- data/docs/GetApiKeyRateLimits200ResponseDataApiTier.md +20 -0
- data/docs/GetApiKeyRateLimits200ResponseDataBalances.md +22 -0
- data/docs/GetApiKeyRateLimits200ResponseDataRateLimitsInner.md +20 -0
- data/docs/GetApiKeyRateLimits200ResponseDataRateLimitsInnerRateLimitsInner.md +20 -0
- data/docs/GetApiKeys200Response.md +20 -0
- data/docs/GetApiKeys200ResponseDataInner.md +34 -0
- data/docs/GetApiKeys200ResponseDataInnerConsumptionLimits.md +22 -0
- data/docs/GetApiKeys200ResponseDataInnerUsage.md +18 -0
- data/docs/GetApiKeys200ResponseDataInnerUsageTrailingSevenDays.md +22 -0
- data/docs/GetBillingUsage200Response.md +20 -0
- data/docs/GetBillingUsage200ResponseDataInner.md +32 -0
- data/docs/GetBillingUsage200ResponseDataInnerInferenceDetails.md +24 -0
- data/docs/GetBillingUsage200ResponsePagination.md +24 -0
- data/docs/ImageApi.md +198 -102
- data/docs/ImageModelConstraints.md +22 -0
- data/docs/ImageModelConstraintsSteps.md +20 -0
- data/docs/ImageModelPricing.md +20 -0
- data/docs/ImageModelPricingGeneration.md +22 -0
- data/docs/ImageModelPricingUpscale.md +20 -0
- data/docs/ImageModelPricingUpscale2x.md +22 -0
- data/docs/ImageModelPricingUpscale4x.md +22 -0
- data/docs/ImageStylesGet200Response.md +20 -0
- data/docs/ImageStylesGet500Response.md +18 -0
- data/docs/ImageURLObject.md +18 -0
- data/docs/ImageUrl.md +20 -0
- data/docs/JsonObject.md +18 -0
- data/docs/JsonSchema.md +20 -0
- data/docs/LLMModelPricing.md +20 -0
- data/docs/LLMModelPricingInput.md +22 -0
- data/docs/LLMModelPricingOutput.md +22 -0
- data/docs/ListCharacters200Response.md +20 -0
- data/docs/ListCharacters200ResponseDataInner.md +36 -0
- data/docs/ListCharacters200ResponseDataInnerStats.md +18 -0
- data/docs/ListModelCompatibilityMapping200Response.md +22 -0
- data/docs/ListModelTraits200Response.md +22 -0
- data/docs/ListModels200Response.md +22 -0
- data/docs/ListModels200ResponseType.md +15 -0
- data/docs/ListModelsTypeParameter.md +15 -0
- data/docs/ModelResponse.md +24 -8
- data/docs/ModelResponseModelSpec.md +32 -11
- data/docs/ModelResponseModelSpecCapabilities.md +28 -10
- data/docs/ModelResponseModelSpecConstraints.md +26 -0
- data/docs/ModelResponseModelSpecPricing.md +24 -0
- data/docs/ModelsApi.md +112 -49
- data/docs/ObjectsInner.md +49 -0
- data/docs/PostApiKeyGenerateWeb3KeyRequest.md +30 -0
- data/docs/PreviewApi.md +36 -14
- data/docs/SimpleGenerateImage200Response.md +20 -0
- data/docs/SimpleGenerateImage200ResponseDataInner.md +20 -0
- data/docs/SimpleGenerateImage200ResponseDataInnerAnyOf.md +18 -0
- data/docs/SimpleGenerateImage200ResponseDataInnerAnyOf1.md +18 -0
- data/docs/SimpleGenerateImageRequest.md +36 -14
- data/docs/SpeechApi.md +40 -19
- data/docs/SystemMessage.md +22 -0
- data/docs/SystemMessageContent.md +15 -0
- data/docs/Text.md +20 -0
- data/docs/TextModelConstraints.md +20 -0
- data/docs/TextModelConstraintsTemperature.md +18 -0
- data/docs/TextModelConstraintsTopP.md +18 -0
- data/docs/ToolCall.md +18 -5
- data/docs/ToolCallFunction.md +22 -0
- data/docs/ToolMessage.md +28 -0
- data/docs/UpscaleImageRequest.md +24 -8
- data/docs/UpscaleImageRequestEnhance.md +15 -0
- data/docs/UserMessage.md +20 -0
- data/docs/UserMessageContent.md +15 -0
- data/git_push.sh +11 -9
- data/lib/venice_client/api/api_keys_api.rb +122 -65
- data/lib/venice_client/api/audio_api.rb +26 -14
- data/lib/venice_client/api/billing_api.rb +46 -23
- data/lib/venice_client/api/characters_api.rb +20 -11
- data/lib/venice_client/api/chat_api.rb +28 -16
- data/lib/venice_client/api/embeddings_api.rb +34 -22
- data/lib/venice_client/api/image_api.rb +146 -119
- data/lib/venice_client/api/models_api.rb +62 -37
- data/lib/venice_client/api/preview_api.rb +20 -11
- data/lib/venice_client/api/speech_api.rb +26 -14
- data/lib/venice_client/api_client.rb +99 -94
- data/lib/venice_client/api_error.rb +7 -5
- data/lib/venice_client/configuration.rb +129 -24
- data/lib/venice_client/models/assistant_message.rb +304 -0
- data/lib/venice_client/models/assistant_message_content.rb +104 -0
- data/lib/venice_client/models/audio_model_pricing.rb +238 -0
- data/lib/venice_client/models/audio_model_pricing_input.rb +292 -0
- data/lib/venice_client/models/billing_usage_request.rb +99 -38
- data/lib/venice_client/models/billing_usage_response.rb +68 -30
- data/lib/venice_client/models/chat_completion_request.rb +389 -61
- data/lib/venice_client/models/chat_completion_request_messages_inner.rb +106 -0
- data/lib/venice_client/models/chat_completion_request_response_format.rb +106 -0
- data/lib/venice_client/models/chat_completion_request_stop.rb +105 -0
- data/lib/venice_client/models/chat_completion_request_stream_options.rb +43 -29
- data/lib/venice_client/models/chat_completion_request_tool_choice.rb +104 -0
- data/lib/venice_client/models/chat_completion_request_tool_choice_any_of.rb +263 -0
- data/lib/venice_client/models/chat_completion_request_tool_choice_any_of_function.rb +237 -0
- data/lib/venice_client/models/chat_completion_request_venice_parameters.rb +63 -37
- data/lib/venice_client/models/{inline_response_200_8.rb → create_api_key200_response.rb} +70 -32
- data/lib/venice_client/models/{inline_response_200_8_data.rb → create_api_key200_response_data.rb} +92 -43
- data/lib/venice_client/models/{api_keys_body.rb → create_api_key_request.rb} +65 -38
- data/lib/venice_client/models/create_api_key_request_expires_at.rb +104 -0
- data/lib/venice_client/models/{inline_response_200.rb → create_chat_completion200_response.rb} +120 -42
- data/lib/venice_client/models/{inline_response_200_choices.rb → create_chat_completion200_response_choices_inner.rb} +82 -44
- data/lib/venice_client/models/{inline_response_200_logprobs.rb → create_chat_completion200_response_choices_inner_logprobs.rb} +72 -34
- data/lib/venice_client/models/{inline_response_200_logprobs_top_logprobs.rb → create_chat_completion200_response_choices_inner_logprobs_top_logprobs_inner.rb} +71 -33
- data/lib/venice_client/models/create_chat_completion200_response_choices_inner_message.rb +104 -0
- data/lib/venice_client/models/{inline_response_200_usage.rb → create_chat_completion200_response_usage.rb} +83 -33
- data/lib/venice_client/models/{inline_response_200_venice_parameters.rb → create_chat_completion200_response_venice_parameters.rb} +131 -40
- data/lib/venice_client/models/{inline_response_200_venice_parameters_web_search_citations.rb → create_chat_completion200_response_venice_parameters_web_search_citations_inner.rb} +72 -34
- data/lib/venice_client/models/{inline_response_400.rb → create_chat_completion400_response.rb} +57 -31
- data/lib/venice_client/models/{inline_response_401.rb → create_chat_completion401_response.rb} +57 -31
- data/lib/venice_client/models/{inline_response_402.rb → create_chat_completion402_response.rb} +57 -31
- data/lib/venice_client/models/create_chat_completion415_response.rb +238 -0
- data/lib/venice_client/models/create_chat_completion429_response.rb +238 -0
- data/lib/venice_client/models/create_chat_completion500_response.rb +238 -0
- data/lib/venice_client/models/create_chat_completion503_response.rb +238 -0
- data/lib/venice_client/models/create_chat_completion504_response.rb +238 -0
- data/lib/venice_client/models/{inline_response_200_14.rb → create_embedding200_response.rb} +88 -36
- data/lib/venice_client/models/{inline_response_200_14_data.rb → create_embedding200_response_data_inner.rb} +75 -35
- data/lib/venice_client/models/{inline_response_200_14_usage.rb → create_embedding200_response_usage.rb} +70 -32
- data/lib/venice_client/models/create_embedding_request_schema.rb +92 -37
- data/lib/venice_client/models/create_embedding_request_schema_input.rb +107 -0
- data/lib/venice_client/models/create_embedding_request_schema_model.rb +104 -0
- data/lib/venice_client/models/{inline_response_403.rb → create_speech403_response.rb} +57 -31
- data/lib/venice_client/models/create_speech_request_schema.rb +112 -40
- data/lib/venice_client/models/{inline_response_200_12.rb → delete_api_key200_response.rb} +58 -46
- data/lib/venice_client/models/edit_image_request.rb +260 -0
- data/lib/venice_client/models/{inline_response_200_1.rb → generate_image200_response.rb} +83 -33
- data/lib/venice_client/models/{inline_response_200_1_timing.rb → generate_image200_response_timing.rb} +96 -34
- data/lib/venice_client/models/generate_image_request.rb +289 -46
- data/lib/venice_client/models/get_api_key_generate_web3_key200_response.rb +263 -0
- data/lib/venice_client/models/{inline_response_200_12_data.rb → get_api_key_generate_web3_key200_response_data.rb} +57 -31
- data/lib/venice_client/models/{inline_response_200_13.rb → get_api_key_rate_limit_logs200_response.rb} +63 -34
- data/lib/venice_client/models/{inline_response_200_11_data.rb → get_api_key_rate_limit_logs200_response_data_inner.rb} +107 -35
- data/lib/venice_client/models/{inline_response_200_10.rb → get_api_key_rate_limits200_response.rb} +57 -31
- data/lib/venice_client/models/{inline_response_200_10_data.rb → get_api_key_rate_limits200_response_data.rb} +112 -41
- data/lib/venice_client/models/{inline_response_200_10_data_api_tier.rb → get_api_key_rate_limits200_response_data_api_tier.rb} +71 -33
- data/lib/venice_client/models/{inline_response_200_10_data_balances.rb → get_api_key_rate_limits200_response_data_balances.rb} +60 -36
- data/lib/venice_client/models/{inline_response_200_10_data_rate_limits_1.rb → get_api_key_rate_limits200_response_data_rate_limits_inner.rb} +58 -32
- data/lib/venice_client/models/{inline_response_200_10_data_rate_limits.rb → get_api_key_rate_limits200_response_data_rate_limits_inner_rate_limits_inner.rb} +70 -32
- data/lib/venice_client/models/{inline_response_200_7.rb → get_api_keys200_response.rb} +62 -34
- data/lib/venice_client/models/{inline_response_200_7_data.rb → get_api_keys200_response_data_inner.rb} +99 -56
- data/lib/venice_client/models/get_api_keys200_response_data_inner_consumption_limits.rb +287 -0
- data/lib/venice_client/models/{inline_response_200_7_usage.rb → get_api_keys200_response_data_inner_usage.rb} +57 -31
- data/lib/venice_client/models/get_api_keys200_response_data_inner_usage_trailing_seven_days.rb +292 -0
- data/lib/venice_client/models/{inline_response_200_15.rb → get_billing_usage200_response.rb} +70 -32
- data/lib/venice_client/models/{billing_usage_response_data.rb → get_billing_usage200_response_data_inner.rb} +131 -45
- data/lib/venice_client/models/{billing_usage_response_inference_details.rb → get_billing_usage200_response_data_inner_inference_details.rb} +56 -54
- data/lib/venice_client/models/{billing_usage_response_pagination.rb → get_billing_usage200_response_pagination.rb} +96 -34
- data/lib/venice_client/models/image_model_constraints.rb +292 -0
- data/lib/venice_client/models/image_model_constraints_steps.rb +265 -0
- data/lib/venice_client/models/image_model_pricing.rb +264 -0
- data/lib/venice_client/models/image_model_pricing_generation.rb +292 -0
- data/lib/venice_client/models/image_model_pricing_upscale.rb +263 -0
- data/lib/venice_client/models/image_model_pricing_upscale2x.rb +292 -0
- data/lib/venice_client/models/image_model_pricing_upscale4x.rb +292 -0
- data/lib/venice_client/models/{inline_response_200_3.rb → image_styles_get200_response.rb} +62 -34
- data/lib/venice_client/models/{inline_response_415.rb → image_styles_get500_response.rb} +57 -31
- data/lib/venice_client/models/image_url.rb +288 -0
- data/lib/venice_client/models/{inline_response_200_7_usage_trailing_seven_days.rb → image_url_object.rb} +68 -56
- data/lib/venice_client/models/json_object.rb +262 -0
- data/lib/venice_client/models/json_schema.rb +290 -0
- data/lib/venice_client/models/{inline_response_200_11.rb → list_characters200_response.rb} +62 -35
- data/lib/venice_client/models/{inline_response_200_13_data.rb → list_characters200_response_data_inner.rb} +154 -50
- data/lib/venice_client/models/{inline_response_200_13_stats.rb → list_characters200_response_data_inner_stats.rb} +57 -31
- data/lib/venice_client/models/{inline_response_200_6.rb → list_model_compatibility_mapping200_response.rb} +79 -37
- data/lib/venice_client/models/{inline_response_200_5.rb → list_model_traits200_response.rb} +79 -37
- data/lib/venice_client/models/{inline_response_200_4.rb → list_models200_response.rb} +75 -36
- data/lib/venice_client/models/list_models200_response_type.rb +104 -0
- data/lib/venice_client/models/list_models_type_parameter.rb +104 -0
- data/lib/venice_client/models/llm_model_pricing.rb +264 -0
- data/lib/venice_client/models/llm_model_pricing_input.rb +292 -0
- data/lib/venice_client/models/llm_model_pricing_output.rb +292 -0
- data/lib/venice_client/models/model_response.rb +84 -40
- data/lib/venice_client/models/model_response_model_spec.rb +62 -40
- data/lib/venice_client/models/model_response_model_spec_capabilities.rb +138 -38
- data/lib/venice_client/models/model_response_model_spec_constraints.rb +105 -0
- data/lib/venice_client/models/model_response_model_spec_pricing.rb +106 -0
- data/lib/venice_client/models/objects_inner.rb +105 -0
- data/lib/venice_client/models/{api_keys_generate_web3_key_body.rb → post_api_key_generate_web3_key_request.rb} +91 -40
- data/lib/venice_client/models/{inline_response_200_2.rb → simple_generate_image200_response.rb} +73 -35
- data/lib/venice_client/models/simple_generate_image200_response_data_inner.rb +104 -0
- data/lib/venice_client/models/simple_generate_image200_response_data_inner_any_of.rb +238 -0
- data/lib/venice_client/models/{api_keys_consumption_limit.rb → simple_generate_image200_response_data_inner_any_of1.rb} +67 -57
- data/lib/venice_client/models/simple_generate_image_request.rb +146 -54
- data/lib/venice_client/models/system_message.rb +297 -0
- data/lib/venice_client/models/system_message_content.rb +104 -0
- data/lib/venice_client/models/text.rb +298 -0
- data/lib/venice_client/models/text_model_constraints.rb +264 -0
- data/lib/venice_client/models/text_model_constraints_temperature.rb +238 -0
- data/lib/venice_client/models/text_model_constraints_top_p.rb +238 -0
- data/lib/venice_client/models/tool_call.rb +57 -31
- data/lib/venice_client/models/{chat_completion_request_function.rb → tool_call_function.rb} +59 -33
- data/lib/venice_client/models/tool_message.rb +344 -0
- data/lib/venice_client/models/upscale_image_request.rb +146 -40
- data/lib/venice_client/models/upscale_image_request_enhance.rb +105 -0
- data/lib/venice_client/models/user_message.rb +288 -0
- data/lib/venice_client/models/user_message_content.rb +104 -0
- data/lib/venice_client/version.rb +5 -4
- data/lib/venice_client.rb +134 -108
- data/openapitools.json +7 -0
- data/spec/api/api_keys_api_spec.rb +43 -41
- data/spec/api/audio_api_spec.rb +18 -16
- data/spec/api/billing_api_spec.rb +23 -21
- data/spec/api/characters_api_spec.rb +17 -15
- data/spec/api/chat_api_spec.rb +19 -17
- data/spec/api/embeddings_api_spec.rb +19 -17
- data/spec/api/image_api_spec.rb +43 -46
- data/spec/api/models_api_spec.rb +28 -26
- data/spec/api/preview_api_spec.rb +17 -15
- data/spec/api/speech_api_spec.rb +18 -16
- data/spec/models/assistant_message_content_spec.rb +21 -0
- data/spec/models/assistant_message_spec.rb +64 -0
- data/spec/models/audio_model_pricing_input_spec.rb +48 -0
- data/spec/models/audio_model_pricing_spec.rb +36 -0
- data/spec/models/billing_usage_request_spec.rb +19 -23
- data/spec/models/billing_usage_response_spec.rb +12 -16
- data/spec/models/chat_completion_request_messages_inner_spec.rb +21 -0
- data/spec/models/chat_completion_request_response_format_spec.rb +32 -0
- data/spec/models/chat_completion_request_spec.rb +74 -71
- data/spec/models/chat_completion_request_stop_spec.rb +21 -0
- data/spec/models/chat_completion_request_stream_options_spec.rb +11 -15
- data/spec/models/chat_completion_request_tool_choice_any_of_function_spec.rb +36 -0
- data/spec/models/chat_completion_request_tool_choice_any_of_spec.rb +42 -0
- data/spec/models/chat_completion_request_tool_choice_spec.rb +21 -0
- data/spec/models/chat_completion_request_venice_parameters_spec.rb +35 -32
- data/spec/models/create_api_key200_response_data_spec.rb +70 -0
- data/spec/models/create_api_key200_response_spec.rb +42 -0
- data/spec/models/create_api_key_request_expires_at_spec.rb +21 -0
- data/spec/models/create_api_key_request_spec.rb +58 -0
- data/spec/models/create_chat_completion200_response_choices_inner_logprobs_spec.rb +54 -0
- data/spec/models/create_chat_completion200_response_choices_inner_logprobs_top_logprobs_inner_spec.rb +48 -0
- data/spec/models/create_chat_completion200_response_choices_inner_message_spec.rb +21 -0
- data/spec/models/create_chat_completion200_response_choices_inner_spec.rb +68 -0
- data/spec/models/create_chat_completion200_response_spec.rb +82 -0
- data/spec/models/create_chat_completion200_response_usage_spec.rb +54 -0
- data/spec/models/create_chat_completion200_response_venice_parameters_spec.rb +82 -0
- data/spec/models/create_chat_completion200_response_venice_parameters_web_search_citations_inner_spec.rb +54 -0
- data/spec/models/create_chat_completion400_response_spec.rb +42 -0
- data/spec/models/create_chat_completion401_response_spec.rb +36 -0
- data/spec/models/create_chat_completion402_response_spec.rb +36 -0
- data/spec/models/create_chat_completion415_response_spec.rb +36 -0
- data/spec/models/create_chat_completion429_response_spec.rb +36 -0
- data/spec/models/create_chat_completion500_response_spec.rb +36 -0
- data/spec/models/create_chat_completion503_response_spec.rb +36 -0
- data/spec/models/create_chat_completion504_response_spec.rb +36 -0
- data/spec/models/create_embedding200_response_data_inner_spec.rb +52 -0
- data/spec/models/create_embedding200_response_spec.rb +58 -0
- data/spec/models/create_embedding200_response_usage_spec.rb +42 -0
- data/spec/models/create_embedding_request_schema_input_spec.rb +21 -0
- data/spec/models/create_embedding_request_schema_model_spec.rb +21 -0
- data/spec/models/create_embedding_request_schema_spec.rb +16 -20
- data/spec/models/create_speech403_response_spec.rb +36 -0
- data/spec/models/create_speech_request_schema_spec.rb +31 -34
- data/spec/models/delete_api_key200_response_spec.rb +36 -0
- data/spec/models/edit_image_request_spec.rb +42 -0
- data/spec/models/generate_image200_response_spec.rb +54 -0
- data/spec/models/generate_image200_response_timing_spec.rb +54 -0
- data/spec/models/generate_image_request_spec.rb +27 -31
- data/spec/models/get_api_key_generate_web3_key200_response_data_spec.rb +36 -0
- data/spec/models/get_api_key_generate_web3_key200_response_spec.rb +42 -0
- data/spec/models/get_api_key_rate_limit_logs200_response_data_inner_spec.rb +60 -0
- data/spec/models/get_api_key_rate_limit_logs200_response_spec.rb +46 -0
- data/spec/models/get_api_key_rate_limits200_response_data_api_tier_spec.rb +42 -0
- data/spec/models/get_api_key_rate_limits200_response_data_balances_spec.rb +48 -0
- data/spec/models/get_api_key_rate_limits200_response_data_rate_limits_inner_rate_limits_inner_spec.rb +42 -0
- data/spec/models/get_api_key_rate_limits200_response_data_rate_limits_inner_spec.rb +42 -0
- data/spec/models/get_api_key_rate_limits200_response_data_spec.rb +66 -0
- data/spec/models/get_api_key_rate_limits200_response_spec.rb +36 -0
- data/spec/models/get_api_keys200_response_data_inner_consumption_limits_spec.rb +48 -0
- data/spec/models/get_api_keys200_response_data_inner_spec.rb +88 -0
- data/spec/models/get_api_keys200_response_data_inner_usage_spec.rb +36 -0
- data/spec/models/get_api_keys200_response_data_inner_usage_trailing_seven_days_spec.rb +48 -0
- data/spec/models/get_api_keys200_response_spec.rb +46 -0
- data/spec/models/get_billing_usage200_response_data_inner_inference_details_spec.rb +54 -0
- data/spec/models/get_billing_usage200_response_data_inner_spec.rb +82 -0
- data/spec/models/get_billing_usage200_response_pagination_spec.rb +54 -0
- data/spec/models/get_billing_usage200_response_spec.rb +42 -0
- data/spec/models/image_model_constraints_spec.rb +48 -0
- data/spec/models/image_model_constraints_steps_spec.rb +42 -0
- data/spec/models/image_model_pricing_generation_spec.rb +48 -0
- data/spec/models/image_model_pricing_spec.rb +42 -0
- data/spec/models/image_model_pricing_upscale2x_spec.rb +48 -0
- data/spec/models/image_model_pricing_upscale4x_spec.rb +48 -0
- data/spec/models/image_model_pricing_upscale_spec.rb +42 -0
- data/spec/models/image_styles_get200_response_spec.rb +46 -0
- data/spec/models/image_styles_get500_response_spec.rb +36 -0
- data/spec/models/image_url_object_spec.rb +36 -0
- data/spec/models/image_url_spec.rb +46 -0
- data/spec/models/json_object_spec.rb +40 -0
- data/spec/models/json_schema_spec.rb +46 -0
- data/spec/models/list_characters200_response_data_inner_spec.rb +90 -0
- data/spec/models/list_characters200_response_data_inner_stats_spec.rb +36 -0
- data/spec/models/list_characters200_response_spec.rb +46 -0
- data/spec/models/list_model_compatibility_mapping200_response_spec.rb +52 -0
- data/spec/models/list_model_traits200_response_spec.rb +52 -0
- data/spec/models/list_models200_response_spec.rb +52 -0
- data/spec/models/list_models200_response_type_spec.rb +21 -0
- data/spec/models/list_models_type_parameter_spec.rb +21 -0
- data/spec/models/llm_model_pricing_input_spec.rb +48 -0
- data/spec/models/llm_model_pricing_output_spec.rb +48 -0
- data/spec/models/llm_model_pricing_spec.rb +42 -0
- data/spec/models/model_response_model_spec_capabilities_spec.rb +33 -36
- data/spec/models/model_response_model_spec_constraints_spec.rb +21 -0
- data/spec/models/model_response_model_spec_pricing_spec.rb +21 -0
- data/spec/models/model_response_model_spec_spec.rb +40 -37
- data/spec/models/model_response_spec.rb +32 -35
- data/spec/models/objects_inner_spec.rb +32 -0
- data/spec/models/post_api_key_generate_web3_key_request_spec.rb +76 -0
- data/spec/models/simple_generate_image200_response_data_inner_any_of1_spec.rb +36 -0
- data/spec/models/simple_generate_image200_response_data_inner_any_of_spec.rb +36 -0
- data/spec/models/simple_generate_image200_response_data_inner_spec.rb +21 -0
- data/spec/models/simple_generate_image200_response_spec.rb +42 -0
- data/spec/models/simple_generate_image_request_spec.rb +29 -33
- data/spec/models/system_message_content_spec.rb +21 -0
- data/spec/models/system_message_spec.rb +52 -0
- data/spec/models/text_model_constraints_spec.rb +42 -0
- data/spec/models/text_model_constraints_temperature_spec.rb +36 -0
- data/spec/models/text_model_constraints_top_p_spec.rb +36 -0
- data/spec/models/text_spec.rb +46 -0
- data/spec/models/tool_call_function_spec.rb +48 -0
- data/spec/models/tool_call_spec.rb +22 -25
- data/spec/models/tool_message_spec.rb +70 -0
- data/spec/models/upscale_image_request_enhance_spec.rb +21 -0
- data/spec/models/upscale_image_request_spec.rb +28 -31
- data/spec/models/user_message_content_spec.rb +21 -0
- data/spec/models/user_message_spec.rb +46 -0
- data/spec/spec_helper.rb +7 -6
- data/swagger.yaml +4791 -0
- data/update.sh +9 -0
- metadata +440 -356
- data/docs/AnyOfChatCompletionRequestMessagesItems.md +0 -6
- data/docs/AnyOfChatCompletionRequestStop.md +0 -6
- data/docs/AnyOfChatCompletionRequestToolChoice.md +0 -6
- data/docs/AnyOfCreateEmbeddingRequestSchemaInput.md +0 -6
- data/docs/AnyOfCreateEmbeddingRequestSchemaModel.md +0 -6
- data/docs/AnyOfModelResponseModelSpecConstraints.md +0 -6
- data/docs/AnyOfModelResponseModelSpecPricing.md +0 -6
- data/docs/AnyOfUpscaleImageRequestEnhance.md +0 -6
- data/docs/AnyOfUpscaleImageRequestImage.md +0 -6
- data/docs/AnyOfapiKeysBodyExpiresAt.md +0 -6
- data/docs/AnyOfapiKeysConsumptionLimitUsd.md +0 -6
- data/docs/AnyOfapiKeysConsumptionLimitVcu.md +0 -6
- data/docs/AnyOfapiKeysGenerateWeb3KeyBodyExpiresAt.md +0 -6
- data/docs/AnyOfinlineResponse2002DataItems.md +0 -6
- data/docs/AnyOfinlineResponse2004Type.md +0 -6
- data/docs/AnyOfinlineResponse2005Type.md +0 -6
- data/docs/AnyOfinlineResponse2006Type.md +0 -6
- data/docs/AnyOfinlineResponse200ChoicesMessage.md +0 -6
- data/docs/AnyOfinlineResponse200PromptLogprobs.md +0 -6
- data/docs/ApiKeysBody.md +0 -10
- data/docs/ApiKeysConsumptionLimit.md +0 -8
- data/docs/ApiKeysGenerateWeb3KeyBody.md +0 -13
- data/docs/BillingUsageResponseData.md +0 -14
- data/docs/BillingUsageResponseInferenceDetails.md +0 -10
- data/docs/BillingUsageResponsePagination.md +0 -10
- data/docs/ChatCompletionRequestFunction.md +0 -9
- data/docs/InlineResponse200.md +0 -14
- data/docs/InlineResponse2001.md +0 -10
- data/docs/InlineResponse20010.md +0 -7
- data/docs/InlineResponse20010Data.md +0 -12
- data/docs/InlineResponse20010DataApiTier.md +0 -8
- data/docs/InlineResponse20010DataBalances.md +0 -8
- data/docs/InlineResponse20010DataRateLimits.md +0 -8
- data/docs/InlineResponse20010DataRateLimits1.md +0 -8
- data/docs/InlineResponse20011.md +0 -8
- data/docs/InlineResponse20011Data.md +0 -11
- data/docs/InlineResponse20012.md +0 -8
- data/docs/InlineResponse20012Data.md +0 -7
- data/docs/InlineResponse20013.md +0 -8
- data/docs/InlineResponse20013Data.md +0 -16
- data/docs/InlineResponse20013Stats.md +0 -7
- data/docs/InlineResponse20014.md +0 -10
- data/docs/InlineResponse20014Data.md +0 -9
- data/docs/InlineResponse20014Usage.md +0 -8
- data/docs/InlineResponse20015.md +0 -8
- data/docs/InlineResponse2001Timing.md +0 -10
- data/docs/InlineResponse2002.md +0 -8
- data/docs/InlineResponse2003.md +0 -8
- data/docs/InlineResponse2004.md +0 -9
- data/docs/InlineResponse2005.md +0 -9
- data/docs/InlineResponse2006.md +0 -9
- data/docs/InlineResponse2007.md +0 -8
- data/docs/InlineResponse2007Data.md +0 -15
- data/docs/InlineResponse2007Usage.md +0 -7
- data/docs/InlineResponse2007UsageTrailingSevenDays.md +0 -8
- data/docs/InlineResponse2008.md +0 -8
- data/docs/InlineResponse2008Data.md +0 -12
- data/docs/InlineResponse2009.md +0 -7
- data/docs/InlineResponse200Choices.md +0 -11
- data/docs/InlineResponse200Logprobs.md +0 -10
- data/docs/InlineResponse200LogprobsTopLogprobs.md +0 -9
- data/docs/InlineResponse200Usage.md +0 -10
- data/docs/InlineResponse200VeniceParameters.md +0 -13
- data/docs/InlineResponse200VeniceParametersWebSearchCitations.md +0 -10
- data/docs/InlineResponse400.md +0 -8
- data/docs/InlineResponse401.md +0 -7
- data/docs/InlineResponse402.md +0 -7
- data/docs/InlineResponse403.md +0 -7
- data/docs/InlineResponse415.md +0 -7
- data/docs/InlineResponse429.md +0 -7
- data/docs/InlineResponse500.md +0 -7
- data/docs/InlineResponse5001.md +0 -7
- data/docs/InlineResponse503.md +0 -7
- data/docs/ModelCompatibilitySchema.md +0 -6
- data/docs/ModelTraitSchema.md +0 -6
- data/docs/OneOfChatCompletionRequestResponseFormat.md +0 -6
- data/docs/Type.md +0 -6
- data/lib/venice_client/models/any_of_chat_completion_request_messages_items.rb +0 -197
- data/lib/venice_client/models/any_of_chat_completion_request_stop.rb +0 -197
- data/lib/venice_client/models/any_of_chat_completion_request_tool_choice.rb +0 -197
- data/lib/venice_client/models/any_of_create_embedding_request_schema_input.rb +0 -197
- data/lib/venice_client/models/any_of_create_embedding_request_schema_model.rb +0 -197
- data/lib/venice_client/models/any_of_model_response_model_spec_constraints.rb +0 -197
- data/lib/venice_client/models/any_of_model_response_model_spec_pricing.rb +0 -197
- data/lib/venice_client/models/any_of_upscale_image_request_enhance.rb +0 -197
- data/lib/venice_client/models/any_of_upscale_image_request_image.rb +0 -197
- data/lib/venice_client/models/any_ofapi_keys_body_expires_at.rb +0 -197
- data/lib/venice_client/models/any_ofapi_keys_consumption_limit_usd.rb +0 -197
- data/lib/venice_client/models/any_ofapi_keys_consumption_limit_vcu.rb +0 -195
- data/lib/venice_client/models/any_ofapi_keys_generate_web3_key_body_expires_at.rb +0 -197
- data/lib/venice_client/models/any_ofinline_response_200_2_data_items.rb +0 -197
- data/lib/venice_client/models/any_ofinline_response_200_4_type.rb +0 -197
- data/lib/venice_client/models/any_ofinline_response_200_5_type.rb +0 -197
- data/lib/venice_client/models/any_ofinline_response_200_6_type.rb +0 -197
- data/lib/venice_client/models/any_ofinline_response_200_choices_message.rb +0 -197
- data/lib/venice_client/models/any_ofinline_response_200_prompt_logprobs.rb +0 -197
- data/lib/venice_client/models/inline_response_200_9.rb +0 -211
- data/lib/venice_client/models/inline_response_429.rb +0 -212
- data/lib/venice_client/models/inline_response_500.rb +0 -212
- data/lib/venice_client/models/inline_response_500_1.rb +0 -212
- data/lib/venice_client/models/inline_response_503.rb +0 -212
- data/lib/venice_client/models/model_compatibility_schema.rb +0 -202
- data/lib/venice_client/models/model_trait_schema.rb +0 -200
- data/lib/venice_client/models/one_of_chat_completion_request_response_format.rb +0 -197
- data/lib/venice_client/models/type.rb +0 -198
- data/spec/api_client_spec.rb +0 -225
- data/spec/base_object_spec.rb +0 -109
- data/spec/configuration_spec.rb +0 -41
- data/spec/models/any_of_chat_completion_request_messages_items_spec.rb +0 -34
- data/spec/models/any_of_chat_completion_request_stop_spec.rb +0 -34
- data/spec/models/any_of_chat_completion_request_tool_choice_spec.rb +0 -34
- data/spec/models/any_of_create_embedding_request_schema_input_spec.rb +0 -34
- data/spec/models/any_of_create_embedding_request_schema_model_spec.rb +0 -34
- data/spec/models/any_of_model_response_model_spec_constraints_spec.rb +0 -34
- data/spec/models/any_of_model_response_model_spec_pricing_spec.rb +0 -34
- data/spec/models/any_of_upscale_image_request_enhance_spec.rb +0 -34
- data/spec/models/any_of_upscale_image_request_image_spec.rb +0 -34
- data/spec/models/any_ofapi_keys_body_expires_at_spec.rb +0 -34
- data/spec/models/any_ofapi_keys_consumption_limit_usd_spec.rb +0 -34
- data/spec/models/any_ofapi_keys_consumption_limit_vcu_spec.rb +0 -34
- data/spec/models/any_ofapi_keys_generate_web3_key_body_expires_at_spec.rb +0 -34
- data/spec/models/any_ofinline_response_200_2_data_items_spec.rb +0 -34
- data/spec/models/any_ofinline_response_200_4_type_spec.rb +0 -34
- data/spec/models/any_ofinline_response_200_5_type_spec.rb +0 -34
- data/spec/models/any_ofinline_response_200_6_type_spec.rb +0 -34
- data/spec/models/any_ofinline_response_200_choices_message_spec.rb +0 -34
- data/spec/models/any_ofinline_response_200_prompt_logprobs_spec.rb +0 -34
- data/spec/models/api_keys_body_spec.rb +0 -61
- data/spec/models/api_keys_consumption_limit_spec.rb +0 -46
- data/spec/models/api_keys_generate_web3_key_body_spec.rb +0 -80
- data/spec/models/billing_usage_response_data_spec.rb +0 -86
- data/spec/models/billing_usage_response_inference_details_spec.rb +0 -57
- data/spec/models/billing_usage_response_pagination_spec.rb +0 -58
- data/spec/models/chat_completion_request_function_spec.rb +0 -52
- data/spec/models/inline_response_200_10_data_api_tier_spec.rb +0 -45
- data/spec/models/inline_response_200_10_data_balances_spec.rb +0 -45
- data/spec/models/inline_response_200_10_data_rate_limits_1_spec.rb +0 -45
- data/spec/models/inline_response_200_10_data_rate_limits_spec.rb +0 -46
- data/spec/models/inline_response_200_10_data_spec.rb +0 -69
- data/spec/models/inline_response_200_10_spec.rb +0 -40
- data/spec/models/inline_response_200_11_data_spec.rb +0 -64
- data/spec/models/inline_response_200_11_spec.rb +0 -50
- data/spec/models/inline_response_200_12_data_spec.rb +0 -39
- data/spec/models/inline_response_200_12_spec.rb +0 -46
- data/spec/models/inline_response_200_13_data_spec.rb +0 -93
- data/spec/models/inline_response_200_13_spec.rb +0 -49
- data/spec/models/inline_response_200_13_stats_spec.rb +0 -40
- data/spec/models/inline_response_200_14_data_spec.rb +0 -55
- data/spec/models/inline_response_200_14_spec.rb +0 -61
- data/spec/models/inline_response_200_14_usage_spec.rb +0 -45
- data/spec/models/inline_response_200_15_spec.rb +0 -45
- data/spec/models/inline_response_200_1_spec.rb +0 -57
- data/spec/models/inline_response_200_1_timing_spec.rb +0 -58
- data/spec/models/inline_response_200_2_spec.rb +0 -46
- data/spec/models/inline_response_200_3_spec.rb +0 -50
- data/spec/models/inline_response_200_4_spec.rb +0 -55
- data/spec/models/inline_response_200_5_spec.rb +0 -55
- data/spec/models/inline_response_200_6_spec.rb +0 -55
- data/spec/models/inline_response_200_7_data_spec.rb +0 -91
- data/spec/models/inline_response_200_7_spec.rb +0 -50
- data/spec/models/inline_response_200_7_usage_spec.rb +0 -39
- data/spec/models/inline_response_200_7_usage_trailing_seven_days_spec.rb +0 -45
- data/spec/models/inline_response_200_8_data_spec.rb +0 -73
- data/spec/models/inline_response_200_8_spec.rb +0 -45
- data/spec/models/inline_response_200_9_spec.rb +0 -39
- data/spec/models/inline_response_200_choices_spec.rb +0 -72
- data/spec/models/inline_response_200_logprobs_spec.rb +0 -57
- data/spec/models/inline_response_200_logprobs_top_logprobs_spec.rb +0 -51
- data/spec/models/inline_response_200_spec.rb +0 -85
- data/spec/models/inline_response_200_usage_spec.rb +0 -57
- data/spec/models/inline_response_200_venice_parameters_spec.rb +0 -80
- data/spec/models/inline_response_200_venice_parameters_web_search_citations_spec.rb +0 -57
- data/spec/models/inline_response_400_spec.rb +0 -45
- data/spec/models/inline_response_401_spec.rb +0 -39
- data/spec/models/inline_response_402_spec.rb +0 -39
- data/spec/models/inline_response_403_spec.rb +0 -40
- data/spec/models/inline_response_415_spec.rb +0 -40
- data/spec/models/inline_response_429_spec.rb +0 -39
- data/spec/models/inline_response_500_1_spec.rb +0 -40
- data/spec/models/inline_response_500_spec.rb +0 -39
- data/spec/models/inline_response_503_spec.rb +0 -40
- data/spec/models/model_compatibility_schema_spec.rb +0 -34
- data/spec/models/model_trait_schema_spec.rb +0 -34
- data/spec/models/one_of_chat_completion_request_response_format_spec.rb +0 -34
- data/spec/models/type_spec.rb +0 -34
- data/venice_client.gemspec +0 -38
|
@@ -3,16 +3,18 @@
|
|
|
3
3
|
|
|
4
4
|
#The Venice.ai API.
|
|
5
5
|
|
|
6
|
-
OpenAPI
|
|
6
|
+
The version of the OpenAPI document: 20250709.013306
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.14.0
|
|
7
10
|
|
|
8
|
-
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
|
9
|
-
Swagger Codegen version: 3.0.68
|
|
10
11
|
=end
|
|
11
12
|
|
|
12
13
|
require 'date'
|
|
14
|
+
require 'time'
|
|
13
15
|
|
|
14
16
|
module VeniceClient
|
|
15
|
-
class
|
|
17
|
+
class CreateChatCompletion200ResponseChoicesInner
|
|
16
18
|
# The reason the completion finished.
|
|
17
19
|
attr_accessor :finish_reason
|
|
18
20
|
|
|
@@ -59,53 +61,73 @@ module VeniceClient
|
|
|
59
61
|
}
|
|
60
62
|
end
|
|
61
63
|
|
|
64
|
+
# Returns attribute mapping this model knows about
|
|
65
|
+
def self.acceptable_attribute_map
|
|
66
|
+
attribute_map
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
# Returns all the JSON keys this model knows about
|
|
70
|
+
def self.acceptable_attributes
|
|
71
|
+
acceptable_attribute_map.values
|
|
72
|
+
end
|
|
73
|
+
|
|
62
74
|
# Attribute type mapping.
|
|
63
75
|
def self.openapi_types
|
|
64
76
|
{
|
|
65
|
-
:'finish_reason' => :'
|
|
66
|
-
:'index' => :'
|
|
67
|
-
:'logprobs' => :'
|
|
68
|
-
:'message' => :'
|
|
69
|
-
:'stop_reason' => :'
|
|
77
|
+
:'finish_reason' => :'String',
|
|
78
|
+
:'index' => :'Integer',
|
|
79
|
+
:'logprobs' => :'CreateChatCompletion200ResponseChoicesInnerLogprobs',
|
|
80
|
+
:'message' => :'CreateChatCompletion200ResponseChoicesInnerMessage',
|
|
81
|
+
:'stop_reason' => :'String'
|
|
70
82
|
}
|
|
71
83
|
end
|
|
72
84
|
|
|
73
85
|
# List of attributes with nullable: true
|
|
74
86
|
def self.openapi_nullable
|
|
75
87
|
Set.new([
|
|
88
|
+
:'logprobs',
|
|
76
89
|
:'stop_reason'
|
|
77
90
|
])
|
|
78
91
|
end
|
|
79
|
-
|
|
92
|
+
|
|
80
93
|
# Initializes the object
|
|
81
94
|
# @param [Hash] attributes Model attributes in the form of hash
|
|
82
95
|
def initialize(attributes = {})
|
|
83
96
|
if (!attributes.is_a?(Hash))
|
|
84
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `VeniceClient::
|
|
97
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `VeniceClient::CreateChatCompletion200ResponseChoicesInner` initialize method"
|
|
85
98
|
end
|
|
86
99
|
|
|
87
100
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
101
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
88
102
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
89
|
-
if (!
|
|
90
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `VeniceClient::
|
|
103
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
104
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `VeniceClient::CreateChatCompletion200ResponseChoicesInner`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
91
105
|
end
|
|
92
106
|
h[k.to_sym] = v
|
|
93
107
|
}
|
|
94
108
|
|
|
95
109
|
if attributes.key?(:'finish_reason')
|
|
96
110
|
self.finish_reason = attributes[:'finish_reason']
|
|
111
|
+
else
|
|
112
|
+
self.finish_reason = nil
|
|
97
113
|
end
|
|
98
114
|
|
|
99
115
|
if attributes.key?(:'index')
|
|
100
116
|
self.index = attributes[:'index']
|
|
117
|
+
else
|
|
118
|
+
self.index = nil
|
|
101
119
|
end
|
|
102
120
|
|
|
103
121
|
if attributes.key?(:'logprobs')
|
|
104
122
|
self.logprobs = attributes[:'logprobs']
|
|
123
|
+
else
|
|
124
|
+
self.logprobs = nil
|
|
105
125
|
end
|
|
106
126
|
|
|
107
127
|
if attributes.key?(:'message')
|
|
108
128
|
self.message = attributes[:'message']
|
|
129
|
+
else
|
|
130
|
+
self.message = nil
|
|
109
131
|
end
|
|
110
132
|
|
|
111
133
|
if attributes.key?(:'stop_reason')
|
|
@@ -116,6 +138,7 @@ module VeniceClient
|
|
|
116
138
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
117
139
|
# @return Array for valid properties with the reasons
|
|
118
140
|
def list_invalid_properties
|
|
141
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
119
142
|
invalid_properties = Array.new
|
|
120
143
|
if @finish_reason.nil?
|
|
121
144
|
invalid_properties.push('invalid value for "finish_reason", finish_reason cannot be nil.')
|
|
@@ -125,10 +148,6 @@ module VeniceClient
|
|
|
125
148
|
invalid_properties.push('invalid value for "index", index cannot be nil.')
|
|
126
149
|
end
|
|
127
150
|
|
|
128
|
-
if @logprobs.nil?
|
|
129
|
-
invalid_properties.push('invalid value for "logprobs", logprobs cannot be nil.')
|
|
130
|
-
end
|
|
131
|
-
|
|
132
151
|
if @message.nil?
|
|
133
152
|
invalid_properties.push('invalid value for "message", message cannot be nil.')
|
|
134
153
|
end
|
|
@@ -139,13 +158,13 @@ module VeniceClient
|
|
|
139
158
|
# Check to see if the all the properties in the model are valid
|
|
140
159
|
# @return true if the model is valid
|
|
141
160
|
def valid?
|
|
161
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
142
162
|
return false if @finish_reason.nil?
|
|
143
|
-
finish_reason_validator = EnumAttributeValidator.new('
|
|
163
|
+
finish_reason_validator = EnumAttributeValidator.new('String', ["stop", "length"])
|
|
144
164
|
return false unless finish_reason_validator.valid?(@finish_reason)
|
|
145
165
|
return false if @index.nil?
|
|
146
|
-
return false if @logprobs.nil?
|
|
147
166
|
return false if @message.nil?
|
|
148
|
-
stop_reason_validator = EnumAttributeValidator.new('
|
|
167
|
+
stop_reason_validator = EnumAttributeValidator.new('String', ["stop", "length"])
|
|
149
168
|
return false unless stop_reason_validator.valid?(@stop_reason)
|
|
150
169
|
true
|
|
151
170
|
end
|
|
@@ -153,17 +172,37 @@ module VeniceClient
|
|
|
153
172
|
# Custom attribute writer method checking allowed values (enum).
|
|
154
173
|
# @param [Object] finish_reason Object to be assigned
|
|
155
174
|
def finish_reason=(finish_reason)
|
|
156
|
-
validator = EnumAttributeValidator.new('
|
|
175
|
+
validator = EnumAttributeValidator.new('String', ["stop", "length"])
|
|
157
176
|
unless validator.valid?(finish_reason)
|
|
158
177
|
fail ArgumentError, "invalid value for \"finish_reason\", must be one of #{validator.allowable_values}."
|
|
159
178
|
end
|
|
160
179
|
@finish_reason = finish_reason
|
|
161
180
|
end
|
|
162
181
|
|
|
182
|
+
# Custom attribute writer method with validation
|
|
183
|
+
# @param [Object] index Value to be assigned
|
|
184
|
+
def index=(index)
|
|
185
|
+
if index.nil?
|
|
186
|
+
fail ArgumentError, 'index cannot be nil'
|
|
187
|
+
end
|
|
188
|
+
|
|
189
|
+
@index = index
|
|
190
|
+
end
|
|
191
|
+
|
|
192
|
+
# Custom attribute writer method with validation
|
|
193
|
+
# @param [Object] message Value to be assigned
|
|
194
|
+
def message=(message)
|
|
195
|
+
if message.nil?
|
|
196
|
+
fail ArgumentError, 'message cannot be nil'
|
|
197
|
+
end
|
|
198
|
+
|
|
199
|
+
@message = message
|
|
200
|
+
end
|
|
201
|
+
|
|
163
202
|
# Custom attribute writer method checking allowed values (enum).
|
|
164
203
|
# @param [Object] stop_reason Object to be assigned
|
|
165
204
|
def stop_reason=(stop_reason)
|
|
166
|
-
validator = EnumAttributeValidator.new('
|
|
205
|
+
validator = EnumAttributeValidator.new('String', ["stop", "length"])
|
|
167
206
|
unless validator.valid?(stop_reason)
|
|
168
207
|
fail ArgumentError, "invalid value for \"stop_reason\", must be one of #{validator.allowable_values}."
|
|
169
208
|
end
|
|
@@ -198,39 +237,33 @@ module VeniceClient
|
|
|
198
237
|
# @param [Hash] attributes Model attributes in the form of hash
|
|
199
238
|
# @return [Object] Returns the model itself
|
|
200
239
|
def self.build_from_hash(attributes)
|
|
201
|
-
new.build_from_hash(attributes)
|
|
202
|
-
end
|
|
203
|
-
|
|
204
|
-
# Builds the object from hash
|
|
205
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
|
206
|
-
# @return [Object] Returns the model itself
|
|
207
|
-
def build_from_hash(attributes)
|
|
208
240
|
return nil unless attributes.is_a?(Hash)
|
|
209
|
-
|
|
210
|
-
|
|
241
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
242
|
+
transformed_hash = {}
|
|
243
|
+
openapi_types.each_pair do |key, type|
|
|
244
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
245
|
+
transformed_hash["#{key}"] = nil
|
|
246
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
211
247
|
# check to ensure the input is an array given that the attribute
|
|
212
248
|
# is documented as an array but the input is not
|
|
213
|
-
if attributes[
|
|
214
|
-
|
|
249
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
250
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
215
251
|
end
|
|
216
|
-
elsif !attributes[
|
|
217
|
-
|
|
218
|
-
elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
|
219
|
-
self.send("#{key}=", nil)
|
|
252
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
253
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
220
254
|
end
|
|
221
255
|
end
|
|
222
|
-
|
|
223
|
-
self
|
|
256
|
+
new(transformed_hash)
|
|
224
257
|
end
|
|
225
258
|
|
|
226
259
|
# Deserializes the data based on type
|
|
227
260
|
# @param string type Data type
|
|
228
261
|
# @param string value Value to be deserialized
|
|
229
262
|
# @return [Object] Deserialized data
|
|
230
|
-
def _deserialize(type, value)
|
|
263
|
+
def self._deserialize(type, value)
|
|
231
264
|
case type.to_sym
|
|
232
|
-
when :
|
|
233
|
-
|
|
265
|
+
when :Time
|
|
266
|
+
Time.parse(value)
|
|
234
267
|
when :Date
|
|
235
268
|
Date.parse(value)
|
|
236
269
|
when :String
|
|
@@ -260,7 +293,9 @@ module VeniceClient
|
|
|
260
293
|
end
|
|
261
294
|
end
|
|
262
295
|
else # model
|
|
263
|
-
|
|
296
|
+
# models (e.g. Pet) or oneOf
|
|
297
|
+
klass = VeniceClient.const_get(type)
|
|
298
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
264
299
|
end
|
|
265
300
|
end
|
|
266
301
|
|
|
@@ -308,5 +343,8 @@ module VeniceClient
|
|
|
308
343
|
else
|
|
309
344
|
value
|
|
310
345
|
end
|
|
311
|
-
end
|
|
346
|
+
end
|
|
347
|
+
|
|
348
|
+
end
|
|
349
|
+
|
|
312
350
|
end
|
|
@@ -3,16 +3,18 @@
|
|
|
3
3
|
|
|
4
4
|
#The Venice.ai API.
|
|
5
5
|
|
|
6
|
-
OpenAPI
|
|
6
|
+
The version of the OpenAPI document: 20250709.013306
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.14.0
|
|
7
10
|
|
|
8
|
-
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
|
9
|
-
Swagger Codegen version: 3.0.68
|
|
10
11
|
=end
|
|
11
12
|
|
|
12
13
|
require 'date'
|
|
14
|
+
require 'time'
|
|
13
15
|
|
|
14
16
|
module VeniceClient
|
|
15
|
-
class
|
|
17
|
+
class CreateChatCompletion200ResponseChoicesInnerLogprobs
|
|
16
18
|
# Raw bytes of the token
|
|
17
19
|
attr_accessor :bytes
|
|
18
20
|
|
|
@@ -35,13 +37,23 @@ module VeniceClient
|
|
|
35
37
|
}
|
|
36
38
|
end
|
|
37
39
|
|
|
40
|
+
# Returns attribute mapping this model knows about
|
|
41
|
+
def self.acceptable_attribute_map
|
|
42
|
+
attribute_map
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
# Returns all the JSON keys this model knows about
|
|
46
|
+
def self.acceptable_attributes
|
|
47
|
+
acceptable_attribute_map.values
|
|
48
|
+
end
|
|
49
|
+
|
|
38
50
|
# Attribute type mapping.
|
|
39
51
|
def self.openapi_types
|
|
40
52
|
{
|
|
41
|
-
:'bytes' => :'
|
|
42
|
-
:'logprob' => :'
|
|
43
|
-
:'token' => :'
|
|
44
|
-
:'top_logprobs' => :'
|
|
53
|
+
:'bytes' => :'Array<Float>',
|
|
54
|
+
:'logprob' => :'Float',
|
|
55
|
+
:'token' => :'String',
|
|
56
|
+
:'top_logprobs' => :'Array<CreateChatCompletion200ResponseChoicesInnerLogprobsTopLogprobsInner>'
|
|
45
57
|
}
|
|
46
58
|
end
|
|
47
59
|
|
|
@@ -50,18 +62,19 @@ module VeniceClient
|
|
|
50
62
|
Set.new([
|
|
51
63
|
])
|
|
52
64
|
end
|
|
53
|
-
|
|
65
|
+
|
|
54
66
|
# Initializes the object
|
|
55
67
|
# @param [Hash] attributes Model attributes in the form of hash
|
|
56
68
|
def initialize(attributes = {})
|
|
57
69
|
if (!attributes.is_a?(Hash))
|
|
58
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `VeniceClient::
|
|
70
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `VeniceClient::CreateChatCompletion200ResponseChoicesInnerLogprobs` initialize method"
|
|
59
71
|
end
|
|
60
72
|
|
|
61
73
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
74
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
62
75
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
63
|
-
if (!
|
|
64
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `VeniceClient::
|
|
76
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
77
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `VeniceClient::CreateChatCompletion200ResponseChoicesInnerLogprobs`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
65
78
|
end
|
|
66
79
|
h[k.to_sym] = v
|
|
67
80
|
}
|
|
@@ -74,10 +87,14 @@ module VeniceClient
|
|
|
74
87
|
|
|
75
88
|
if attributes.key?(:'logprob')
|
|
76
89
|
self.logprob = attributes[:'logprob']
|
|
90
|
+
else
|
|
91
|
+
self.logprob = nil
|
|
77
92
|
end
|
|
78
93
|
|
|
79
94
|
if attributes.key?(:'token')
|
|
80
95
|
self.token = attributes[:'token']
|
|
96
|
+
else
|
|
97
|
+
self.token = nil
|
|
81
98
|
end
|
|
82
99
|
|
|
83
100
|
if attributes.key?(:'top_logprobs')
|
|
@@ -90,6 +107,7 @@ module VeniceClient
|
|
|
90
107
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
91
108
|
# @return Array for valid properties with the reasons
|
|
92
109
|
def list_invalid_properties
|
|
110
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
93
111
|
invalid_properties = Array.new
|
|
94
112
|
if @logprob.nil?
|
|
95
113
|
invalid_properties.push('invalid value for "logprob", logprob cannot be nil.')
|
|
@@ -105,11 +123,32 @@ module VeniceClient
|
|
|
105
123
|
# Check to see if the all the properties in the model are valid
|
|
106
124
|
# @return true if the model is valid
|
|
107
125
|
def valid?
|
|
126
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
108
127
|
return false if @logprob.nil?
|
|
109
128
|
return false if @token.nil?
|
|
110
129
|
true
|
|
111
130
|
end
|
|
112
131
|
|
|
132
|
+
# Custom attribute writer method with validation
|
|
133
|
+
# @param [Object] logprob Value to be assigned
|
|
134
|
+
def logprob=(logprob)
|
|
135
|
+
if logprob.nil?
|
|
136
|
+
fail ArgumentError, 'logprob cannot be nil'
|
|
137
|
+
end
|
|
138
|
+
|
|
139
|
+
@logprob = logprob
|
|
140
|
+
end
|
|
141
|
+
|
|
142
|
+
# Custom attribute writer method with validation
|
|
143
|
+
# @param [Object] token Value to be assigned
|
|
144
|
+
def token=(token)
|
|
145
|
+
if token.nil?
|
|
146
|
+
fail ArgumentError, 'token cannot be nil'
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
@token = token
|
|
150
|
+
end
|
|
151
|
+
|
|
113
152
|
# Checks equality by comparing each attribute.
|
|
114
153
|
# @param [Object] Object to be compared
|
|
115
154
|
def ==(o)
|
|
@@ -137,39 +176,33 @@ module VeniceClient
|
|
|
137
176
|
# @param [Hash] attributes Model attributes in the form of hash
|
|
138
177
|
# @return [Object] Returns the model itself
|
|
139
178
|
def self.build_from_hash(attributes)
|
|
140
|
-
new.build_from_hash(attributes)
|
|
141
|
-
end
|
|
142
|
-
|
|
143
|
-
# Builds the object from hash
|
|
144
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
|
145
|
-
# @return [Object] Returns the model itself
|
|
146
|
-
def build_from_hash(attributes)
|
|
147
179
|
return nil unless attributes.is_a?(Hash)
|
|
148
|
-
|
|
149
|
-
|
|
180
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
181
|
+
transformed_hash = {}
|
|
182
|
+
openapi_types.each_pair do |key, type|
|
|
183
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
184
|
+
transformed_hash["#{key}"] = nil
|
|
185
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
150
186
|
# check to ensure the input is an array given that the attribute
|
|
151
187
|
# is documented as an array but the input is not
|
|
152
|
-
if attributes[
|
|
153
|
-
|
|
188
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
189
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
154
190
|
end
|
|
155
|
-
elsif !attributes[
|
|
156
|
-
|
|
157
|
-
elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
|
158
|
-
self.send("#{key}=", nil)
|
|
191
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
192
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
159
193
|
end
|
|
160
194
|
end
|
|
161
|
-
|
|
162
|
-
self
|
|
195
|
+
new(transformed_hash)
|
|
163
196
|
end
|
|
164
197
|
|
|
165
198
|
# Deserializes the data based on type
|
|
166
199
|
# @param string type Data type
|
|
167
200
|
# @param string value Value to be deserialized
|
|
168
201
|
# @return [Object] Deserialized data
|
|
169
|
-
def _deserialize(type, value)
|
|
202
|
+
def self._deserialize(type, value)
|
|
170
203
|
case type.to_sym
|
|
171
|
-
when :
|
|
172
|
-
|
|
204
|
+
when :Time
|
|
205
|
+
Time.parse(value)
|
|
173
206
|
when :Date
|
|
174
207
|
Date.parse(value)
|
|
175
208
|
when :String
|
|
@@ -199,7 +232,9 @@ module VeniceClient
|
|
|
199
232
|
end
|
|
200
233
|
end
|
|
201
234
|
else # model
|
|
202
|
-
|
|
235
|
+
# models (e.g. Pet) or oneOf
|
|
236
|
+
klass = VeniceClient.const_get(type)
|
|
237
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
203
238
|
end
|
|
204
239
|
end
|
|
205
240
|
|
|
@@ -247,5 +282,8 @@ module VeniceClient
|
|
|
247
282
|
else
|
|
248
283
|
value
|
|
249
284
|
end
|
|
250
|
-
end
|
|
285
|
+
end
|
|
286
|
+
|
|
287
|
+
end
|
|
288
|
+
|
|
251
289
|
end
|
|
@@ -3,16 +3,18 @@
|
|
|
3
3
|
|
|
4
4
|
#The Venice.ai API.
|
|
5
5
|
|
|
6
|
-
OpenAPI
|
|
6
|
+
The version of the OpenAPI document: 20250709.013306
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.14.0
|
|
7
10
|
|
|
8
|
-
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
|
9
|
-
Swagger Codegen version: 3.0.68
|
|
10
11
|
=end
|
|
11
12
|
|
|
12
13
|
require 'date'
|
|
14
|
+
require 'time'
|
|
13
15
|
|
|
14
16
|
module VeniceClient
|
|
15
|
-
class
|
|
17
|
+
class CreateChatCompletion200ResponseChoicesInnerLogprobsTopLogprobsInner
|
|
16
18
|
attr_accessor :bytes
|
|
17
19
|
|
|
18
20
|
attr_accessor :logprob
|
|
@@ -28,12 +30,22 @@ module VeniceClient
|
|
|
28
30
|
}
|
|
29
31
|
end
|
|
30
32
|
|
|
33
|
+
# Returns attribute mapping this model knows about
|
|
34
|
+
def self.acceptable_attribute_map
|
|
35
|
+
attribute_map
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
# Returns all the JSON keys this model knows about
|
|
39
|
+
def self.acceptable_attributes
|
|
40
|
+
acceptable_attribute_map.values
|
|
41
|
+
end
|
|
42
|
+
|
|
31
43
|
# Attribute type mapping.
|
|
32
44
|
def self.openapi_types
|
|
33
45
|
{
|
|
34
|
-
:'bytes' => :'
|
|
35
|
-
:'logprob' => :'
|
|
36
|
-
:'token' => :'
|
|
46
|
+
:'bytes' => :'Array<Float>',
|
|
47
|
+
:'logprob' => :'Float',
|
|
48
|
+
:'token' => :'String'
|
|
37
49
|
}
|
|
38
50
|
end
|
|
39
51
|
|
|
@@ -42,18 +54,19 @@ module VeniceClient
|
|
|
42
54
|
Set.new([
|
|
43
55
|
])
|
|
44
56
|
end
|
|
45
|
-
|
|
57
|
+
|
|
46
58
|
# Initializes the object
|
|
47
59
|
# @param [Hash] attributes Model attributes in the form of hash
|
|
48
60
|
def initialize(attributes = {})
|
|
49
61
|
if (!attributes.is_a?(Hash))
|
|
50
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `VeniceClient::
|
|
62
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `VeniceClient::CreateChatCompletion200ResponseChoicesInnerLogprobsTopLogprobsInner` initialize method"
|
|
51
63
|
end
|
|
52
64
|
|
|
53
65
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
66
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
54
67
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
55
|
-
if (!
|
|
56
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `VeniceClient::
|
|
68
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
69
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `VeniceClient::CreateChatCompletion200ResponseChoicesInnerLogprobsTopLogprobsInner`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
57
70
|
end
|
|
58
71
|
h[k.to_sym] = v
|
|
59
72
|
}
|
|
@@ -66,16 +79,21 @@ module VeniceClient
|
|
|
66
79
|
|
|
67
80
|
if attributes.key?(:'logprob')
|
|
68
81
|
self.logprob = attributes[:'logprob']
|
|
82
|
+
else
|
|
83
|
+
self.logprob = nil
|
|
69
84
|
end
|
|
70
85
|
|
|
71
86
|
if attributes.key?(:'token')
|
|
72
87
|
self.token = attributes[:'token']
|
|
88
|
+
else
|
|
89
|
+
self.token = nil
|
|
73
90
|
end
|
|
74
91
|
end
|
|
75
92
|
|
|
76
93
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
77
94
|
# @return Array for valid properties with the reasons
|
|
78
95
|
def list_invalid_properties
|
|
96
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
79
97
|
invalid_properties = Array.new
|
|
80
98
|
if @logprob.nil?
|
|
81
99
|
invalid_properties.push('invalid value for "logprob", logprob cannot be nil.')
|
|
@@ -91,11 +109,32 @@ module VeniceClient
|
|
|
91
109
|
# Check to see if the all the properties in the model are valid
|
|
92
110
|
# @return true if the model is valid
|
|
93
111
|
def valid?
|
|
112
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
94
113
|
return false if @logprob.nil?
|
|
95
114
|
return false if @token.nil?
|
|
96
115
|
true
|
|
97
116
|
end
|
|
98
117
|
|
|
118
|
+
# Custom attribute writer method with validation
|
|
119
|
+
# @param [Object] logprob Value to be assigned
|
|
120
|
+
def logprob=(logprob)
|
|
121
|
+
if logprob.nil?
|
|
122
|
+
fail ArgumentError, 'logprob cannot be nil'
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
@logprob = logprob
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
# Custom attribute writer method with validation
|
|
129
|
+
# @param [Object] token Value to be assigned
|
|
130
|
+
def token=(token)
|
|
131
|
+
if token.nil?
|
|
132
|
+
fail ArgumentError, 'token cannot be nil'
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
@token = token
|
|
136
|
+
end
|
|
137
|
+
|
|
99
138
|
# Checks equality by comparing each attribute.
|
|
100
139
|
# @param [Object] Object to be compared
|
|
101
140
|
def ==(o)
|
|
@@ -122,39 +161,33 @@ module VeniceClient
|
|
|
122
161
|
# @param [Hash] attributes Model attributes in the form of hash
|
|
123
162
|
# @return [Object] Returns the model itself
|
|
124
163
|
def self.build_from_hash(attributes)
|
|
125
|
-
new.build_from_hash(attributes)
|
|
126
|
-
end
|
|
127
|
-
|
|
128
|
-
# Builds the object from hash
|
|
129
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
|
130
|
-
# @return [Object] Returns the model itself
|
|
131
|
-
def build_from_hash(attributes)
|
|
132
164
|
return nil unless attributes.is_a?(Hash)
|
|
133
|
-
|
|
134
|
-
|
|
165
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
166
|
+
transformed_hash = {}
|
|
167
|
+
openapi_types.each_pair do |key, type|
|
|
168
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
169
|
+
transformed_hash["#{key}"] = nil
|
|
170
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
135
171
|
# check to ensure the input is an array given that the attribute
|
|
136
172
|
# is documented as an array but the input is not
|
|
137
|
-
if attributes[
|
|
138
|
-
|
|
173
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
174
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
139
175
|
end
|
|
140
|
-
elsif !attributes[
|
|
141
|
-
|
|
142
|
-
elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
|
143
|
-
self.send("#{key}=", nil)
|
|
176
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
177
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
144
178
|
end
|
|
145
179
|
end
|
|
146
|
-
|
|
147
|
-
self
|
|
180
|
+
new(transformed_hash)
|
|
148
181
|
end
|
|
149
182
|
|
|
150
183
|
# Deserializes the data based on type
|
|
151
184
|
# @param string type Data type
|
|
152
185
|
# @param string value Value to be deserialized
|
|
153
186
|
# @return [Object] Deserialized data
|
|
154
|
-
def _deserialize(type, value)
|
|
187
|
+
def self._deserialize(type, value)
|
|
155
188
|
case type.to_sym
|
|
156
|
-
when :
|
|
157
|
-
|
|
189
|
+
when :Time
|
|
190
|
+
Time.parse(value)
|
|
158
191
|
when :Date
|
|
159
192
|
Date.parse(value)
|
|
160
193
|
when :String
|
|
@@ -184,7 +217,9 @@ module VeniceClient
|
|
|
184
217
|
end
|
|
185
218
|
end
|
|
186
219
|
else # model
|
|
187
|
-
|
|
220
|
+
# models (e.g. Pet) or oneOf
|
|
221
|
+
klass = VeniceClient.const_get(type)
|
|
222
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
188
223
|
end
|
|
189
224
|
end
|
|
190
225
|
|
|
@@ -232,5 +267,8 @@ module VeniceClient
|
|
|
232
267
|
else
|
|
233
268
|
value
|
|
234
269
|
end
|
|
235
|
-
end
|
|
270
|
+
end
|
|
271
|
+
|
|
272
|
+
end
|
|
273
|
+
|
|
236
274
|
end
|