Class: LittleGhost::Subagents::ControlTool
- Inherits:
-
Tool
- Object
- Tool
- LittleGhost::Subagents::ControlTool
show all
- Defined in:
- lib/little_ghost/subagents/control_tool.rb
Overview
Constant Summary
Constants inherited
from Tool
Tool::UNSET_RESULT_VALUE
Instance Attribute Summary
Attributes inherited from Tool
#context
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Tool
#agent, available?, available_if, #call, #close, define, description, exclusive, #exclusive?, #execute, #initialize, input_schema, #model, #run, #runtime, #sandbox, specification, tool_name, #tool_name, #workspace
#class_attribute, included
Class Method Details
.framework_prompts(description:, schema: {}, manager: nil) ⇒ Object
11
12
13
14
15
16
17
18
19
20
21
|
# File 'lib/little_ghost/subagents/control_tool.rb', line 11
def framework_prompts(description:, schema: {}, manager: nil)
self.framework_description_reference = description
self.framework_schema_references = schema.freeze
self.framework_prompt_manager = manager
renderer = FrameworkPrompts.new
self.description(renderer.render_reference(description))
resolved_schema = schema.reduce(input_schema) do |value, (path, reference)|
replace_schema_value(value, Array(path), renderer.render_reference(reference))
end
input_schema(resolved_schema)
end
|
Instance Method Details
#description ⇒ Object
34
35
36
|
# File 'lib/little_ghost/subagents/control_tool.rb', line 34
def description
render_reference(self.class.framework_description_reference)
end
|
38
39
40
41
42
|
# File 'lib/little_ghost/subagents/control_tool.rb', line 38
def input_schema
self.class.framework_schema_references.reduce(self.class.input_schema) do |schema, (path, reference)|
replace(schema, Array(path), render_reference(reference))
end.freeze
end
|
#specification ⇒ Object
44
|
# File 'lib/little_ghost/subagents/control_tool.rb', line 44
def specification = {name: tool_name, description:, input_schema:}.freeze
|