Class: Cadenya::Types::AssistantMessage
- Inherits:
-
Object
- Object
- Cadenya::Types::AssistantMessage
- Defined in:
- lib/cadenya/types.rb
Instance Attribute Summary collapse
-
#content ⇒ Object
readonly
Returns the value of attribute content.
-
#tool_calls ⇒ Object
readonly
Returns the value of attribute tool_calls.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(content: nil, tool_calls: nil) ⇒ AssistantMessage
constructor
A new instance of AssistantMessage.
- #to_h ⇒ Object
Constructor Details
#initialize(content: nil, tool_calls: nil) ⇒ AssistantMessage
Returns a new instance of AssistantMessage.
962 963 964 965 |
# File 'lib/cadenya/types.rb', line 962 def initialize(content: nil, tool_calls: nil) @content = content @tool_calls = tool_calls end |
Instance Attribute Details
#content ⇒ Object (readonly)
Returns the value of attribute content.
960 961 962 |
# File 'lib/cadenya/types.rb', line 960 def content @content end |
#tool_calls ⇒ Object (readonly)
Returns the value of attribute tool_calls.
960 961 962 |
# File 'lib/cadenya/types.rb', line 960 def tool_calls @tool_calls end |
Class Method Details
.from_json(data) ⇒ Object
967 968 969 970 971 972 |
# File 'lib/cadenya/types.rb', line 967 def self.from_json(data) new( content: data["content"], tool_calls: data["toolCalls"].nil? ? nil : (data["toolCalls"]).map { |item| Types::AssistantToolCall.from_json(item) }, ) end |