Class: LittleGhost::AgentInterruptions::Response
- Inherits:
-
Data
- Object
- Data
- LittleGhost::AgentInterruptions::Response
- Defined in:
- lib/little_ghost/agent_interruptions.rb
Instance Attribute Summary collapse
-
#batch_key ⇒ Object
readonly
Returns the value of attribute batch_key.
-
#interruption_ids ⇒ Object
readonly
Returns the value of attribute interruption_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:, interruption_ids: [], batch_key: nil) ⇒ Response
constructor
A new instance of Response.
- #tool_calls? ⇒ Boolean
Constructor Details
#initialize(text:, tool_calls:, interruption_ids: [], batch_key: nil) ⇒ Response
Returns a new instance of Response.
11 12 13 14 15 16 17 18 |
# File 'lib/little_ghost/agent_interruptions.rb', line 11 def initialize(text:, tool_calls:, interruption_ids: [], batch_key: nil) super( text: String(text), tool_calls: !!tool_calls, interruption_ids: Array(interruption_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_interruptions.rb', line 10 def batch_key @batch_key end |
#interruption_ids ⇒ Object (readonly)
Returns the value of attribute interruption_ids
10 11 12 |
# File 'lib/little_ghost/agent_interruptions.rb', line 10 def interruption_ids @interruption_ids end |
#text ⇒ Object (readonly)
Returns the value of attribute text
10 11 12 |
# File 'lib/little_ghost/agent_interruptions.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_interruptions.rb', line 10 def tool_calls @tool_calls end |
Instance Method Details
#tool_calls? ⇒ Boolean
20 |
# File 'lib/little_ghost/agent_interruptions.rb', line 20 def tool_calls? = tool_calls |