Skip to main content

Interface: UseToolsProps

batteries/use-tools.UseToolsProps

Properties to be passed to the UseTools component.

Properties

children

children: Node

The conversation in which the AI can use a tool.

Defined in

packages/ai-jsx/src/batteries/use-tools.tsx:134


fallback

fallback: Node

A fallback response to use if the AI doesn't think any of the tools are relevant. This is only used for models that do not support functions natively. Models that support functions natively don't need this, because they generate their own messages in the case of failure.

Defined in

packages/ai-jsx/src/batteries/use-tools.tsx:145


tools

tools: Record<string, Tool>

The tools the AI can use.

Defined in

packages/ai-jsx/src/batteries/use-tools.tsx:129


showSteps

Optional showSteps: boolean

Whether the result should include intermediate steps, for example, the execution of the function and its response.

Defined in

packages/ai-jsx/src/batteries/use-tools.tsx:139


userData

Optional userData: string

User data the AI can use to determine what parameters to invoke the tool with.

For instance, if the user's query can be "what's the weather like at my current location", you might pass userData as { "location": "Seattle" }.

Defined in

packages/ai-jsx/src/batteries/use-tools.tsx:152