Skip to content

UseRunAgent

katanakit-js / useRunAgent

function useRunAgent(goal, options?): Promise<AgentResult>;

Defined in: core/services/agent.service.ts:559

Runs the tool-calling agent loop against a goal until it emits a final answer or exhausts maxSteps.

Parameter Type Description
goal string The natural-language objective.
options? AgentRunOptions Tools, step budget and completion options.

Promise<AgentResult>

An AgentResult with the final message and executed steps.

import { useRunAgent } from "katanakit-js";
const result = await useRunAgent("Fix the type errors reported by tsc");