diff --git a/docs/genaisrc/genaiscript.d.ts b/docs/genaisrc/genaiscript.d.ts index 8fccf3c5fa..51ae8b5f0f 100644 --- a/docs/genaisrc/genaiscript.d.ts +++ b/docs/genaisrc/genaiscript.d.ts @@ -67,9 +67,9 @@ interface PromptLike extends PromptDefinition { text?: string } -type SystemPromptId = OptionsOrString<"system" | "system.annotations" | "system.changelog" | "system.diagrams" | "system.diff" | "system.explanations" | "system.files" | "system.files_schema" | "system.fs_find_files" | "system.fs_read_file" | "system.fs_read_summary" | "system.functions" | "system.math" | "system.python" | "system.python_interpreter" | "system.retrieval_fuzz_search" | "system.retrieval_vector_search" | "system.retrieval_web_search" | "system.schema" | "system.tasks" | "system.technical" | "system.typescript" | "system.zero_shot_cot"> +type SystemPromptId = OptionsOrString<"system" | "system.annotations" | "system.changelog" | "system.diagrams" | "system.diff" | "system.explanations" | "system.files" | "system.files_schema" | "system.fs_find_files" | "system.fs_read_file" | "system.fs_read_summary" | "system.functions" | "system.math" | "system.python" | "system.python_code_interpreter" | "system.retrieval_fuzz_search" | "system.retrieval_vector_search" | "system.retrieval_web_search" | "system.schema" | "system.tasks" | "system.technical" | "system.typescript" | "system.zero_shot_cot"> -type SystemToolId = OptionsOrString<"fs_find_files" | "fs_read_file" | "fs_read_summary" | "math_eval" | "python_interpreter" | "retrieval_fuzz_search" | "retrieval_vector_search" | "retrieval_web_search"> +type SystemToolId = OptionsOrString<"fs_find_files" | "fs_read_file" | "fs_read_summary" | "math_eval" | "python_code_interpreter" | "retrieval_fuzz_search" | "retrieval_vector_search" | "retrieval_web_search"> type FileMergeHandler = ( filename: string, @@ -212,7 +212,7 @@ interface ScriptRuntimeOptions { * - `system.functions`: use functions * - `system.math`: Math expression evaluator * - `system.python`: Expert at generating and understanding Python code. -* - `system.python_interpreter`: Python Dockerized code execution +* - `system.python_code_interpreter`: Python Dockerized code execution for data analysis * - `system.retrieval_fuzz_search`: Full Text Fuzzy Search * - `system.retrieval_vector_search`: Embeddings Vector Search * - `system.retrieval_web_search`: Web Search @@ -233,7 +233,7 @@ interface ScriptRuntimeOptions { * - `fs_read_file`: Reads a file as text from the file system. * - `fs_read_summary`: Reads a summary of a file from the file system. * - `math_eval`: Evaluates a math expression -* - `python_interpreter`: Executes python 3.12 code in a docker container. The process output is returned. Use 'print' to output data. +* - `python_code_interpreter`: Executes python 3.12 code for Data Analysis tasks in a docker container. The process output is returned. Do not generate visualizations. The only packages available are numpy, pandas, scipy. There is NO network connectivity. Do not attempt to install other packages or make web requests. * - `retrieval_fuzz_search`: Search for keywords using the full text of files and a fuzzy distance. * - `retrieval_vector_search`: Search files using embeddings and similarity distance. * - `retrieval_web_search`: Search the web for a user query using Bing Search. @@ -1631,6 +1631,11 @@ interface ContainerHost extends ShellHost { * Stops and cleans out the container */ stop(): Promise + + /** + * Force disconnect network + */ + disconnect(): Promise } interface PromptContext extends ChatGenerationContext { diff --git a/docs/src/components/BuiltinTools.mdx b/docs/src/components/BuiltinTools.mdx index 83dec7df0f..059f8a69ce 100644 --- a/docs/src/components/BuiltinTools.mdx +++ b/docs/src/components/BuiltinTools.mdx @@ -10,7 +10,7 @@ import { LinkCard } from '@astrojs/starlight/components'; - + diff --git a/docs/src/content/docs/reference/scripts/system.mdx b/docs/src/content/docs/reference/scripts/system.mdx index f97f59743b..1633639664 100644 --- a/docs/src/content/docs/reference/scripts/system.mdx +++ b/docs/src/content/docs/reference/scripts/system.mdx @@ -590,64 +590,53 @@ Emit type information compatible with PyLance.` ````` -### `system.python_interpreter` +### `system.python_code_interpreter` -Python Dockerized code execution +Python Dockerized code execution for data analysis -- tool `python_interpreter`: Executes python 3.12 code in a docker container. The process output is returned. Use 'print' to output data. +- tool `python_code_interpreter`: Executes python 3.12 code for Data Analysis tasks in a docker container. The process output is returned. Do not generate visualizations. The only packages available are numpy, pandas, scipy. There is NO network connectivity. Do not attempt to install other packages or make web requests. -`````js wrap title="system.python_interpreter" +`````js wrap title="system.python_code_interpreter" system({ - title: "Python Dockerized code execution", + title: "Python Dockerized code execution for data analysis", }) const image = env.vars.pythonImage ?? "python:3.12" +const packages = ["numpy", "pandas", "scipy"] let container = null defTool( - "python_interpreter", - "Executes python 3.12 code in a docker container. The process output is returned. Use 'print' to output data.", + "python_code_interpreter", + "Executes python 3.12 code for Data Analysis tasks in a docker container. The process output is returned. Do not generate visualizations. The only packages available are numpy, pandas, scipy. There is NO network connectivity. Do not attempt to install other packages or make web requests.", { type: "object", properties: { - requirements: { - type: "string", - description: `list of pip packages to install using pip. should be using the pip install format: - - -`, - }, main: { type: "string", description: "python 3.12 source code to execute", }, }, - required: ["requirements", "main"], + required: ["main"], }, async (args) => { - const { requirements, main = "" } = args - console.log(`python: running code...`) - container = await host.container({ image, networkEnabled: true }) - if (requirements) { - console.log(`installing: ` + requirements) - await container.writeText( - "requirements.txt", - requirements.replace(/[ ,]\s*/g, "\n") - ) + const { main = "" } = args + console.log(`python code interpreter: ` + main) + if (!container) { + console.log(`python: preparing container...`) + container = await host.container({ image, networkEnabled: true }) const res = await container.exec("pip", [ "install", "--root-user-action", "ignore", - "-r", - "requirements.txt", + ...packages, ]) if (res.failed) throw new Error(`Failed to install requirements`) + await container.disconnect() } - console.log(`code: ` + main) await container.writeText("main.py", main) const res = await container.exec("python", ["main.py"]) return res diff --git a/genaisrc/genaiscript.d.ts b/genaisrc/genaiscript.d.ts index 8fccf3c5fa..51ae8b5f0f 100644 --- a/genaisrc/genaiscript.d.ts +++ b/genaisrc/genaiscript.d.ts @@ -67,9 +67,9 @@ interface PromptLike extends PromptDefinition { text?: string } -type SystemPromptId = OptionsOrString<"system" | "system.annotations" | "system.changelog" | "system.diagrams" | "system.diff" | "system.explanations" | "system.files" | "system.files_schema" | "system.fs_find_files" | "system.fs_read_file" | "system.fs_read_summary" | "system.functions" | "system.math" | "system.python" | "system.python_interpreter" | "system.retrieval_fuzz_search" | "system.retrieval_vector_search" | "system.retrieval_web_search" | "system.schema" | "system.tasks" | "system.technical" | "system.typescript" | "system.zero_shot_cot"> +type SystemPromptId = OptionsOrString<"system" | "system.annotations" | "system.changelog" | "system.diagrams" | "system.diff" | "system.explanations" | "system.files" | "system.files_schema" | "system.fs_find_files" | "system.fs_read_file" | "system.fs_read_summary" | "system.functions" | "system.math" | "system.python" | "system.python_code_interpreter" | "system.retrieval_fuzz_search" | "system.retrieval_vector_search" | "system.retrieval_web_search" | "system.schema" | "system.tasks" | "system.technical" | "system.typescript" | "system.zero_shot_cot"> -type SystemToolId = OptionsOrString<"fs_find_files" | "fs_read_file" | "fs_read_summary" | "math_eval" | "python_interpreter" | "retrieval_fuzz_search" | "retrieval_vector_search" | "retrieval_web_search"> +type SystemToolId = OptionsOrString<"fs_find_files" | "fs_read_file" | "fs_read_summary" | "math_eval" | "python_code_interpreter" | "retrieval_fuzz_search" | "retrieval_vector_search" | "retrieval_web_search"> type FileMergeHandler = ( filename: string, @@ -212,7 +212,7 @@ interface ScriptRuntimeOptions { * - `system.functions`: use functions * - `system.math`: Math expression evaluator * - `system.python`: Expert at generating and understanding Python code. -* - `system.python_interpreter`: Python Dockerized code execution +* - `system.python_code_interpreter`: Python Dockerized code execution for data analysis * - `system.retrieval_fuzz_search`: Full Text Fuzzy Search * - `system.retrieval_vector_search`: Embeddings Vector Search * - `system.retrieval_web_search`: Web Search @@ -233,7 +233,7 @@ interface ScriptRuntimeOptions { * - `fs_read_file`: Reads a file as text from the file system. * - `fs_read_summary`: Reads a summary of a file from the file system. * - `math_eval`: Evaluates a math expression -* - `python_interpreter`: Executes python 3.12 code in a docker container. The process output is returned. Use 'print' to output data. +* - `python_code_interpreter`: Executes python 3.12 code for Data Analysis tasks in a docker container. The process output is returned. Do not generate visualizations. The only packages available are numpy, pandas, scipy. There is NO network connectivity. Do not attempt to install other packages or make web requests. * - `retrieval_fuzz_search`: Search for keywords using the full text of files and a fuzzy distance. * - `retrieval_vector_search`: Search files using embeddings and similarity distance. * - `retrieval_web_search`: Search the web for a user query using Bing Search. @@ -1631,6 +1631,11 @@ interface ContainerHost extends ShellHost { * Stops and cleans out the container */ stop(): Promise + + /** + * Force disconnect network + */ + disconnect(): Promise } interface PromptContext extends ChatGenerationContext { diff --git a/packages/cli/src/docker.ts b/packages/cli/src/docker.ts index af3885f5d3..db1e2c585b 100644 --- a/packages/cli/src/docker.ts +++ b/packages/cli/src/docker.ts @@ -299,6 +299,22 @@ export class DockerManager { } } + const disconnect = async () => { + const networks = await this._docker.listNetworks() + for (const network of networks.filter( + ({ Name }) => Name === "bridge" + )) { + const n = await this._docker.getNetwork(network.Id) + if (n) { + const state = await n.inspect() + if (state?.Containers?.[container.id]) { + logVerbose(`container: disconnect ${network.Name}`) + await n.disconnect({ Container: container.id }) + } + } + } + } + const c = { id: container.id, disablePurge: !!options.disablePurge, @@ -309,6 +325,7 @@ export class DockerManager { writeText, readText, copyTo, + disconnect, } this.containers.push(c) await container.start() diff --git a/packages/core/src/genaisrc/genaiscript.d.ts b/packages/core/src/genaisrc/genaiscript.d.ts index 8fccf3c5fa..51ae8b5f0f 100644 --- a/packages/core/src/genaisrc/genaiscript.d.ts +++ b/packages/core/src/genaisrc/genaiscript.d.ts @@ -67,9 +67,9 @@ interface PromptLike extends PromptDefinition { text?: string } -type SystemPromptId = OptionsOrString<"system" | "system.annotations" | "system.changelog" | "system.diagrams" | "system.diff" | "system.explanations" | "system.files" | "system.files_schema" | "system.fs_find_files" | "system.fs_read_file" | "system.fs_read_summary" | "system.functions" | "system.math" | "system.python" | "system.python_interpreter" | "system.retrieval_fuzz_search" | "system.retrieval_vector_search" | "system.retrieval_web_search" | "system.schema" | "system.tasks" | "system.technical" | "system.typescript" | "system.zero_shot_cot"> +type SystemPromptId = OptionsOrString<"system" | "system.annotations" | "system.changelog" | "system.diagrams" | "system.diff" | "system.explanations" | "system.files" | "system.files_schema" | "system.fs_find_files" | "system.fs_read_file" | "system.fs_read_summary" | "system.functions" | "system.math" | "system.python" | "system.python_code_interpreter" | "system.retrieval_fuzz_search" | "system.retrieval_vector_search" | "system.retrieval_web_search" | "system.schema" | "system.tasks" | "system.technical" | "system.typescript" | "system.zero_shot_cot"> -type SystemToolId = OptionsOrString<"fs_find_files" | "fs_read_file" | "fs_read_summary" | "math_eval" | "python_interpreter" | "retrieval_fuzz_search" | "retrieval_vector_search" | "retrieval_web_search"> +type SystemToolId = OptionsOrString<"fs_find_files" | "fs_read_file" | "fs_read_summary" | "math_eval" | "python_code_interpreter" | "retrieval_fuzz_search" | "retrieval_vector_search" | "retrieval_web_search"> type FileMergeHandler = ( filename: string, @@ -212,7 +212,7 @@ interface ScriptRuntimeOptions { * - `system.functions`: use functions * - `system.math`: Math expression evaluator * - `system.python`: Expert at generating and understanding Python code. -* - `system.python_interpreter`: Python Dockerized code execution +* - `system.python_code_interpreter`: Python Dockerized code execution for data analysis * - `system.retrieval_fuzz_search`: Full Text Fuzzy Search * - `system.retrieval_vector_search`: Embeddings Vector Search * - `system.retrieval_web_search`: Web Search @@ -233,7 +233,7 @@ interface ScriptRuntimeOptions { * - `fs_read_file`: Reads a file as text from the file system. * - `fs_read_summary`: Reads a summary of a file from the file system. * - `math_eval`: Evaluates a math expression -* - `python_interpreter`: Executes python 3.12 code in a docker container. The process output is returned. Use 'print' to output data. +* - `python_code_interpreter`: Executes python 3.12 code for Data Analysis tasks in a docker container. The process output is returned. Do not generate visualizations. The only packages available are numpy, pandas, scipy. There is NO network connectivity. Do not attempt to install other packages or make web requests. * - `retrieval_fuzz_search`: Search for keywords using the full text of files and a fuzzy distance. * - `retrieval_vector_search`: Search files using embeddings and similarity distance. * - `retrieval_web_search`: Search the web for a user query using Bing Search. @@ -1631,6 +1631,11 @@ interface ContainerHost extends ShellHost { * Stops and cleans out the container */ stop(): Promise + + /** + * Force disconnect network + */ + disconnect(): Promise } interface PromptContext extends ChatGenerationContext { diff --git a/packages/core/src/genaisrc/system.python_code_interpreter.genai.js b/packages/core/src/genaisrc/system.python_code_interpreter.genai.js new file mode 100644 index 0000000000..3c769ca6e3 --- /dev/null +++ b/packages/core/src/genaisrc/system.python_code_interpreter.genai.js @@ -0,0 +1,43 @@ +system({ + title: "Python Dockerized code execution for data analysis", +}) + +const image = env.vars.pythonImage ?? "python:3.12" +const packages = ["numpy", "pandas", "scipy"] + +let container = null + +defTool( + "python_code_interpreter", + "Executes python 3.12 code for Data Analysis tasks in a docker container. The process output is returned. Do not generate visualizations. The only packages available are numpy, pandas, scipy. There is NO network connectivity. Do not attempt to install other packages or make web requests.", + { + type: "object", + properties: { + main: { + type: "string", + description: "python 3.12 source code to execute", + }, + }, + required: ["main"], + }, + async (args) => { + const { main = "" } = args + console.log(`python code interpreter: ` + main) + if (!container) { + console.log(`python: preparing container...`) + container = await host.container({ image, networkEnabled: true }) + const res = await container.exec("pip", [ + "install", + "--root-user-action", + "ignore", + ...packages, + ]) + if (res.failed) throw new Error(`Failed to install requirements`) + await container.disconnect() + } + + await container.writeText("main.py", main) + const res = await container.exec("python", ["main.py"]) + return res + } +) diff --git a/packages/core/src/genaisrc/system.python_interpreter.genai.js b/packages/core/src/genaisrc/system.python_interpreter.genai.js deleted file mode 100644 index 8e886116b2..0000000000 --- a/packages/core/src/genaisrc/system.python_interpreter.genai.js +++ /dev/null @@ -1,54 +0,0 @@ -system({ - title: "Python Dockerized code execution", -}) - -const image = env.vars.pythonImage ?? "python:3.12" - -let container = null - -defTool( - "python_interpreter", - "Executes python 3.12 code in a docker container. The process output is returned. Use 'print' to output data.", - { - type: "object", - properties: { - requirements: { - type: "string", - description: `list of pip packages to install using pip. should be using the pip install format: - - -`, - }, - main: { - type: "string", - description: "python 3.12 source code to execute", - }, - }, - required: ["requirements", "main"], - }, - async (args) => { - const { requirements, main = "" } = args - console.log(`python: running code...`) - container = await host.container({ image, networkEnabled: true }) - if (requirements) { - console.log(`installing: ` + requirements) - await container.writeText( - "requirements.txt", - requirements.replace(/[ ,]\s*/g, "\n") - ) - const res = await container.exec("pip", [ - "install", - "--root-user-action", - "ignore", - "-r", - "requirements.txt", - ]) - if (res.failed) throw new Error(`Failed to install requirements`) - } - - console.log(`code: ` + main) - await container.writeText("main.py", main) - const res = await container.exec("python", ["main.py"]) - return res - } -) diff --git a/packages/core/src/types/prompt_template.d.ts b/packages/core/src/types/prompt_template.d.ts index 92973d4113..be33b2c7b7 100644 --- a/packages/core/src/types/prompt_template.d.ts +++ b/packages/core/src/types/prompt_template.d.ts @@ -1594,6 +1594,11 @@ interface ContainerHost extends ShellHost { * Stops and cleans out the container */ stop(): Promise + + /** + * Force disconnect network + */ + disconnect(): Promise } interface PromptContext extends ChatGenerationContext { diff --git a/packages/sample/genaisrc/container.genai.mjs b/packages/sample/genaisrc/container.genai.mjs index 787adc0974..c2d3c5a9b5 100644 --- a/packages/sample/genaisrc/container.genai.mjs +++ b/packages/sample/genaisrc/container.genai.mjs @@ -6,10 +6,13 @@ script({ }) const disablePurge = env.vars.purge === "no" -const container = await host.container({ disablePurge }) +const container = await host.container({ disablePurge, networkEnabled: true }) const version = await container.exec("python", ["--version"]) if (!/^python \d/i.test(version.stdout)) throw new Error("python --version failed") +await container.disconnect() +const pipfailed = await container.exec("pip", ["install", "pandas"]) +if (!pipfailed.failed) throw new Error("network not disconnected") await container.writeText("pythonversion.txt", version.stdout) const fversion = await container.readText("pythonversion.txt") if (version.stdout !== fversion) @@ -17,7 +20,8 @@ if (version.stdout !== fversion) `writetext/readtext error, expected '${version.stdout}', got '${fversion}'` ) await container.copyTo("src/rag/*", "copied") -if (!await container.readText("copied/src/rag/markdown.md")) throw new Error("copy failed") +if (!(await container.readText("copied/src/rag/markdown.md"))) + throw new Error("copy failed") await container.writeText("main.py", 'print("hello")') const hello = await container.exec("python", ["main.py"]) if (hello.exitCode) throw new Error("python script failed") diff --git a/packages/sample/genaisrc/data-analyst.genai.mjs b/packages/sample/genaisrc/data-analyst.genai.mjs index 93a9b24ccd..02c1fbaa08 100644 --- a/packages/sample/genaisrc/data-analyst.genai.mjs +++ b/packages/sample/genaisrc/data-analyst.genai.mjs @@ -1,12 +1,9 @@ script({ - system: ["system", "system.python_interpreter"], + system: ["system"], + tools: ["python_code_interpreter"], files: ["src/penguins.csv"], }) const data = def("DATA", env.files, { sliceSample: 25 }) -$`Analyze ${data} with a detailed statistical analysis. - -- Do not generate visualizations. -- Validate computations with code. -` +$`Analyze ${data} with a detailed statistical analysis. Respond with markdown.` diff --git a/packages/sample/genaisrc/genaiscript.d.ts b/packages/sample/genaisrc/genaiscript.d.ts index 8fccf3c5fa..51ae8b5f0f 100644 --- a/packages/sample/genaisrc/genaiscript.d.ts +++ b/packages/sample/genaisrc/genaiscript.d.ts @@ -67,9 +67,9 @@ interface PromptLike extends PromptDefinition { text?: string } -type SystemPromptId = OptionsOrString<"system" | "system.annotations" | "system.changelog" | "system.diagrams" | "system.diff" | "system.explanations" | "system.files" | "system.files_schema" | "system.fs_find_files" | "system.fs_read_file" | "system.fs_read_summary" | "system.functions" | "system.math" | "system.python" | "system.python_interpreter" | "system.retrieval_fuzz_search" | "system.retrieval_vector_search" | "system.retrieval_web_search" | "system.schema" | "system.tasks" | "system.technical" | "system.typescript" | "system.zero_shot_cot"> +type SystemPromptId = OptionsOrString<"system" | "system.annotations" | "system.changelog" | "system.diagrams" | "system.diff" | "system.explanations" | "system.files" | "system.files_schema" | "system.fs_find_files" | "system.fs_read_file" | "system.fs_read_summary" | "system.functions" | "system.math" | "system.python" | "system.python_code_interpreter" | "system.retrieval_fuzz_search" | "system.retrieval_vector_search" | "system.retrieval_web_search" | "system.schema" | "system.tasks" | "system.technical" | "system.typescript" | "system.zero_shot_cot"> -type SystemToolId = OptionsOrString<"fs_find_files" | "fs_read_file" | "fs_read_summary" | "math_eval" | "python_interpreter" | "retrieval_fuzz_search" | "retrieval_vector_search" | "retrieval_web_search"> +type SystemToolId = OptionsOrString<"fs_find_files" | "fs_read_file" | "fs_read_summary" | "math_eval" | "python_code_interpreter" | "retrieval_fuzz_search" | "retrieval_vector_search" | "retrieval_web_search"> type FileMergeHandler = ( filename: string, @@ -212,7 +212,7 @@ interface ScriptRuntimeOptions { * - `system.functions`: use functions * - `system.math`: Math expression evaluator * - `system.python`: Expert at generating and understanding Python code. -* - `system.python_interpreter`: Python Dockerized code execution +* - `system.python_code_interpreter`: Python Dockerized code execution for data analysis * - `system.retrieval_fuzz_search`: Full Text Fuzzy Search * - `system.retrieval_vector_search`: Embeddings Vector Search * - `system.retrieval_web_search`: Web Search @@ -233,7 +233,7 @@ interface ScriptRuntimeOptions { * - `fs_read_file`: Reads a file as text from the file system. * - `fs_read_summary`: Reads a summary of a file from the file system. * - `math_eval`: Evaluates a math expression -* - `python_interpreter`: Executes python 3.12 code in a docker container. The process output is returned. Use 'print' to output data. +* - `python_code_interpreter`: Executes python 3.12 code for Data Analysis tasks in a docker container. The process output is returned. Do not generate visualizations. The only packages available are numpy, pandas, scipy. There is NO network connectivity. Do not attempt to install other packages or make web requests. * - `retrieval_fuzz_search`: Search for keywords using the full text of files and a fuzzy distance. * - `retrieval_vector_search`: Search files using embeddings and similarity distance. * - `retrieval_web_search`: Search the web for a user query using Bing Search. @@ -1631,6 +1631,11 @@ interface ContainerHost extends ShellHost { * Stops and cleans out the container */ stop(): Promise + + /** + * Force disconnect network + */ + disconnect(): Promise } interface PromptContext extends ChatGenerationContext { diff --git a/packages/sample/genaisrc/node/genaiscript.d.ts b/packages/sample/genaisrc/node/genaiscript.d.ts index 8fccf3c5fa..51ae8b5f0f 100644 --- a/packages/sample/genaisrc/node/genaiscript.d.ts +++ b/packages/sample/genaisrc/node/genaiscript.d.ts @@ -67,9 +67,9 @@ interface PromptLike extends PromptDefinition { text?: string } -type SystemPromptId = OptionsOrString<"system" | "system.annotations" | "system.changelog" | "system.diagrams" | "system.diff" | "system.explanations" | "system.files" | "system.files_schema" | "system.fs_find_files" | "system.fs_read_file" | "system.fs_read_summary" | "system.functions" | "system.math" | "system.python" | "system.python_interpreter" | "system.retrieval_fuzz_search" | "system.retrieval_vector_search" | "system.retrieval_web_search" | "system.schema" | "system.tasks" | "system.technical" | "system.typescript" | "system.zero_shot_cot"> +type SystemPromptId = OptionsOrString<"system" | "system.annotations" | "system.changelog" | "system.diagrams" | "system.diff" | "system.explanations" | "system.files" | "system.files_schema" | "system.fs_find_files" | "system.fs_read_file" | "system.fs_read_summary" | "system.functions" | "system.math" | "system.python" | "system.python_code_interpreter" | "system.retrieval_fuzz_search" | "system.retrieval_vector_search" | "system.retrieval_web_search" | "system.schema" | "system.tasks" | "system.technical" | "system.typescript" | "system.zero_shot_cot"> -type SystemToolId = OptionsOrString<"fs_find_files" | "fs_read_file" | "fs_read_summary" | "math_eval" | "python_interpreter" | "retrieval_fuzz_search" | "retrieval_vector_search" | "retrieval_web_search"> +type SystemToolId = OptionsOrString<"fs_find_files" | "fs_read_file" | "fs_read_summary" | "math_eval" | "python_code_interpreter" | "retrieval_fuzz_search" | "retrieval_vector_search" | "retrieval_web_search"> type FileMergeHandler = ( filename: string, @@ -212,7 +212,7 @@ interface ScriptRuntimeOptions { * - `system.functions`: use functions * - `system.math`: Math expression evaluator * - `system.python`: Expert at generating and understanding Python code. -* - `system.python_interpreter`: Python Dockerized code execution +* - `system.python_code_interpreter`: Python Dockerized code execution for data analysis * - `system.retrieval_fuzz_search`: Full Text Fuzzy Search * - `system.retrieval_vector_search`: Embeddings Vector Search * - `system.retrieval_web_search`: Web Search @@ -233,7 +233,7 @@ interface ScriptRuntimeOptions { * - `fs_read_file`: Reads a file as text from the file system. * - `fs_read_summary`: Reads a summary of a file from the file system. * - `math_eval`: Evaluates a math expression -* - `python_interpreter`: Executes python 3.12 code in a docker container. The process output is returned. Use 'print' to output data. +* - `python_code_interpreter`: Executes python 3.12 code for Data Analysis tasks in a docker container. The process output is returned. Do not generate visualizations. The only packages available are numpy, pandas, scipy. There is NO network connectivity. Do not attempt to install other packages or make web requests. * - `retrieval_fuzz_search`: Search for keywords using the full text of files and a fuzzy distance. * - `retrieval_vector_search`: Search files using embeddings and similarity distance. * - `retrieval_web_search`: Search the web for a user query using Bing Search. @@ -1631,6 +1631,11 @@ interface ContainerHost extends ShellHost { * Stops and cleans out the container */ stop(): Promise + + /** + * Force disconnect network + */ + disconnect(): Promise } interface PromptContext extends ChatGenerationContext { diff --git a/packages/sample/genaisrc/python/genaiscript.d.ts b/packages/sample/genaisrc/python/genaiscript.d.ts index 8fccf3c5fa..51ae8b5f0f 100644 --- a/packages/sample/genaisrc/python/genaiscript.d.ts +++ b/packages/sample/genaisrc/python/genaiscript.d.ts @@ -67,9 +67,9 @@ interface PromptLike extends PromptDefinition { text?: string } -type SystemPromptId = OptionsOrString<"system" | "system.annotations" | "system.changelog" | "system.diagrams" | "system.diff" | "system.explanations" | "system.files" | "system.files_schema" | "system.fs_find_files" | "system.fs_read_file" | "system.fs_read_summary" | "system.functions" | "system.math" | "system.python" | "system.python_interpreter" | "system.retrieval_fuzz_search" | "system.retrieval_vector_search" | "system.retrieval_web_search" | "system.schema" | "system.tasks" | "system.technical" | "system.typescript" | "system.zero_shot_cot"> +type SystemPromptId = OptionsOrString<"system" | "system.annotations" | "system.changelog" | "system.diagrams" | "system.diff" | "system.explanations" | "system.files" | "system.files_schema" | "system.fs_find_files" | "system.fs_read_file" | "system.fs_read_summary" | "system.functions" | "system.math" | "system.python" | "system.python_code_interpreter" | "system.retrieval_fuzz_search" | "system.retrieval_vector_search" | "system.retrieval_web_search" | "system.schema" | "system.tasks" | "system.technical" | "system.typescript" | "system.zero_shot_cot"> -type SystemToolId = OptionsOrString<"fs_find_files" | "fs_read_file" | "fs_read_summary" | "math_eval" | "python_interpreter" | "retrieval_fuzz_search" | "retrieval_vector_search" | "retrieval_web_search"> +type SystemToolId = OptionsOrString<"fs_find_files" | "fs_read_file" | "fs_read_summary" | "math_eval" | "python_code_interpreter" | "retrieval_fuzz_search" | "retrieval_vector_search" | "retrieval_web_search"> type FileMergeHandler = ( filename: string, @@ -212,7 +212,7 @@ interface ScriptRuntimeOptions { * - `system.functions`: use functions * - `system.math`: Math expression evaluator * - `system.python`: Expert at generating and understanding Python code. -* - `system.python_interpreter`: Python Dockerized code execution +* - `system.python_code_interpreter`: Python Dockerized code execution for data analysis * - `system.retrieval_fuzz_search`: Full Text Fuzzy Search * - `system.retrieval_vector_search`: Embeddings Vector Search * - `system.retrieval_web_search`: Web Search @@ -233,7 +233,7 @@ interface ScriptRuntimeOptions { * - `fs_read_file`: Reads a file as text from the file system. * - `fs_read_summary`: Reads a summary of a file from the file system. * - `math_eval`: Evaluates a math expression -* - `python_interpreter`: Executes python 3.12 code in a docker container. The process output is returned. Use 'print' to output data. +* - `python_code_interpreter`: Executes python 3.12 code for Data Analysis tasks in a docker container. The process output is returned. Do not generate visualizations. The only packages available are numpy, pandas, scipy. There is NO network connectivity. Do not attempt to install other packages or make web requests. * - `retrieval_fuzz_search`: Search for keywords using the full text of files and a fuzzy distance. * - `retrieval_vector_search`: Search files using embeddings and similarity distance. * - `retrieval_web_search`: Search the web for a user query using Bing Search. @@ -1631,6 +1631,11 @@ interface ContainerHost extends ShellHost { * Stops and cleans out the container */ stop(): Promise + + /** + * Force disconnect network + */ + disconnect(): Promise } interface PromptContext extends ChatGenerationContext { diff --git a/packages/sample/genaisrc/style/genaiscript.d.ts b/packages/sample/genaisrc/style/genaiscript.d.ts index 8fccf3c5fa..51ae8b5f0f 100644 --- a/packages/sample/genaisrc/style/genaiscript.d.ts +++ b/packages/sample/genaisrc/style/genaiscript.d.ts @@ -67,9 +67,9 @@ interface PromptLike extends PromptDefinition { text?: string } -type SystemPromptId = OptionsOrString<"system" | "system.annotations" | "system.changelog" | "system.diagrams" | "system.diff" | "system.explanations" | "system.files" | "system.files_schema" | "system.fs_find_files" | "system.fs_read_file" | "system.fs_read_summary" | "system.functions" | "system.math" | "system.python" | "system.python_interpreter" | "system.retrieval_fuzz_search" | "system.retrieval_vector_search" | "system.retrieval_web_search" | "system.schema" | "system.tasks" | "system.technical" | "system.typescript" | "system.zero_shot_cot"> +type SystemPromptId = OptionsOrString<"system" | "system.annotations" | "system.changelog" | "system.diagrams" | "system.diff" | "system.explanations" | "system.files" | "system.files_schema" | "system.fs_find_files" | "system.fs_read_file" | "system.fs_read_summary" | "system.functions" | "system.math" | "system.python" | "system.python_code_interpreter" | "system.retrieval_fuzz_search" | "system.retrieval_vector_search" | "system.retrieval_web_search" | "system.schema" | "system.tasks" | "system.technical" | "system.typescript" | "system.zero_shot_cot"> -type SystemToolId = OptionsOrString<"fs_find_files" | "fs_read_file" | "fs_read_summary" | "math_eval" | "python_interpreter" | "retrieval_fuzz_search" | "retrieval_vector_search" | "retrieval_web_search"> +type SystemToolId = OptionsOrString<"fs_find_files" | "fs_read_file" | "fs_read_summary" | "math_eval" | "python_code_interpreter" | "retrieval_fuzz_search" | "retrieval_vector_search" | "retrieval_web_search"> type FileMergeHandler = ( filename: string, @@ -212,7 +212,7 @@ interface ScriptRuntimeOptions { * - `system.functions`: use functions * - `system.math`: Math expression evaluator * - `system.python`: Expert at generating and understanding Python code. -* - `system.python_interpreter`: Python Dockerized code execution +* - `system.python_code_interpreter`: Python Dockerized code execution for data analysis * - `system.retrieval_fuzz_search`: Full Text Fuzzy Search * - `system.retrieval_vector_search`: Embeddings Vector Search * - `system.retrieval_web_search`: Web Search @@ -233,7 +233,7 @@ interface ScriptRuntimeOptions { * - `fs_read_file`: Reads a file as text from the file system. * - `fs_read_summary`: Reads a summary of a file from the file system. * - `math_eval`: Evaluates a math expression -* - `python_interpreter`: Executes python 3.12 code in a docker container. The process output is returned. Use 'print' to output data. +* - `python_code_interpreter`: Executes python 3.12 code for Data Analysis tasks in a docker container. The process output is returned. Do not generate visualizations. The only packages available are numpy, pandas, scipy. There is NO network connectivity. Do not attempt to install other packages or make web requests. * - `retrieval_fuzz_search`: Search for keywords using the full text of files and a fuzzy distance. * - `retrieval_vector_search`: Search files using embeddings and similarity distance. * - `retrieval_web_search`: Search the web for a user query using Bing Search. @@ -1631,6 +1631,11 @@ interface ContainerHost extends ShellHost { * Stops and cleans out the container */ stop(): Promise + + /** + * Force disconnect network + */ + disconnect(): Promise } interface PromptContext extends ChatGenerationContext { diff --git a/packages/sample/src/aici/genaiscript.d.ts b/packages/sample/src/aici/genaiscript.d.ts index 8fccf3c5fa..51ae8b5f0f 100644 --- a/packages/sample/src/aici/genaiscript.d.ts +++ b/packages/sample/src/aici/genaiscript.d.ts @@ -67,9 +67,9 @@ interface PromptLike extends PromptDefinition { text?: string } -type SystemPromptId = OptionsOrString<"system" | "system.annotations" | "system.changelog" | "system.diagrams" | "system.diff" | "system.explanations" | "system.files" | "system.files_schema" | "system.fs_find_files" | "system.fs_read_file" | "system.fs_read_summary" | "system.functions" | "system.math" | "system.python" | "system.python_interpreter" | "system.retrieval_fuzz_search" | "system.retrieval_vector_search" | "system.retrieval_web_search" | "system.schema" | "system.tasks" | "system.technical" | "system.typescript" | "system.zero_shot_cot"> +type SystemPromptId = OptionsOrString<"system" | "system.annotations" | "system.changelog" | "system.diagrams" | "system.diff" | "system.explanations" | "system.files" | "system.files_schema" | "system.fs_find_files" | "system.fs_read_file" | "system.fs_read_summary" | "system.functions" | "system.math" | "system.python" | "system.python_code_interpreter" | "system.retrieval_fuzz_search" | "system.retrieval_vector_search" | "system.retrieval_web_search" | "system.schema" | "system.tasks" | "system.technical" | "system.typescript" | "system.zero_shot_cot"> -type SystemToolId = OptionsOrString<"fs_find_files" | "fs_read_file" | "fs_read_summary" | "math_eval" | "python_interpreter" | "retrieval_fuzz_search" | "retrieval_vector_search" | "retrieval_web_search"> +type SystemToolId = OptionsOrString<"fs_find_files" | "fs_read_file" | "fs_read_summary" | "math_eval" | "python_code_interpreter" | "retrieval_fuzz_search" | "retrieval_vector_search" | "retrieval_web_search"> type FileMergeHandler = ( filename: string, @@ -212,7 +212,7 @@ interface ScriptRuntimeOptions { * - `system.functions`: use functions * - `system.math`: Math expression evaluator * - `system.python`: Expert at generating and understanding Python code. -* - `system.python_interpreter`: Python Dockerized code execution +* - `system.python_code_interpreter`: Python Dockerized code execution for data analysis * - `system.retrieval_fuzz_search`: Full Text Fuzzy Search * - `system.retrieval_vector_search`: Embeddings Vector Search * - `system.retrieval_web_search`: Web Search @@ -233,7 +233,7 @@ interface ScriptRuntimeOptions { * - `fs_read_file`: Reads a file as text from the file system. * - `fs_read_summary`: Reads a summary of a file from the file system. * - `math_eval`: Evaluates a math expression -* - `python_interpreter`: Executes python 3.12 code in a docker container. The process output is returned. Use 'print' to output data. +* - `python_code_interpreter`: Executes python 3.12 code for Data Analysis tasks in a docker container. The process output is returned. Do not generate visualizations. The only packages available are numpy, pandas, scipy. There is NO network connectivity. Do not attempt to install other packages or make web requests. * - `retrieval_fuzz_search`: Search for keywords using the full text of files and a fuzzy distance. * - `retrieval_vector_search`: Search files using embeddings and similarity distance. * - `retrieval_web_search`: Search the web for a user query using Bing Search. @@ -1631,6 +1631,11 @@ interface ContainerHost extends ShellHost { * Stops and cleans out the container */ stop(): Promise + + /** + * Force disconnect network + */ + disconnect(): Promise } interface PromptContext extends ChatGenerationContext { diff --git a/packages/sample/src/errors/genaiscript.d.ts b/packages/sample/src/errors/genaiscript.d.ts index 8fccf3c5fa..51ae8b5f0f 100644 --- a/packages/sample/src/errors/genaiscript.d.ts +++ b/packages/sample/src/errors/genaiscript.d.ts @@ -67,9 +67,9 @@ interface PromptLike extends PromptDefinition { text?: string } -type SystemPromptId = OptionsOrString<"system" | "system.annotations" | "system.changelog" | "system.diagrams" | "system.diff" | "system.explanations" | "system.files" | "system.files_schema" | "system.fs_find_files" | "system.fs_read_file" | "system.fs_read_summary" | "system.functions" | "system.math" | "system.python" | "system.python_interpreter" | "system.retrieval_fuzz_search" | "system.retrieval_vector_search" | "system.retrieval_web_search" | "system.schema" | "system.tasks" | "system.technical" | "system.typescript" | "system.zero_shot_cot"> +type SystemPromptId = OptionsOrString<"system" | "system.annotations" | "system.changelog" | "system.diagrams" | "system.diff" | "system.explanations" | "system.files" | "system.files_schema" | "system.fs_find_files" | "system.fs_read_file" | "system.fs_read_summary" | "system.functions" | "system.math" | "system.python" | "system.python_code_interpreter" | "system.retrieval_fuzz_search" | "system.retrieval_vector_search" | "system.retrieval_web_search" | "system.schema" | "system.tasks" | "system.technical" | "system.typescript" | "system.zero_shot_cot"> -type SystemToolId = OptionsOrString<"fs_find_files" | "fs_read_file" | "fs_read_summary" | "math_eval" | "python_interpreter" | "retrieval_fuzz_search" | "retrieval_vector_search" | "retrieval_web_search"> +type SystemToolId = OptionsOrString<"fs_find_files" | "fs_read_file" | "fs_read_summary" | "math_eval" | "python_code_interpreter" | "retrieval_fuzz_search" | "retrieval_vector_search" | "retrieval_web_search"> type FileMergeHandler = ( filename: string, @@ -212,7 +212,7 @@ interface ScriptRuntimeOptions { * - `system.functions`: use functions * - `system.math`: Math expression evaluator * - `system.python`: Expert at generating and understanding Python code. -* - `system.python_interpreter`: Python Dockerized code execution +* - `system.python_code_interpreter`: Python Dockerized code execution for data analysis * - `system.retrieval_fuzz_search`: Full Text Fuzzy Search * - `system.retrieval_vector_search`: Embeddings Vector Search * - `system.retrieval_web_search`: Web Search @@ -233,7 +233,7 @@ interface ScriptRuntimeOptions { * - `fs_read_file`: Reads a file as text from the file system. * - `fs_read_summary`: Reads a summary of a file from the file system. * - `math_eval`: Evaluates a math expression -* - `python_interpreter`: Executes python 3.12 code in a docker container. The process output is returned. Use 'print' to output data. +* - `python_code_interpreter`: Executes python 3.12 code for Data Analysis tasks in a docker container. The process output is returned. Do not generate visualizations. The only packages available are numpy, pandas, scipy. There is NO network connectivity. Do not attempt to install other packages or make web requests. * - `retrieval_fuzz_search`: Search for keywords using the full text of files and a fuzzy distance. * - `retrieval_vector_search`: Search files using embeddings and similarity distance. * - `retrieval_web_search`: Search the web for a user query using Bing Search. @@ -1631,6 +1631,11 @@ interface ContainerHost extends ShellHost { * Stops and cleans out the container */ stop(): Promise + + /** + * Force disconnect network + */ + disconnect(): Promise } interface PromptContext extends ChatGenerationContext { diff --git a/packages/sample/src/makecode/genaiscript.d.ts b/packages/sample/src/makecode/genaiscript.d.ts index 8fccf3c5fa..51ae8b5f0f 100644 --- a/packages/sample/src/makecode/genaiscript.d.ts +++ b/packages/sample/src/makecode/genaiscript.d.ts @@ -67,9 +67,9 @@ interface PromptLike extends PromptDefinition { text?: string } -type SystemPromptId = OptionsOrString<"system" | "system.annotations" | "system.changelog" | "system.diagrams" | "system.diff" | "system.explanations" | "system.files" | "system.files_schema" | "system.fs_find_files" | "system.fs_read_file" | "system.fs_read_summary" | "system.functions" | "system.math" | "system.python" | "system.python_interpreter" | "system.retrieval_fuzz_search" | "system.retrieval_vector_search" | "system.retrieval_web_search" | "system.schema" | "system.tasks" | "system.technical" | "system.typescript" | "system.zero_shot_cot"> +type SystemPromptId = OptionsOrString<"system" | "system.annotations" | "system.changelog" | "system.diagrams" | "system.diff" | "system.explanations" | "system.files" | "system.files_schema" | "system.fs_find_files" | "system.fs_read_file" | "system.fs_read_summary" | "system.functions" | "system.math" | "system.python" | "system.python_code_interpreter" | "system.retrieval_fuzz_search" | "system.retrieval_vector_search" | "system.retrieval_web_search" | "system.schema" | "system.tasks" | "system.technical" | "system.typescript" | "system.zero_shot_cot"> -type SystemToolId = OptionsOrString<"fs_find_files" | "fs_read_file" | "fs_read_summary" | "math_eval" | "python_interpreter" | "retrieval_fuzz_search" | "retrieval_vector_search" | "retrieval_web_search"> +type SystemToolId = OptionsOrString<"fs_find_files" | "fs_read_file" | "fs_read_summary" | "math_eval" | "python_code_interpreter" | "retrieval_fuzz_search" | "retrieval_vector_search" | "retrieval_web_search"> type FileMergeHandler = ( filename: string, @@ -212,7 +212,7 @@ interface ScriptRuntimeOptions { * - `system.functions`: use functions * - `system.math`: Math expression evaluator * - `system.python`: Expert at generating and understanding Python code. -* - `system.python_interpreter`: Python Dockerized code execution +* - `system.python_code_interpreter`: Python Dockerized code execution for data analysis * - `system.retrieval_fuzz_search`: Full Text Fuzzy Search * - `system.retrieval_vector_search`: Embeddings Vector Search * - `system.retrieval_web_search`: Web Search @@ -233,7 +233,7 @@ interface ScriptRuntimeOptions { * - `fs_read_file`: Reads a file as text from the file system. * - `fs_read_summary`: Reads a summary of a file from the file system. * - `math_eval`: Evaluates a math expression -* - `python_interpreter`: Executes python 3.12 code in a docker container. The process output is returned. Use 'print' to output data. +* - `python_code_interpreter`: Executes python 3.12 code for Data Analysis tasks in a docker container. The process output is returned. Do not generate visualizations. The only packages available are numpy, pandas, scipy. There is NO network connectivity. Do not attempt to install other packages or make web requests. * - `retrieval_fuzz_search`: Search for keywords using the full text of files and a fuzzy distance. * - `retrieval_vector_search`: Search files using embeddings and similarity distance. * - `retrieval_web_search`: Search the web for a user query using Bing Search. @@ -1631,6 +1631,11 @@ interface ContainerHost extends ShellHost { * Stops and cleans out the container */ stop(): Promise + + /** + * Force disconnect network + */ + disconnect(): Promise } interface PromptContext extends ChatGenerationContext { diff --git a/packages/sample/src/tla/genaiscript.d.ts b/packages/sample/src/tla/genaiscript.d.ts index 8fccf3c5fa..51ae8b5f0f 100644 --- a/packages/sample/src/tla/genaiscript.d.ts +++ b/packages/sample/src/tla/genaiscript.d.ts @@ -67,9 +67,9 @@ interface PromptLike extends PromptDefinition { text?: string } -type SystemPromptId = OptionsOrString<"system" | "system.annotations" | "system.changelog" | "system.diagrams" | "system.diff" | "system.explanations" | "system.files" | "system.files_schema" | "system.fs_find_files" | "system.fs_read_file" | "system.fs_read_summary" | "system.functions" | "system.math" | "system.python" | "system.python_interpreter" | "system.retrieval_fuzz_search" | "system.retrieval_vector_search" | "system.retrieval_web_search" | "system.schema" | "system.tasks" | "system.technical" | "system.typescript" | "system.zero_shot_cot"> +type SystemPromptId = OptionsOrString<"system" | "system.annotations" | "system.changelog" | "system.diagrams" | "system.diff" | "system.explanations" | "system.files" | "system.files_schema" | "system.fs_find_files" | "system.fs_read_file" | "system.fs_read_summary" | "system.functions" | "system.math" | "system.python" | "system.python_code_interpreter" | "system.retrieval_fuzz_search" | "system.retrieval_vector_search" | "system.retrieval_web_search" | "system.schema" | "system.tasks" | "system.technical" | "system.typescript" | "system.zero_shot_cot"> -type SystemToolId = OptionsOrString<"fs_find_files" | "fs_read_file" | "fs_read_summary" | "math_eval" | "python_interpreter" | "retrieval_fuzz_search" | "retrieval_vector_search" | "retrieval_web_search"> +type SystemToolId = OptionsOrString<"fs_find_files" | "fs_read_file" | "fs_read_summary" | "math_eval" | "python_code_interpreter" | "retrieval_fuzz_search" | "retrieval_vector_search" | "retrieval_web_search"> type FileMergeHandler = ( filename: string, @@ -212,7 +212,7 @@ interface ScriptRuntimeOptions { * - `system.functions`: use functions * - `system.math`: Math expression evaluator * - `system.python`: Expert at generating and understanding Python code. -* - `system.python_interpreter`: Python Dockerized code execution +* - `system.python_code_interpreter`: Python Dockerized code execution for data analysis * - `system.retrieval_fuzz_search`: Full Text Fuzzy Search * - `system.retrieval_vector_search`: Embeddings Vector Search * - `system.retrieval_web_search`: Web Search @@ -233,7 +233,7 @@ interface ScriptRuntimeOptions { * - `fs_read_file`: Reads a file as text from the file system. * - `fs_read_summary`: Reads a summary of a file from the file system. * - `math_eval`: Evaluates a math expression -* - `python_interpreter`: Executes python 3.12 code in a docker container. The process output is returned. Use 'print' to output data. +* - `python_code_interpreter`: Executes python 3.12 code for Data Analysis tasks in a docker container. The process output is returned. Do not generate visualizations. The only packages available are numpy, pandas, scipy. There is NO network connectivity. Do not attempt to install other packages or make web requests. * - `retrieval_fuzz_search`: Search for keywords using the full text of files and a fuzzy distance. * - `retrieval_vector_search`: Search files using embeddings and similarity distance. * - `retrieval_web_search`: Search the web for a user query using Bing Search. @@ -1631,6 +1631,11 @@ interface ContainerHost extends ShellHost { * Stops and cleans out the container */ stop(): Promise + + /** + * Force disconnect network + */ + disconnect(): Promise } interface PromptContext extends ChatGenerationContext { diff --git a/packages/sample/src/vision/genaiscript.d.ts b/packages/sample/src/vision/genaiscript.d.ts index 8fccf3c5fa..51ae8b5f0f 100644 --- a/packages/sample/src/vision/genaiscript.d.ts +++ b/packages/sample/src/vision/genaiscript.d.ts @@ -67,9 +67,9 @@ interface PromptLike extends PromptDefinition { text?: string } -type SystemPromptId = OptionsOrString<"system" | "system.annotations" | "system.changelog" | "system.diagrams" | "system.diff" | "system.explanations" | "system.files" | "system.files_schema" | "system.fs_find_files" | "system.fs_read_file" | "system.fs_read_summary" | "system.functions" | "system.math" | "system.python" | "system.python_interpreter" | "system.retrieval_fuzz_search" | "system.retrieval_vector_search" | "system.retrieval_web_search" | "system.schema" | "system.tasks" | "system.technical" | "system.typescript" | "system.zero_shot_cot"> +type SystemPromptId = OptionsOrString<"system" | "system.annotations" | "system.changelog" | "system.diagrams" | "system.diff" | "system.explanations" | "system.files" | "system.files_schema" | "system.fs_find_files" | "system.fs_read_file" | "system.fs_read_summary" | "system.functions" | "system.math" | "system.python" | "system.python_code_interpreter" | "system.retrieval_fuzz_search" | "system.retrieval_vector_search" | "system.retrieval_web_search" | "system.schema" | "system.tasks" | "system.technical" | "system.typescript" | "system.zero_shot_cot"> -type SystemToolId = OptionsOrString<"fs_find_files" | "fs_read_file" | "fs_read_summary" | "math_eval" | "python_interpreter" | "retrieval_fuzz_search" | "retrieval_vector_search" | "retrieval_web_search"> +type SystemToolId = OptionsOrString<"fs_find_files" | "fs_read_file" | "fs_read_summary" | "math_eval" | "python_code_interpreter" | "retrieval_fuzz_search" | "retrieval_vector_search" | "retrieval_web_search"> type FileMergeHandler = ( filename: string, @@ -212,7 +212,7 @@ interface ScriptRuntimeOptions { * - `system.functions`: use functions * - `system.math`: Math expression evaluator * - `system.python`: Expert at generating and understanding Python code. -* - `system.python_interpreter`: Python Dockerized code execution +* - `system.python_code_interpreter`: Python Dockerized code execution for data analysis * - `system.retrieval_fuzz_search`: Full Text Fuzzy Search * - `system.retrieval_vector_search`: Embeddings Vector Search * - `system.retrieval_web_search`: Web Search @@ -233,7 +233,7 @@ interface ScriptRuntimeOptions { * - `fs_read_file`: Reads a file as text from the file system. * - `fs_read_summary`: Reads a summary of a file from the file system. * - `math_eval`: Evaluates a math expression -* - `python_interpreter`: Executes python 3.12 code in a docker container. The process output is returned. Use 'print' to output data. +* - `python_code_interpreter`: Executes python 3.12 code for Data Analysis tasks in a docker container. The process output is returned. Do not generate visualizations. The only packages available are numpy, pandas, scipy. There is NO network connectivity. Do not attempt to install other packages or make web requests. * - `retrieval_fuzz_search`: Search for keywords using the full text of files and a fuzzy distance. * - `retrieval_vector_search`: Search files using embeddings and similarity distance. * - `retrieval_web_search`: Search the web for a user query using Bing Search. @@ -1631,6 +1631,11 @@ interface ContainerHost extends ShellHost { * Stops and cleans out the container */ stop(): Promise + + /** + * Force disconnect network + */ + disconnect(): Promise } interface PromptContext extends ChatGenerationContext { diff --git a/slides/genaisrc/genaiscript.d.ts b/slides/genaisrc/genaiscript.d.ts index 8fccf3c5fa..51ae8b5f0f 100644 --- a/slides/genaisrc/genaiscript.d.ts +++ b/slides/genaisrc/genaiscript.d.ts @@ -67,9 +67,9 @@ interface PromptLike extends PromptDefinition { text?: string } -type SystemPromptId = OptionsOrString<"system" | "system.annotations" | "system.changelog" | "system.diagrams" | "system.diff" | "system.explanations" | "system.files" | "system.files_schema" | "system.fs_find_files" | "system.fs_read_file" | "system.fs_read_summary" | "system.functions" | "system.math" | "system.python" | "system.python_interpreter" | "system.retrieval_fuzz_search" | "system.retrieval_vector_search" | "system.retrieval_web_search" | "system.schema" | "system.tasks" | "system.technical" | "system.typescript" | "system.zero_shot_cot"> +type SystemPromptId = OptionsOrString<"system" | "system.annotations" | "system.changelog" | "system.diagrams" | "system.diff" | "system.explanations" | "system.files" | "system.files_schema" | "system.fs_find_files" | "system.fs_read_file" | "system.fs_read_summary" | "system.functions" | "system.math" | "system.python" | "system.python_code_interpreter" | "system.retrieval_fuzz_search" | "system.retrieval_vector_search" | "system.retrieval_web_search" | "system.schema" | "system.tasks" | "system.technical" | "system.typescript" | "system.zero_shot_cot"> -type SystemToolId = OptionsOrString<"fs_find_files" | "fs_read_file" | "fs_read_summary" | "math_eval" | "python_interpreter" | "retrieval_fuzz_search" | "retrieval_vector_search" | "retrieval_web_search"> +type SystemToolId = OptionsOrString<"fs_find_files" | "fs_read_file" | "fs_read_summary" | "math_eval" | "python_code_interpreter" | "retrieval_fuzz_search" | "retrieval_vector_search" | "retrieval_web_search"> type FileMergeHandler = ( filename: string, @@ -212,7 +212,7 @@ interface ScriptRuntimeOptions { * - `system.functions`: use functions * - `system.math`: Math expression evaluator * - `system.python`: Expert at generating and understanding Python code. -* - `system.python_interpreter`: Python Dockerized code execution +* - `system.python_code_interpreter`: Python Dockerized code execution for data analysis * - `system.retrieval_fuzz_search`: Full Text Fuzzy Search * - `system.retrieval_vector_search`: Embeddings Vector Search * - `system.retrieval_web_search`: Web Search @@ -233,7 +233,7 @@ interface ScriptRuntimeOptions { * - `fs_read_file`: Reads a file as text from the file system. * - `fs_read_summary`: Reads a summary of a file from the file system. * - `math_eval`: Evaluates a math expression -* - `python_interpreter`: Executes python 3.12 code in a docker container. The process output is returned. Use 'print' to output data. +* - `python_code_interpreter`: Executes python 3.12 code for Data Analysis tasks in a docker container. The process output is returned. Do not generate visualizations. The only packages available are numpy, pandas, scipy. There is NO network connectivity. Do not attempt to install other packages or make web requests. * - `retrieval_fuzz_search`: Search for keywords using the full text of files and a fuzzy distance. * - `retrieval_vector_search`: Search files using embeddings and similarity distance. * - `retrieval_web_search`: Search the web for a user query using Bing Search. @@ -1631,6 +1631,11 @@ interface ContainerHost extends ShellHost { * Stops and cleans out the container */ stop(): Promise + + /** + * Force disconnect network + */ + disconnect(): Promise } interface PromptContext extends ChatGenerationContext {