@hashbrownai/react
Version:
React components for Hashbrown AI
25 lines (24 loc) • 760 B
TypeScript
import { Chat, RuntimeRef } from '@hashbrownai/core';
/**
* Options for creating a tool that can run JavaScript code.
*
* @public
*/
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.
*
* @public
* @param options - The options for creating the tool.
* @returns The tool.
*/
export declare function useToolJavaScript({ runtime, }: UseToolJavaScriptOptions): Chat.Tool<'javascript', {
code: string;
}, unknown>;