TypeScript API Reference
Import
Agent
Agent.run
Agent.run() builds the message list, calls the model provider, executes returned tool calls, appends tool results, and continues until no tool calls are returned or a stop condition matches.
createJoyTokenProvider
Creates a ModelProvider backed by @joytoken/client-sdk-ts.
defineTool
defineTool() keeps the OpenAI-compatible schema and the execution function together.
Stop conditions
Custom stop condition: