Class: AIA::RobotBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/aia/robot_builder.rb

Class Method Summary collapse

Class Method Details

.build(config, namer:) ⇒ RobotLab::Robot

Build a single robot for one model spec.

Parameters:

Returns:

  • (RobotLab::Robot)


16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/aia/robot_builder.rb', line 16

def build(config, namer:)
  model_spec    = config.models.first
  robot_name    = namer.name_for(model_spec.name)
  roster        = [{ name: robot_name, spec: model_spec }]
  identity      = SystemPromptAssembler.build_identity_prompt(robot_name, model_spec, roster)
  base_prompt   = SystemPromptAssembler.resolve_system_prompt(config, model_spec)
  thinking_note = thinking_mode_instruction(model_spec)
  system_prompt = [identity, base_prompt, thinking_note].compact.join("\n\n")

  RobotFactory.build_robot(
    model_spec,
    name:          robot_name,
    system_prompt: system_prompt,
    local_tools:   ToolLoader.filtered_tools(config),
    mcp_servers:   RobotFactory.mcp_server_configs(config),
    on_content:    nil,
    config:        RobotFactory.build_run_config(config)
  )
end