UseRunAgent
katanakit-js / useRunAgent
Function: useRunAgent()
Section titled “Function: 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.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
goal |
string |
The natural-language objective. |
options? |
AgentRunOptions |
Tools, step budget and completion options. |
Returns
Section titled “Returns”Promise<AgentResult>
An AgentResult with the final message and executed steps.
Example
Section titled “Example”import { useRunAgent } from "katanakit-js";
const result = await useRunAgent("Fix the type errors reported by tsc");