MCP-K8s

 view release on metacpan or  search on metacpan

examples/raider-configmap-demo.pl  view on Meta::CPAN

my $engine = Langertha::Engine::Anthropic->new(
  model       => $model,
  mcp_servers => [$mcp],
);

# ── Raider ───────────────────────────────────────────────────────────
my $iteration_t0;

my $raider = Langertha::Raider->new(
  engine         => $engine,
  max_iterations => 15,
  on_iteration   => sub {
    my ($raider, $iteration) = @_;

    # Show timing for previous iteration
    if ($iteration_t0 && $iteration > 2) {
      my $prev_ms = tv_interval($iteration_t0) * 1000;
      info(sprintf("  iteration took %s", fmt_ms($prev_ms)));
    }

    $iteration_t0 = [gettimeofday];

examples/raider-configmap-demo.pl  view on Meta::CPAN

  # ── AI Response ──────────────────────────────────────────────────
  banner("AI Response");
  print $response, "\n";

  # ── Metrics Summary ──────────────────────────────────────────────
  banner("Session Metrics");

  my $m = $raider->metrics;

  label("Total time:", fmt_ms($raid_elapsed));
  label("Iterations:", $m->{iterations});
  label("Tool calls:", $m->{tool_calls});

  if ($raider->has_last_prompt_tokens) {
    label("Last prompt tokens:", $raider->_last_prompt_tokens);
  }

  # ── Per-tool breakdown ───────────────────────────────────────────
  my @used_tools = sort { $tool_stats{$b}{calls} <=> $tool_stats{$a}{calls} }
                   grep { $tool_stats{$_}{calls} > 0 } keys %tool_stats;



( run in 2.646 seconds using v1.01-cache-2.11-cpan-71847e10f99 )