Class: LittleGhost::CodeMode::ExecTool

Inherits:
Tool
  • Object
show all
Defined in:
lib/little_ghost/code_mode/runtime.rb

Overview

:nodoc:

Direct Known Subclasses

StopTool, WaitTool

Constant Summary

Constants inherited from Tool

Tool::UNSET_RESULT_VALUE

Instance Attribute Summary

Attributes inherited from Tool

#context

Instance Method Summary collapse

Methods inherited from Tool

#agent, available?, available_if, #close, define, description, #description, exclusive, #exclusive?, #execute, #initialize, input_schema, #input_schema, #model, #run, #runtime, #sandbox, specification, #specification, tool_name, #tool_name, #workspace

Methods included from Support::ClassAttributes

#class_attribute, included

Constructor Details

This class inherits a constructor from LittleGhost::Tool

Instance Method Details

#call(input) ⇒ Object



254
255
256
257
258
259
260
261
262
263
# File 'lib/little_ghost/code_mode/runtime.rb', line 254

def call(input)
  result = agent.code_mode_runtime.execute(
    source: input.fetch("source"),
    context:,
    **{
      max_output_tokens: input["max_output_tokens"]
    }.compact
  )
  serialize(result)
end