Class: Roast::Cogs::Agent::Output

Inherits:
Roast::Cog::Output show all
Includes:
Roast::Cog::Output::WithJson, Roast::Cog::Output::WithNumber, Roast::Cog::Output::WithText
Defined in:
lib/roast/cogs/agent/output.rb

Overview

Output from running the agent cog

Contains the agent’s final response text, session identifier for conversation continuity, and statistics about the agent execution.

Instance Attribute Summary collapse

Method Summary

Methods included from Roast::Cog::Output::WithText

#lines, #text

Methods included from Roast::Cog::Output::WithNumber

#float, #float!, #integer, #integer!

Instance Attribute Details

#responseObject (readonly)

The agent’s final response text

This is the text content of the agent’s last message in the conversation. For multi-turn conversations, this represents only the final response, not the entire conversation history.

#### See Also

  • ‘text` (from WithText module)

  • ‘lines` (from WithText module)

: String



27
28
29
# File 'lib/roast/cogs/agent/output.rb', line 27

def response
  @response
end

#sessionObject (readonly)

The session identifier for this agent conversation

This identifier can be used to resume the conversation in subsequent agent invocations. When provided to a new agent cog’s input, the agent will have access to the full conversation history from this session.

An agent resuming from this session will fork the session, so multiple agents can independently resume from the same initial session and each see the same state.

: String



39
40
41
# File 'lib/roast/cogs/agent/output.rb', line 39

def session
  @session
end

#statsObject (readonly)

Statistics about the agent execution

Contains metrics such as execution duration, number of turns (back-and-forth exchanges with the agent), token usage, and per-model usage breakdown.

: Stats



47
48
49
# File 'lib/roast/cogs/agent/output.rb', line 47

def stats
  @stats
end