Class: OCI::GenerativeAiAgentRuntime::Models::SqlToolOutput
- Inherits:
-
ToolOutput
- Object
- ToolOutput
- OCI::GenerativeAiAgentRuntime::Models::SqlToolOutput
- Defined in:
- lib/oci/generative_ai_agent_runtime/models/sql_tool_output.rb
Overview
Specifies the output format for SQL tools, including the generated SQL statement and an optional preview of the query result.
Constant Summary
Constants inherited from ToolOutput
ToolOutput::TOOL_OUTPUT_TYPE_ENUM
Instance Attribute Summary collapse
-
#additional_info ⇒ String
Specifies optional metadata content.
-
#generated_sql ⇒ String
[Required] Specifies the generated SQL query.
-
#result ⇒ Array<Object>
Represents preview rows from the SQL query.
- #result_files ⇒ OCI::GenerativeAiAgentRuntime::Models::SqlResultFiles
Attributes inherited from ToolOutput
#tool_id, #tool_name, #tool_output_type
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 = {}) ⇒ SqlToolOutput
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 ToolOutput
Constructor Details
#initialize(attributes = {}) ⇒ SqlToolOutput
Initializes the object
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 |
# File 'lib/oci/generative_ai_agent_runtime/models/sql_tool_output.rb', line 70 def initialize(attributes = {}) return unless attributes.is_a?(Hash) attributes['toolOutputType'] = 'SQL_TOOL_OUTPUT' super(attributes) # convert string to symbol for hash key attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } self.generated_sql = attributes[:'generatedSql'] if attributes[:'generatedSql'] raise 'You cannot provide both :generatedSql and :generated_sql' if attributes.key?(:'generatedSql') && attributes.key?(:'generated_sql') self.generated_sql = attributes[:'generated_sql'] if attributes[:'generated_sql'] self.result = attributes[:'result'] if attributes[:'result'] self.result_files = attributes[:'resultFiles'] if attributes[:'resultFiles'] raise 'You cannot provide both :resultFiles and :result_files' if attributes.key?(:'resultFiles') && attributes.key?(:'result_files') self.result_files = attributes[:'result_files'] if attributes[:'result_files'] self.additional_info = attributes[:'additionalInfo'] if attributes[:'additionalInfo'] raise 'You cannot provide both :additionalInfo and :additional_info' if attributes.key?(:'additionalInfo') && attributes.key?(:'additional_info') self.additional_info = attributes[:'additional_info'] if attributes[:'additional_info'] end |
Instance Attribute Details
#additional_info ⇒ String
Specifies optional metadata content.
26 27 28 |
# File 'lib/oci/generative_ai_agent_runtime/models/sql_tool_output.rb', line 26 def additional_info @additional_info end |
#generated_sql ⇒ String
[Required] Specifies the generated SQL query.
15 16 17 |
# File 'lib/oci/generative_ai_agent_runtime/models/sql_tool_output.rb', line 15 def generated_sql @generated_sql end |
#result ⇒ Array<Object>
Represents preview rows from the SQL query.
19 20 21 |
# File 'lib/oci/generative_ai_agent_runtime/models/sql_tool_output.rb', line 19 def result @result end |
#result_files ⇒ OCI::GenerativeAiAgentRuntime::Models::SqlResultFiles
22 23 24 |
# File 'lib/oci/generative_ai_agent_runtime/models/sql_tool_output.rb', line 22 def result_files @result_files end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/oci/generative_ai_agent_runtime/models/sql_tool_output.rb', line 29 def self.attribute_map { # rubocop:disable Style/SymbolLiteral 'tool_id': :'toolId', 'tool_name': :'toolName', 'tool_output_type': :'toolOutputType', 'generated_sql': :'generatedSql', 'result': :'result', 'result_files': :'resultFiles', 'additional_info': :'additionalInfo' # rubocop:enable Style/SymbolLiteral } end |
.swagger_types ⇒ Object
Attribute type mapping.
44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/oci/generative_ai_agent_runtime/models/sql_tool_output.rb', line 44 def self.swagger_types { # rubocop:disable Style/SymbolLiteral 'tool_id': :'String', 'tool_name': :'String', 'tool_output_type': :'String', 'generated_sql': :'String', 'result': :'Array<Object>', 'result_files': :'OCI::GenerativeAiAgentRuntime::Models::SqlResultFiles', 'additional_info': :'String' # rubocop:enable Style/SymbolLiteral } end |
Instance Method Details
#==(other) ⇒ Object
Checks equality by comparing each attribute.
108 109 110 111 112 113 114 115 116 117 118 119 |
# File 'lib/oci/generative_ai_agent_runtime/models/sql_tool_output.rb', line 108 def ==(other) return true if equal?(other) self.class == other.class && tool_id == other.tool_id && tool_name == other.tool_name && tool_output_type == other.tool_output_type && generated_sql == other.generated_sql && result == other.result && result_files == other.result_files && additional_info == other.additional_info end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 |
# File 'lib/oci/generative_ai_agent_runtime/models/sql_tool_output.rb', line 144 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
124 125 126 |
# File 'lib/oci/generative_ai_agent_runtime/models/sql_tool_output.rb', line 124 def eql?(other) self == other end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
133 134 135 |
# File 'lib/oci/generative_ai_agent_runtime/models/sql_tool_output.rb', line 133 def hash [tool_id, tool_name, tool_output_type, generated_sql, result, result_files, additional_info].hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
177 178 179 180 181 182 183 184 185 186 |
# File 'lib/oci/generative_ai_agent_runtime/models/sql_tool_output.rb', line 177 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
171 172 173 |
# File 'lib/oci/generative_ai_agent_runtime/models/sql_tool_output.rb', line 171 def to_s to_hash.to_s end |