Class: LittleGhost::AgentInterjections::Result

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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_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_interjections.rb', line 10

def batch_key
  @batch_key
end

#interjection_idsObject (readonly)

Returns the value of attribute interjection_ids

Returns:

  • (Object)

    the current value of interjection_ids



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

def interjection_ids
  @interjection_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_interjections.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_interjections.rb', line 10

def tool_calls
  @tool_calls
end

Instance Method Details

#tool_calls?Boolean

Returns:

  • (Boolean)


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

def tool_calls? = tool_calls