Class: Cadenya::Types::ToolCalled
- Inherits:
-
Object
- Object
- Cadenya::Types::ToolCalled
- Defined in:
- lib/cadenya/types.rb
Instance Attribute Summary collapse
-
#arguments ⇒ Object
readonly
Returns the value of attribute arguments.
-
#arguments_exposed_in_widgets ⇒ Object
readonly
Returns the value of attribute arguments_exposed_in_widgets.
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#tool ⇒ Object
readonly
Returns the value of attribute tool.
-
#tool_call_id ⇒ Object
readonly
Returns the value of attribute tool_call_id.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(tool_call_id: nil, tool: nil, config: nil, arguments: nil, arguments_exposed_in_widgets: nil) ⇒ ToolCalled
constructor
A new instance of ToolCalled.
- #to_h ⇒ Object
Constructor Details
#initialize(tool_call_id: nil, tool: nil, config: nil, arguments: nil, arguments_exposed_in_widgets: nil) ⇒ ToolCalled
Returns a new instance of ToolCalled.
5676 5677 5678 5679 5680 5681 5682 |
# File 'lib/cadenya/types.rb', line 5676 def initialize(tool_call_id: nil, tool: nil, config: nil, arguments: nil, arguments_exposed_in_widgets: nil) @tool_call_id = tool_call_id @tool = tool @config = config @arguments = arguments @arguments_exposed_in_widgets = end |
Instance Attribute Details
#arguments ⇒ Object (readonly)
Returns the value of attribute arguments.
5674 5675 5676 |
# File 'lib/cadenya/types.rb', line 5674 def arguments @arguments end |
#arguments_exposed_in_widgets ⇒ Object (readonly)
Returns the value of attribute arguments_exposed_in_widgets.
5674 5675 5676 |
# File 'lib/cadenya/types.rb', line 5674 def @arguments_exposed_in_widgets end |
#config ⇒ Object (readonly)
Returns the value of attribute config.
5674 5675 5676 |
# File 'lib/cadenya/types.rb', line 5674 def config @config end |
#tool ⇒ Object (readonly)
Returns the value of attribute tool.
5674 5675 5676 |
# File 'lib/cadenya/types.rb', line 5674 def tool @tool end |
#tool_call_id ⇒ Object (readonly)
Returns the value of attribute tool_call_id.
5674 5675 5676 |
# File 'lib/cadenya/types.rb', line 5674 def tool_call_id @tool_call_id end |
Class Method Details
.from_json(data) ⇒ Object
5684 5685 5686 5687 5688 5689 5690 5691 5692 |
# File 'lib/cadenya/types.rb', line 5684 def self.from_json(data) new( tool_call_id: data["toolCallId"], tool: data["tool"].nil? ? nil : Types.decode_CallableTool(data["tool"]), config: data["config"].nil? ? nil : Types.decode_ToolSpec_Config(data["config"]), arguments: data["arguments"], arguments_exposed_in_widgets: data["argumentsExposedInWidgets"], ) end |
Instance Method Details
#to_h ⇒ Object
5694 5695 5696 5697 5698 5699 5700 5701 5702 |
# File 'lib/cadenya/types.rb', line 5694 def to_h { tool_call_id: Util.plain(@tool_call_id), tool: Util.plain(@tool), config: Util.plain(@config), arguments: Util.plain(@arguments), arguments_exposed_in_widgets: Util.plain(@arguments_exposed_in_widgets), }.reject { |_k, v| v.nil? } end |