ask
Unpublished development API. This package is under development and is not available as a published release.
Declares a tool the person answers. The model fills args; render draws the control in the
transcript below the message's tool calls, and the value passed to answer becomes the tool result.
import { ask } from '@threadplane/react/chat';Declaration · overload 1
Type parameters
AR
Parameters
tool· requiredOmit<AskTool<A, R>, 'kind'>
Returns
AskTool<A, R>Examples
const clientTools = createClientTools({
pick_day: ask<{ days: string[] }, { day: string }>({
description: 'Ask which day to plan.',
render: ({ args, answer }) => <DayPicker days={args.days} onPick={(day) => answer({ day })} />,
}),
});