Class: LittleGhost::AgentInterjections::Result
- Inherits:
-
Data
- Object
- Data
- LittleGhost::AgentInterjections::Result
- Defined in:
- lib/little_ghost/agent_interjections.rb
Instance Attribute Summary collapse
-
#batch_key ⇒ Object
readonly
Returns the value of attribute batch_key.
-
#interjection_ids ⇒ Object
readonly
Returns the value of attribute interjection_ids.
-
#text ⇒ Object
readonly
Returns the value of attribute text.
-
#tool_calls ⇒ Object
readonly
Returns the value of attribute tool_calls.
Instance Method Summary collapse
-
#initialize(text:, tool_calls:, interjection_ids: [], batch_key: nil) ⇒ Result
constructor
A new instance of Result.
- #tool_calls? ⇒ Boolean
Constructor Details
#initialize(text:, tool_calls:, interjection_ids: [], batch_key: nil) ⇒ Result
Returns a new instance of Result.
11 12 13 14 15 16 17 18 |
# File 'lib/little_ghost/agent_interjections.rb', line 11 def initialize(text:, tool_calls:, interjection_ids: [], batch_key: nil) super( text: String(text), tool_calls: !!tool_calls, interjection_ids: Array(interjection_ids).map { |id| String(id).dup.freeze }.freeze, batch_key: batch_key.nil? ? nil : String(batch_key).dup.freeze ) end |
Instance Attribute Details
#batch_key ⇒ Object (readonly)
Returns the value of attribute batch_key
10 11 12 |
# File 'lib/little_ghost/agent_interjections.rb', line 10 def batch_key @batch_key end |
#interjection_ids ⇒ Object (readonly)
Returns the value of attribute interjection_ids
10 11 12 |
# File 'lib/little_ghost/agent_interjections.rb', line 10 def interjection_ids @interjection_ids end |
#text ⇒ Object (readonly)
Returns the value of attribute text
10 11 12 |
# File 'lib/little_ghost/agent_interjections.rb', line 10 def text @text end |
#tool_calls ⇒ Object (readonly)
Returns the value of attribute tool_calls
10 11 12 |
# File 'lib/little_ghost/agent_interjections.rb', line 10 def tool_calls @tool_calls end |
Instance Method Details
#tool_calls? ⇒ Boolean
20 |
# File 'lib/little_ghost/agent_interjections.rb', line 20 def tool_calls? = tool_calls |