class LittleGhost::CodeMode::ProgramResult
Describes one observation of a code-mode program. Its output contains text produced since the previous observation.
value carries the completed program’s language value when the engine supports one. status is :completed, :still_working, :terminated, or :error. error contains a model-program error; lifecycle and cleanup failures raise instead.
Attributes
A model-program error for an :error result, or nil.
Text produced since the previous observation.
The program state after this observation.
The completed program’s language value, when available.
Public Class Methods
# File lib/little_ghost/code_mode/types.rb, line 35 def initialize(output: "", value: nil, status: :completed, error: nil, artifacts: [], presentation_content: []) super( output:, value:, status:, error:, artifacts: Array(artifacts).dup.freeze, presentation_content: Array(presentation_content).dup.freeze ) end
Creates a program observation with empty output and a successful status by default.
Calls superclass method
Public Instance Methods
Source
# File lib/little_ghost/code_mode/types.rb, line 47 def completed? = status == :completed
Whether the program completed successfully.
Source
# File lib/little_ghost/code_mode/types.rb, line 50 def still_working? = status == :still_working
Whether the program remains active after this observation.