Creates a tool with a schema.
API
export declare function useTool<
const Name extends string,
Schema extends s.HashbrownType ,
Result,
>(
input: ToolOptionsWithInput <Name, Schema, Result>,
): Chat.Tool <
Name,
s.Infer <Schema>,
Result
>;useTool
Chat.Tool<Name, s.Infer<Schema>, Result>@paraminput:ToolOptionsWithInput<Name, Schema, Result>The input for the tool containing: - name: The name of the tool - description: The description of the tool - schema: The schema of the tool - handler: The handler of the tool
@typeNamestring@typeSchemas.HashbrownType@typeResult@returnsChat.Tool<Name, s.Infer<Schema>, Result>API
export declare function useTool<const Name extends string, Result>(
input: ToolOptionsWithUnknownSchema <Name, Result>,
): Chat.Tool <Name, any, Result>;useTool
Chat.Tool<Name, any, Result>@paraminput:ToolOptionsWithUnknownSchema<Name, Result>The input for the tool containing: - name: The name of the tool - description: The description of the tool - schema: The schema of the tool - handler: The handler of the tool
@typeNamestring@typeResult@returnsChat.Tool<Name, any, Result>API
export declare function useTool<const Name extends string, Result>(
input: ToolOptionsWithoutInput <Name, Result>,
): Chat.Tool <Name, void, Result>;useTool
Chat.Tool<Name, void, Result>@paraminput:ToolOptionsWithoutInput<Name, Result>The input for the tool containing: - name: The name of the tool - description: The description of the tool - schema: The schema of the tool - handler: The handler of the tool
@typeNamestring@typeResult@returnsChat.Tool<Name, void, Result>