From 237b43fe86e93da3f869540e0220f11fb1eacec3 Mon Sep 17 00:00:00 2001 From: Peli de Halleux Date: Fri, 18 Apr 2025 17:13:13 +0000 Subject: [PATCH] typos --- .vscode/settings.json | 2 ++ .../cli/genaisrc/system.annotations.genai.mts | 2 +- slides/pages/script-intro.md | 34 +++++++++++++------ 3 files changed, 26 insertions(+), 12 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 8067945b1f..82eccd0b32 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -79,6 +79,7 @@ "gitmoji", "GROQ", "Gruber", + "Halleux", "hostconfiguration", "hostpath", "htmlescape", @@ -169,6 +170,7 @@ "scriptquickpick", "secretscanner", "sglang", + "shiki", "sidenote", "skia", "Smol", diff --git a/packages/cli/genaisrc/system.annotations.genai.mts b/packages/cli/genaisrc/system.annotations.genai.mts index baf26c5220..5bb8efae82 100644 --- a/packages/cli/genaisrc/system.annotations.genai.mts +++ b/packages/cli/genaisrc/system.annotations.genai.mts @@ -20,7 +20,7 @@ For example, an warning in main.py on line 3 with message "There seems to be a t For example, an error in app.js between line 1 and 4 with message "Missing semicolon" and a warning in index.ts on line 10, would be: ::error file=app.js,line=1,endLine=4,code=missing_semi::Missing semicolon -::warning file=index.ts,line=10,endLine=10,code=identation::erroneous identation +::warning file=index.ts,line=10,endLine=10,code=indentation::erroneous indentation - Do NOT indent or place annotation in a code fence. - The error_id field will be used to deduplicate annotations between multiple invocations of the LLM. diff --git a/slides/pages/script-intro.md b/slides/pages/script-intro.md index 1b43e081f2..451a5a539a 100644 --- a/slides/pages/script-intro.md +++ b/slides/pages/script-intro.md @@ -2,29 +2,41 @@ layout: two-cols --- -## GenAIScript Introduction +# GenAIScript +## Scripts your LLMs Each GenAIScript is JavaScript that defines a call/return to an LLM -- Define context for the LLM using \ -`def` (from code, docs, URLs, images, etc) -- Describe the task you want in `$` prompt -- Send the request to the LLM -- Process the output of the LLM +- `def` is for context +- `$` is for instructions + +GenAIScript +- Optimizes context for LLM +- Send request to LLM +- Process LLM output +   ::right:: ## Example +- `summarizer.genai.mts` + ```js // metadata and model configuration -script({ title: "Summarize", model: "gpt4" }) +script({ model: "small", accept: ".txt" }) // insert the context, define a "FILE" variable def("FILE", env.files) -def("FILE", await workspace.findFile("**/*.txt")) -// appends text to the prompt (file is the variable name) -$`Summarize FILE. Save output to summary.txt` -``` \ No newline at end of file +// $ appends text to the prompt +$`Summarize .` +``` + +- execute on all .txt files +```sh +genaiscript run summarizer **.txt +``` + +https://microsoft.github.io/genaiscript