Class: LittleGhost::AgentInterruptions::Response

Inherits:
Data
  • Object
show all
Defined in:
lib/little_ghost/agent_interruptions.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_keyObject (readonly)

Returns the value of attribute batch_key

Returns:

  • (Object)

    the current value of batch_key



10
11
12
# File 'lib/little_ghost/agent_interruptions.rb', line 10

def batch_key
  @batch_key
end

#interruption_idsObject (readonly)

Returns the value of attribute interruption_ids

Returns:

  • (Object)

    the current value of interruption_ids



10
11
12
# File 'lib/little_ghost/agent_interruptions.rb', line 10

def interruption_ids
  @interruption_ids
end

#textObject (readonly)

Returns the value of attribute text

Returns:

  • (Object)

    the current value of text



10
11
12
# File 'lib/little_ghost/agent_interruptions.rb', line 10

def text
  @text
end

#tool_callsObject (readonly)

Returns the value of attribute tool_calls

Returns:

  • (Object)

    the current value of 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

Returns:

  • (Boolean)


20
# File 'lib/little_ghost/agent_interruptions.rb', line 20

def tool_calls? = tool_calls