@promptbook/remote-server
Version:
Promptbook: Create persistent AI agents that turn your company's scattered knowledge into action
36 lines (35 loc) • 1.25 kB
TypeScript
import type { Parameters } from '../types/Parameters';
import type { ScriptLanguage } from '../types/ScriptLanguage';
import type { string_script } from '../types/string_markdown';
/**
* Represents all the tools needed to execute `SCRIPT` tasks
*
* @see https://github.com/webgptorg/promptbook#script-execution-tools
*/
export type ScriptExecutionTools = {
execute(options: ScriptExecutionToolsExecuteOptions): Promise<string>;
};
/**
* Input for the script execution
*/
export type ScriptExecutionToolsExecuteOptions = {
/**
* Language of the script
*/
readonly scriptLanguage: ScriptLanguage;
/**
* Parameters for the script
* These parameters are passed to the script as variables
* For example: { "name": "John" } => const name = "John";
*/
readonly parameters: Parameters;
/**
* The content of the script to execute
* - It can be a single statement
* - It can be multiple statements separated by semicolon and return
* - It can be a function (but you need to call it)
* - It can be IIFE (immediately invoked function expression)
* - It can use the parameters as variables and functions from global scope
*/
readonly script: string_script;
};