UNPKG

@hashbrownai/react

Version:

React components for Hashbrown AI

22 lines (21 loc) 735 B
import { Chat, RuntimeRef } from '@hashbrownai/core'; /** * Options for creating a tool that can run JavaScript code. */ export interface UseToolJavaScriptOptions { /** * The runtime to use for the JavaScript code, created with `defineAsyncRuntime`. */ runtime: RuntimeRef; } /** * Creates a tool that allows the LLM to run JavaScript code. It is run * in a stateful JavaScript environment, with no access to the internet, the DOM, * or any function that you have not explicitly defined. * * @param options - The options for creating the tool. * @returns The tool. */ export declare function useToolJavaScript({ runtime, }: UseToolJavaScriptOptions): Chat.Tool<'javascript', { code: string; }, unknown>;