Class: OCI::GenerativeAiInference::Models::GenericChatRequest
- Inherits:
-
BaseChatRequest
- Object
- BaseChatRequest
- OCI::GenerativeAiInference::Models::GenericChatRequest
- Defined in:
- lib/oci/generative_ai_inference/models/generic_chat_request.rb
Overview
Details for the chat request.
Constant Summary collapse
- REASONING_EFFORT_ENUM =
[ REASONING_EFFORT_NONE = 'NONE'.freeze, REASONING_EFFORT_MINIMAL = 'MINIMAL'.freeze, REASONING_EFFORT_LOW = 'LOW'.freeze, REASONING_EFFORT_MEDIUM = 'MEDIUM'.freeze, REASONING_EFFORT_HIGH = 'HIGH'.freeze ].freeze
- VERBOSITY_ENUM =
[ VERBOSITY_LOW = 'LOW'.freeze, VERBOSITY_MEDIUM = 'MEDIUM'.freeze, VERBOSITY_HIGH = 'HIGH'.freeze ].freeze
- SERVICE_TIER_ENUM =
[ SERVICE_TIER_AUTO = 'AUTO'.freeze, SERVICE_TIER_DEFAULT = 'DEFAULT'.freeze, SERVICE_TIER_PRIORITY = 'PRIORITY'.freeze ].freeze
Constants inherited from BaseChatRequest
BaseChatRequest::API_FORMAT_ENUM
Instance Attribute Summary collapse
-
#frequency_penalty ⇒ Float
To reduce repetitiveness of generated tokens, this number penalizes new tokens based on their frequency in the generated text so far.
-
#is_echo ⇒ BOOLEAN
Whether to include the user prompt in the response.
-
#is_parallel_tool_calls ⇒ BOOLEAN
Whether to enable parallel function calling during tool use.
-
#is_stream ⇒ BOOLEAN
Whether to stream back partial progress.
-
#log_probs ⇒ Integer
Includes the logarithmic probabilities for the most likely output tokens and the chosen tokens.
-
#logit_bias ⇒ Object
Modifies the likelihood of specified tokens that appear in the completion.
-
#max_completion_tokens ⇒ Integer
An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens.
-
#max_tokens ⇒ Integer
The maximum number of tokens that can be generated per output sequence.
-
#messages ⇒ Array<OCI::GenerativeAiInference::Models::Message>
The series of messages in a chat request.
-
#metadata ⇒ Object
Set of 16 key-value pairs that can be attached to an object.
-
#num_generations ⇒ Integer
The number of of generated texts that will be returned.
- #prediction ⇒ OCI::GenerativeAiInference::Models::Prediction
-
#presence_penalty ⇒ Float
To reduce repetitiveness of generated tokens, this number penalizes new tokens based on whether they've appeared in the generated text so far.
-
#reasoning_effort ⇒ String
Constrains effort on reasoning for reasoning models.
- #response_format ⇒ OCI::GenerativeAiInference::Models::ResponseFormat
-
#seed ⇒ Integer
If specified, the backend will make a best effort to sample tokens deterministically, so that repeated requests with the same seed and parameters yield the same result.
-
#service_tier ⇒ String
Specifies the processing type used for serving the request.
-
#stop ⇒ Array<String>
List of strings that stop the generation if they are generated for the response text.
- #stream_options ⇒ OCI::GenerativeAiInference::Models::StreamOptions
-
#temperature ⇒ Float
A number that sets the randomness of the generated output.
- #tool_choice ⇒ OCI::GenerativeAiInference::Models::ToolChoice
-
#tools ⇒ Array<OCI::GenerativeAiInference::Models::ToolDefinition>
A list of tools the model may call.
-
#top_k ⇒ Integer
An integer that sets up the model to use only the top k most likely tokens in the generated output.
-
#top_p ⇒ Float
If set to a probability 0.0 < p < 1.0, it ensures that only the most likely tokens, with total probability mass of p, are considered for generation at each step.
-
#verbosity ⇒ String
Constrains the verbosity of the model's response.
- #web_search_options ⇒ OCI::GenerativeAiInference::Models::WebSearchOptions
Attributes inherited from BaseChatRequest
Class Method Summary collapse
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.swagger_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(other) ⇒ Object
Checks equality by comparing each attribute.
-
#build_from_hash(attributes) ⇒ Object
Builds the object from hash.
- #eql?(other) ⇒ Boolean
-
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ GenericChatRequest
constructor
Initializes the object.
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#to_s ⇒ String
Returns the string representation of the object.
Methods inherited from BaseChatRequest
Constructor Details
#initialize(attributes = {}) ⇒ GenericChatRequest
Initializes the object
259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 |
# File 'lib/oci/generative_ai_inference/models/generic_chat_request.rb', line 259 def initialize(attributes = {}) return unless attributes.is_a?(Hash) attributes['apiFormat'] = 'GENERIC' super(attributes) # convert string to symbol for hash key attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } self. = attributes[:'messages'] if attributes[:'messages'] self.reasoning_effort = attributes[:'reasoningEffort'] if attributes[:'reasoningEffort'] self.reasoning_effort = "medium" if reasoning_effort.nil? && !attributes.key?(:'reasoningEffort') # rubocop:disable Style/StringLiterals raise 'You cannot provide both :reasoningEffort and :reasoning_effort' if attributes.key?(:'reasoningEffort') && attributes.key?(:'reasoning_effort') self.reasoning_effort = attributes[:'reasoning_effort'] if attributes[:'reasoning_effort'] self.reasoning_effort = "medium" if reasoning_effort.nil? && !attributes.key?(:'reasoningEffort') && !attributes.key?(:'reasoning_effort') # rubocop:disable Style/StringLiterals self.verbosity = attributes[:'verbosity'] if attributes[:'verbosity'] self. = attributes[:'metadata'] if attributes[:'metadata'] self.is_stream = attributes[:'isStream'] unless attributes[:'isStream'].nil? self.is_stream = false if is_stream.nil? && !attributes.key?(:'isStream') # rubocop:disable Style/StringLiterals raise 'You cannot provide both :isStream and :is_stream' if attributes.key?(:'isStream') && attributes.key?(:'is_stream') self.is_stream = attributes[:'is_stream'] unless attributes[:'is_stream'].nil? self.is_stream = false if is_stream.nil? && !attributes.key?(:'isStream') && !attributes.key?(:'is_stream') # rubocop:disable Style/StringLiterals self. = attributes[:'streamOptions'] if attributes[:'streamOptions'] raise 'You cannot provide both :streamOptions and :stream_options' if attributes.key?(:'streamOptions') && attributes.key?(:'stream_options') self. = attributes[:'stream_options'] if attributes[:'stream_options'] self.num_generations = attributes[:'numGenerations'] if attributes[:'numGenerations'] raise 'You cannot provide both :numGenerations and :num_generations' if attributes.key?(:'numGenerations') && attributes.key?(:'num_generations') self.num_generations = attributes[:'num_generations'] if attributes[:'num_generations'] self.seed = attributes[:'seed'] if attributes[:'seed'] self.is_echo = attributes[:'isEcho'] unless attributes[:'isEcho'].nil? self.is_echo = false if is_echo.nil? && !attributes.key?(:'isEcho') # rubocop:disable Style/StringLiterals raise 'You cannot provide both :isEcho and :is_echo' if attributes.key?(:'isEcho') && attributes.key?(:'is_echo') self.is_echo = attributes[:'is_echo'] unless attributes[:'is_echo'].nil? self.is_echo = false if is_echo.nil? && !attributes.key?(:'isEcho') && !attributes.key?(:'is_echo') # rubocop:disable Style/StringLiterals self.top_k = attributes[:'topK'] if attributes[:'topK'] raise 'You cannot provide both :topK and :top_k' if attributes.key?(:'topK') && attributes.key?(:'top_k') self.top_k = attributes[:'top_k'] if attributes[:'top_k'] self.top_p = attributes[:'topP'] if attributes[:'topP'] self.top_p = 1.0 if top_p.nil? && !attributes.key?(:'topP') # rubocop:disable Style/StringLiterals raise 'You cannot provide both :topP and :top_p' if attributes.key?(:'topP') && attributes.key?(:'top_p') self.top_p = attributes[:'top_p'] if attributes[:'top_p'] self.top_p = 1.0 if top_p.nil? && !attributes.key?(:'topP') && !attributes.key?(:'top_p') # rubocop:disable Style/StringLiterals self.temperature = attributes[:'temperature'] if attributes[:'temperature'] self.temperature = 1.0 if temperature.nil? && !attributes.key?(:'temperature') # rubocop:disable Style/StringLiterals self.frequency_penalty = attributes[:'frequencyPenalty'] if attributes[:'frequencyPenalty'] self.frequency_penalty = 0.0 if frequency_penalty.nil? && !attributes.key?(:'frequencyPenalty') # rubocop:disable Style/StringLiterals raise 'You cannot provide both :frequencyPenalty and :frequency_penalty' if attributes.key?(:'frequencyPenalty') && attributes.key?(:'frequency_penalty') self.frequency_penalty = attributes[:'frequency_penalty'] if attributes[:'frequency_penalty'] self.frequency_penalty = 0.0 if frequency_penalty.nil? && !attributes.key?(:'frequencyPenalty') && !attributes.key?(:'frequency_penalty') # rubocop:disable Style/StringLiterals self.presence_penalty = attributes[:'presencePenalty'] if attributes[:'presencePenalty'] self.presence_penalty = 0.0 if presence_penalty.nil? && !attributes.key?(:'presencePenalty') # rubocop:disable Style/StringLiterals raise 'You cannot provide both :presencePenalty and :presence_penalty' if attributes.key?(:'presencePenalty') && attributes.key?(:'presence_penalty') self.presence_penalty = attributes[:'presence_penalty'] if attributes[:'presence_penalty'] self.presence_penalty = 0.0 if presence_penalty.nil? && !attributes.key?(:'presencePenalty') && !attributes.key?(:'presence_penalty') # rubocop:disable Style/StringLiterals self.stop = attributes[:'stop'] if attributes[:'stop'] self.log_probs = attributes[:'logProbs'] if attributes[:'logProbs'] raise 'You cannot provide both :logProbs and :log_probs' if attributes.key?(:'logProbs') && attributes.key?(:'log_probs') self.log_probs = attributes[:'log_probs'] if attributes[:'log_probs'] self.max_tokens = attributes[:'maxTokens'] if attributes[:'maxTokens'] raise 'You cannot provide both :maxTokens and :max_tokens' if attributes.key?(:'maxTokens') && attributes.key?(:'max_tokens') self.max_tokens = attributes[:'max_tokens'] if attributes[:'max_tokens'] self.max_completion_tokens = attributes[:'maxCompletionTokens'] if attributes[:'maxCompletionTokens'] raise 'You cannot provide both :maxCompletionTokens and :max_completion_tokens' if attributes.key?(:'maxCompletionTokens') && attributes.key?(:'max_completion_tokens') self.max_completion_tokens = attributes[:'max_completion_tokens'] if attributes[:'max_completion_tokens'] self.logit_bias = attributes[:'logitBias'] if attributes[:'logitBias'] raise 'You cannot provide both :logitBias and :logit_bias' if attributes.key?(:'logitBias') && attributes.key?(:'logit_bias') self.logit_bias = attributes[:'logit_bias'] if attributes[:'logit_bias'] self.prediction = attributes[:'prediction'] if attributes[:'prediction'] self.response_format = attributes[:'responseFormat'] if attributes[:'responseFormat'] raise 'You cannot provide both :responseFormat and :response_format' if attributes.key?(:'responseFormat') && attributes.key?(:'response_format') self.response_format = attributes[:'response_format'] if attributes[:'response_format'] self.tool_choice = attributes[:'toolChoice'] if attributes[:'toolChoice'] raise 'You cannot provide both :toolChoice and :tool_choice' if attributes.key?(:'toolChoice') && attributes.key?(:'tool_choice') self.tool_choice = attributes[:'tool_choice'] if attributes[:'tool_choice'] self.is_parallel_tool_calls = attributes[:'isParallelToolCalls'] unless attributes[:'isParallelToolCalls'].nil? self.is_parallel_tool_calls = true if is_parallel_tool_calls.nil? && !attributes.key?(:'isParallelToolCalls') # rubocop:disable Style/StringLiterals raise 'You cannot provide both :isParallelToolCalls and :is_parallel_tool_calls' if attributes.key?(:'isParallelToolCalls') && attributes.key?(:'is_parallel_tool_calls') self.is_parallel_tool_calls = attributes[:'is_parallel_tool_calls'] unless attributes[:'is_parallel_tool_calls'].nil? self.is_parallel_tool_calls = true if is_parallel_tool_calls.nil? && !attributes.key?(:'isParallelToolCalls') && !attributes.key?(:'is_parallel_tool_calls') # rubocop:disable Style/StringLiterals self.tools = attributes[:'tools'] if attributes[:'tools'] self. = attributes[:'webSearchOptions'] if attributes[:'webSearchOptions'] raise 'You cannot provide both :webSearchOptions and :web_search_options' if attributes.key?(:'webSearchOptions') && attributes.key?(:'web_search_options') self. = attributes[:'web_search_options'] if attributes[:'web_search_options'] self.service_tier = attributes[:'serviceTier'] if attributes[:'serviceTier'] raise 'You cannot provide both :serviceTier and :service_tier' if attributes.key?(:'serviceTier') && attributes.key?(:'service_tier') self.service_tier = attributes[:'service_tier'] if attributes[:'service_tier'] end |
Instance Attribute Details
#frequency_penalty ⇒ Float
To reduce repetitiveness of generated tokens, this number penalizes new tokens based on their frequency in the generated text so far. Values > 0 encourage the model to use new tokens and values < 0 encourage the model to repeat tokens. Set to 0 to disable.
96 97 98 |
# File 'lib/oci/generative_ai_inference/models/generic_chat_request.rb', line 96 def frequency_penalty @frequency_penalty end |
#is_echo ⇒ BOOLEAN
Whether to include the user prompt in the response. Applies only to non-stream results.
71 72 73 |
# File 'lib/oci/generative_ai_inference/models/generic_chat_request.rb', line 71 def is_echo @is_echo end |
#is_parallel_tool_calls ⇒ BOOLEAN
Whether to enable parallel function calling during tool use.
144 145 146 |
# File 'lib/oci/generative_ai_inference/models/generic_chat_request.rb', line 144 def is_parallel_tool_calls @is_parallel_tool_calls end |
#is_stream ⇒ BOOLEAN
Whether to stream back partial progress. If set to true, as tokens become available, they are sent as data-only server-sent events.
55 56 57 |
# File 'lib/oci/generative_ai_inference/models/generic_chat_request.rb', line 55 def is_stream @is_stream end |
#log_probs ⇒ Integer
Includes the logarithmic probabilities for the most likely output tokens and the chosen tokens.
For example, if the log probability is 5, the API returns a list of the 5 most likely tokens. The API returns the log probability of the sampled token, so there might be up to logprobs+1 elements in the response.
114 115 116 |
# File 'lib/oci/generative_ai_inference/models/generic_chat_request.rb', line 114 def log_probs @log_probs end |
#logit_bias ⇒ Object
Modifies the likelihood of specified tokens that appear in the completion.
Example: '2, "8134": 1, "21943": 0.5, "5923": -100'
131 132 133 |
# File 'lib/oci/generative_ai_inference/models/generic_chat_request.rb', line 131 def logit_bias @logit_bias end |
#max_completion_tokens ⇒ Integer
An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens.
124 125 126 |
# File 'lib/oci/generative_ai_inference/models/generic_chat_request.rb', line 124 def max_completion_tokens @max_completion_tokens end |
#max_tokens ⇒ Integer
The maximum number of tokens that can be generated per output sequence. The token count of your prompt plus maxTokens must not exceed the model's context length. For on-demand inferencing, the response length is capped at 4,000 tokens for each run.
119 120 121 |
# File 'lib/oci/generative_ai_inference/models/generic_chat_request.rb', line 119 def max_tokens @max_tokens end |
#messages ⇒ Array<OCI::GenerativeAiInference::Models::Message>
The series of messages in a chat request. Includes the previous messages in a conversation. Each message includes a role (USER or the CHATBOT) and content.
34 35 36 |
# File 'lib/oci/generative_ai_inference/models/generic_chat_request.rb', line 34 def @messages end |
#metadata ⇒ Object
Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard.
Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters.
51 52 53 |
# File 'lib/oci/generative_ai_inference/models/generic_chat_request.rb', line 51 def @metadata end |
#num_generations ⇒ Integer
The number of of generated texts that will be returned.
62 63 64 |
# File 'lib/oci/generative_ai_inference/models/generic_chat_request.rb', line 62 def num_generations @num_generations end |
#prediction ⇒ OCI::GenerativeAiInference::Models::Prediction
134 135 136 |
# File 'lib/oci/generative_ai_inference/models/generic_chat_request.rb', line 134 def prediction @prediction end |
#presence_penalty ⇒ Float
To reduce repetitiveness of generated tokens, this number penalizes new tokens based on whether they've appeared in the generated text so far. Values > 0 encourage the model to use new tokens and values < 0 encourage the model to repeat tokens.
Similar to frequency penalty, a penalty is applied to previously present tokens, except that this penalty is applied equally to all tokens that have already appeared, regardless of how many times they've appeared. Set to 0 to disable.
103 104 105 |
# File 'lib/oci/generative_ai_inference/models/generic_chat_request.rb', line 103 def presence_penalty @presence_penalty end |
#reasoning_effort ⇒ String
Constrains effort on reasoning for reasoning models. Currently supported values are minimal, low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response.
39 40 41 |
# File 'lib/oci/generative_ai_inference/models/generic_chat_request.rb', line 39 def reasoning_effort @reasoning_effort end |
#response_format ⇒ OCI::GenerativeAiInference::Models::ResponseFormat
137 138 139 |
# File 'lib/oci/generative_ai_inference/models/generic_chat_request.rb', line 137 def response_format @response_format end |
#seed ⇒ Integer
If specified, the backend will make a best effort to sample tokens deterministically, so that repeated requests with the same seed and parameters yield the same result. However, determinism cannot be fully guaranteed.
67 68 69 |
# File 'lib/oci/generative_ai_inference/models/generic_chat_request.rb', line 67 def seed @seed end |
#service_tier ⇒ String
Specifies the processing type used for serving the request.
155 156 157 |
# File 'lib/oci/generative_ai_inference/models/generic_chat_request.rb', line 155 def service_tier @service_tier end |
#stop ⇒ Array<String>
List of strings that stop the generation if they are generated for the response text. The returned output will not contain the stop strings.
107 108 109 |
# File 'lib/oci/generative_ai_inference/models/generic_chat_request.rb', line 107 def stop @stop end |
#stream_options ⇒ OCI::GenerativeAiInference::Models::StreamOptions
58 59 60 |
# File 'lib/oci/generative_ai_inference/models/generic_chat_request.rb', line 58 def @stream_options end |
#temperature ⇒ Float
A number that sets the randomness of the generated output. A lower temperature means a less random generations.
Use lower numbers for tasks with a correct answer such as question answering or summarizing. High temperatures can generate hallucinations or factually incorrect information. Start with temperatures lower than 1.0 and increase the temperature for more creative outputs, as you regenerate the prompts to refine the outputs.
92 93 94 |
# File 'lib/oci/generative_ai_inference/models/generic_chat_request.rb', line 92 def temperature @temperature end |
#tool_choice ⇒ OCI::GenerativeAiInference::Models::ToolChoice
140 141 142 |
# File 'lib/oci/generative_ai_inference/models/generic_chat_request.rb', line 140 def tool_choice @tool_choice end |
#tools ⇒ Array<OCI::GenerativeAiInference::Models::ToolDefinition>
A list of tools the model may call. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported.
148 149 150 |
# File 'lib/oci/generative_ai_inference/models/generic_chat_request.rb', line 148 def tools @tools end |
#top_k ⇒ Integer
An integer that sets up the model to use only the top k most likely tokens in the generated output. A higher k introduces more randomness into the output making the output text sound more natural. Default value is -1 which means to consider all tokens. Setting to 0 disables this method and considers all tokens.
If also using top p, then the model considers only the top tokens whose probabilities add up to p percent and ignores the rest of the k tokens. For example, if k is 20, but the probabilities of the top 10 add up to .75, then only the top 10 tokens are chosen.
78 79 80 |
# File 'lib/oci/generative_ai_inference/models/generic_chat_request.rb', line 78 def top_k @top_k end |
#top_p ⇒ Float
If set to a probability 0.0 < p < 1.0, it ensures that only the most likely tokens, with total probability mass of p, are considered for generation at each step.
To eliminate tokens with low likelihood, assign p a minimum percentage for the next token's likelihood. For example, when p is set to 0.75, the model eliminates the bottom 25 percent for the next token. Set to 1 to consider all tokens and set to 0 to disable. If both k and p are enabled, p acts after k.
85 86 87 |
# File 'lib/oci/generative_ai_inference/models/generic_chat_request.rb', line 85 def top_p @top_p end |
#verbosity ⇒ String
Constrains the verbosity of the model's response. Lower values will result in more concise responses, while higher values will result in more verbose responses.
44 45 46 |
# File 'lib/oci/generative_ai_inference/models/generic_chat_request.rb', line 44 def verbosity @verbosity end |
#web_search_options ⇒ OCI::GenerativeAiInference::Models::WebSearchOptions
151 152 153 |
# File 'lib/oci/generative_ai_inference/models/generic_chat_request.rb', line 151 def @web_search_options end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 |
# File 'lib/oci/generative_ai_inference/models/generic_chat_request.rb', line 158 def self.attribute_map { # rubocop:disable Style/SymbolLiteral 'api_format': :'apiFormat', 'messages': :'messages', 'reasoning_effort': :'reasoningEffort', 'verbosity': :'verbosity', 'metadata': :'metadata', 'is_stream': :'isStream', 'stream_options': :'streamOptions', 'num_generations': :'numGenerations', 'seed': :'seed', 'is_echo': :'isEcho', 'top_k': :'topK', 'top_p': :'topP', 'temperature': :'temperature', 'frequency_penalty': :'frequencyPenalty', 'presence_penalty': :'presencePenalty', 'stop': :'stop', 'log_probs': :'logProbs', 'max_tokens': :'maxTokens', 'max_completion_tokens': :'maxCompletionTokens', 'logit_bias': :'logitBias', 'prediction': :'prediction', 'response_format': :'responseFormat', 'tool_choice': :'toolChoice', 'is_parallel_tool_calls': :'isParallelToolCalls', 'tools': :'tools', 'web_search_options': :'webSearchOptions', 'service_tier': :'serviceTier' # rubocop:enable Style/SymbolLiteral } end |
.swagger_types ⇒ Object
Attribute type mapping.
193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 |
# File 'lib/oci/generative_ai_inference/models/generic_chat_request.rb', line 193 def self.swagger_types { # rubocop:disable Style/SymbolLiteral 'api_format': :'String', 'messages': :'Array<OCI::GenerativeAiInference::Models::Message>', 'reasoning_effort': :'String', 'verbosity': :'String', 'metadata': :'Object', 'is_stream': :'BOOLEAN', 'stream_options': :'OCI::GenerativeAiInference::Models::StreamOptions', 'num_generations': :'Integer', 'seed': :'Integer', 'is_echo': :'BOOLEAN', 'top_k': :'Integer', 'top_p': :'Float', 'temperature': :'Float', 'frequency_penalty': :'Float', 'presence_penalty': :'Float', 'stop': :'Array<String>', 'log_probs': :'Integer', 'max_tokens': :'Integer', 'max_completion_tokens': :'Integer', 'logit_bias': :'Object', 'prediction': :'OCI::GenerativeAiInference::Models::Prediction', 'response_format': :'OCI::GenerativeAiInference::Models::ResponseFormat', 'tool_choice': :'OCI::GenerativeAiInference::Models::ToolChoice', 'is_parallel_tool_calls': :'BOOLEAN', 'tools': :'Array<OCI::GenerativeAiInference::Models::ToolDefinition>', 'web_search_options': :'OCI::GenerativeAiInference::Models::WebSearchOptions', 'service_tier': :'String' # rubocop:enable Style/SymbolLiteral } end |
Instance Method Details
#==(other) ⇒ Object
Checks equality by comparing each attribute.
440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 |
# File 'lib/oci/generative_ai_inference/models/generic_chat_request.rb', line 440 def ==(other) return true if equal?(other) self.class == other.class && api_format == other.api_format && == other. && reasoning_effort == other.reasoning_effort && verbosity == other.verbosity && == other. && is_stream == other.is_stream && == other. && num_generations == other.num_generations && seed == other.seed && is_echo == other.is_echo && top_k == other.top_k && top_p == other.top_p && temperature == other.temperature && frequency_penalty == other.frequency_penalty && presence_penalty == other.presence_penalty && stop == other.stop && log_probs == other.log_probs && max_tokens == other.max_tokens && max_completion_tokens == other.max_completion_tokens && logit_bias == other.logit_bias && prediction == other.prediction && response_format == other.response_format && tool_choice == other.tool_choice && is_parallel_tool_calls == other.is_parallel_tool_calls && tools == other.tools && == other. && service_tier == other.service_tier end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 |
# File 'lib/oci/generative_ai_inference/models/generic_chat_request.rb', line 496 def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.swagger_types.each_pair do |key, type| if type =~ /^Array<(.*)>/i # check to ensure the input is an array given that the the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) public_method("#{key}=").call( attributes[self.class.attribute_map[key]] .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) } ) end elsif !attributes[self.class.attribute_map[key]].nil? public_method("#{key}=").call( OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]) ) end # or else data not found in attributes(hash), not an issue as the data can be optional end self end |
#eql?(other) ⇒ Boolean
476 477 478 |
# File 'lib/oci/generative_ai_inference/models/generic_chat_request.rb', line 476 def eql?(other) self == other end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
485 486 487 |
# File 'lib/oci/generative_ai_inference/models/generic_chat_request.rb', line 485 def hash [api_format, , reasoning_effort, verbosity, , is_stream, , num_generations, seed, is_echo, top_k, top_p, temperature, frequency_penalty, presence_penalty, stop, log_probs, max_tokens, max_completion_tokens, logit_bias, prediction, response_format, tool_choice, is_parallel_tool_calls, tools, , service_tier].hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
529 530 531 532 533 534 535 536 537 538 |
# File 'lib/oci/generative_ai_inference/models/generic_chat_request.rb', line 529 def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = public_method(attr).call next if value.nil? && !instance_variable_defined?("@#{attr}") hash[param] = _to_hash(value) end hash end |
#to_s ⇒ String
Returns the string representation of the object
523 524 525 |
# File 'lib/oci/generative_ai_inference/models/generic_chat_request.rb', line 523 def to_s to_hash.to_s end |