diff --git a/docs/astro.config.mjs b/docs/astro.config.mjs index 9d5f2c1bf4..3e72c15373 100644 --- a/docs/astro.config.mjs +++ b/docs/astro.config.mjs @@ -24,14 +24,14 @@ export default defineConfig({ label: "Start Here", autogenerate: { directory: "getting-started" }, }, - { - label: "Guides", - autogenerate: { directory: "guides" }, - }, { label: "Case Studies", autogenerate: { directory: "case-studies" }, }, + { + label: "Guides", + autogenerate: { directory: "guides" }, + }, { label: "Reference", autogenerate: { directory: "reference" }, @@ -42,8 +42,8 @@ export default defineConfig({ }, { label: "Contributing", - link: "https://github.com/microsoft/genaiscript/blob/main/CONTRIBUTING.md" - } + link: "https://github.com/microsoft/genaiscript/blob/main/CONTRIBUTING.md", + }, ], }), ], diff --git a/docs/src/content/docs/index.mdx b/docs/src/content/docs/index.mdx index 36cd4b4e79..3e9a23093a 100644 --- a/docs/src/content/docs/index.mdx +++ b/docs/src/content/docs/index.mdx @@ -20,9 +20,11 @@ import { FileTree } from "@astrojs/starlight/components" // define the context def("FILE", env.files, { endsWith: ".pdf" }) // structure the data -const schema = defSchema("DATA", { type: "array", items: { type: "string" } }) +const schema = defSchema("DATA", + { type: "array", items: { type: "string" } }) // assign the task -$`Analyze FILE and extract data to JSON using the ${schema} schema.` +$`Analyze FILE and +extract data to JSON using the ${schema} schema.` ``` ## Next steps diff --git a/packages/cli/README.md b/packages/cli/README.md index 6727493e73..b998e36283 100644 --- a/packages/cli/README.md +++ b/packages/cli/README.md @@ -3,14 +3,14 @@ Scripting environment with convinient tooling for file ingestion, prompt development and structured data extraction. ```js -// metadata and model configuration -script({ title: "Title Extractor", model: "gpt4" }) // define the context def("FILE", env.files, { endsWith: ".pdf" }) // define the data -const chema = defSchema("DATA", { type: "array", items: { type: "string" } }) +const chema = defSchema("DATA", + { type: "array", items: { type: "string" } }) // define the task -$`Analyze FILE and extract titles to JSON compliant with ${schema}.` +$`Analyze FILE and + extract titles to JSON compliant with ${schema}.` ``` - **Read the online documentation at https://microsoft.github.io/genaiscript/** diff --git a/packages/core/src/clihelp.ts b/packages/core/src/clihelp.ts index 31e1c76019..f96cf333af 100644 --- a/packages/core/src/clihelp.ts +++ b/packages/core/src/clihelp.ts @@ -1,6 +1,6 @@ import { RunTemplateOptions } from "." import { Fragment } from "./ast" -import { GENAISCRIPT_CLI_JS } from "./constants" +import { GENAISCRIPT_CLI_JS, NPM_CLI_PACKAGE } from "./constants" import { MarkdownTrace } from "./trace" export function generateCliArguments( @@ -12,8 +12,9 @@ export function generateCliArguments( const { model, temperature, topP, seed, cliInfo } = options const cli = [ - "node", - GENAISCRIPT_CLI_JS, + "npx", + "--yes", + NPM_CLI_PACKAGE, command, template.id, `"${cliInfo.spec}"`, diff --git a/packages/core/src/constants.ts b/packages/core/src/constants.ts index a9ab937772..7a6cf96d4d 100644 --- a/packages/core/src/constants.ts +++ b/packages/core/src/constants.ts @@ -29,3 +29,4 @@ export const RETRIEVAL_DEFAULT_INDEX = "default" export const RETRIEVAL_DEFAULT_MODEL = "gpt-4" export const SYSTEM_FENCE = "---" export const MAX_DATA_REPAIRS = 1 +export const NPM_CLI_PACKAGE = "genaiscript-cli" \ No newline at end of file diff --git a/packages/vscode/README.md b/packages/vscode/README.md index 6727493e73..b998e36283 100644 --- a/packages/vscode/README.md +++ b/packages/vscode/README.md @@ -3,14 +3,14 @@ Scripting environment with convinient tooling for file ingestion, prompt development and structured data extraction. ```js -// metadata and model configuration -script({ title: "Title Extractor", model: "gpt4" }) // define the context def("FILE", env.files, { endsWith: ".pdf" }) // define the data -const chema = defSchema("DATA", { type: "array", items: { type: "string" } }) +const chema = defSchema("DATA", + { type: "array", items: { type: "string" } }) // define the task -$`Analyze FILE and extract titles to JSON compliant with ${schema}.` +$`Analyze FILE and + extract titles to JSON compliant with ${schema}.` ``` - **Read the online documentation at https://microsoft.github.io/genaiscript/**