Skip to content
0

katanakit-js / useRunAgent

Function: useRunAgent() ​

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

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

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

Parameters ​

ParameterTypeDescription
goalstringThe natural-language objective.
optionsAgentRunOptionsTools, step budget and completion options.

Returns ​

Promise<AgentResult>

An AgentResult with the final message and executed steps.

Example ​

ts
import { useRunAgent } from "katanakit-js";

const result = await useRunAgent("Fix the type errors reported by tsc");

Released under the MIT License.