Class: Pikuri::Agent::Event::UserTurn

Inherits:
Data
  • Object
show all
Defined in:
lib/pikuri/agent/event.rb

Overview

User’s input for a turn (+mid_loop: false+, the default) or a host-supplied injection delivered while the loop is running (+mid_loop: true+, drained from Control::Interloper). The flag exists so listeners that treat the UserTurn as a turn boundary can distinguish a fresh turn from an in-loop injection (additional context for the same turn, not a new one). Controls themselves no longer see this event — the Agent pokes their reset! / tick! entry points directly at the right boundaries.

Emitted in two places: by Pikuri::Agent#run_loop at the start of each turn (with mid_loop: false), and by Pikuri::Agent‘s after_tool_result wiring when a queued Control::Interloper item drains into the chat history (with mid_loop: true).

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(content:, mid_loop: false) ⇒ UserTurn

Returns a new instance of UserTurn.

Parameters:

  • content (String)

    user-supplied text

  • mid_loop (Boolean) (defaults to: false)

    false for a turn-starting message (the default); true when drained from Control::Interloper



43
44
45
# File 'lib/pikuri/agent/event.rb', line 43

def initialize(content:, mid_loop: false)
  super
end

Instance Attribute Details

#contentObject (readonly)

Returns the value of attribute content

Returns:

  • (Object)

    the current value of content



38
39
40
# File 'lib/pikuri/agent/event.rb', line 38

def content
  @content
end

#mid_loopObject (readonly)

Returns the value of attribute mid_loop

Returns:

  • (Object)

    the current value of mid_loop



38
39
40
# File 'lib/pikuri/agent/event.rb', line 38

def mid_loop
  @mid_loop
end