@threadplane/chatInterfacev0.3.4

FunctionToolDef

Precise authored function tool — what action() returns. Carries the schema S and the handler's resolved return type R.

import type { FunctionToolDef } from '@threadplane/chat';

Declaration

export interface FunctionToolDef<S extends StandardSchemaV1 = StandardSchemaV1, R = unknown>  {
  readonly description: string;
  readonly followUp?: boolean;
  readonly handler: (args: StandardSchemaInferOutput<S>, context: FunctionToolHandlerContext) => R | Promise<R>;
  readonly idempotent?: boolean;
  readonly kind: 'function';
  readonly schema: S;
}

Type parameters

R
Default: unknown

Members

description

readonly description: string;

followUp

readonly followUp?: boolean;

handler

readonly handler: (args: StandardSchemaInferOutput<S>, context: FunctionToolHandlerContext) => R | Promise<R>;

idempotent

readonly idempotent?: boolean;

kind

readonly kind: 'function';

schema

readonly schema: S;