diff --git a/docs/src/content/docs/getting-started/configuration.mdx b/docs/src/content/docs/getting-started/configuration.mdx index b56918412c..3400be712e 100644 --- a/docs/src/content/docs/getting-started/configuration.mdx +++ b/docs/src/content/docs/getting-started/configuration.mdx @@ -50,7 +50,13 @@ script({ model: "small" }) script({ model: "large" }) ``` -The model can also be overriden from the [cli run command](/genaiscript/reference/cli/run#model). +The model can also be overriden from the [cli run command](/genaiscript/reference/cli/run#model) +or by adding the `GENAISCRIPT_DEFAULT_MODEL` and `GENAISCRIPT_DEFAULT_SMALL_MODEL` environment variables. + +```txt title=".env" +GENAISCRIPT_DEFAULT_MODEL="azure_serverless:..." +GENAISCRIPT_DEFAULT_SMALL_MODEL="azure_serverless:..." +``` ## `.env` file diff --git a/docs/src/content/docs/reference/cli/commands.md b/docs/src/content/docs/reference/cli/commands.md index 9dc9f35c0a..6dec5e5426 100644 --- a/docs/src/content/docs/reference/cli/commands.md +++ b/docs/src/content/docs/reference/cli/commands.md @@ -81,8 +81,8 @@ Arguments: Options: --models models to test where mode is the key - value pair list of m (model), t - (temperature), p (top-p) + value pair list of m (model), s (small + model), t (temperature), p (top-p) -o, --out output folder -rmo, --remove-out remove output folder if it exists --cli override path to the cli diff --git a/packages/cli/src/cli.ts b/packages/cli/src/cli.ts index 4dd27df9ba..f4f0e7530d 100644 --- a/packages/cli/src/cli.ts +++ b/packages/cli/src/cli.ts @@ -185,7 +185,7 @@ export async function cli() { ) .option( "--models ", - "models to test where mode is the key value pair list of m (model), t (temperature), p (top-p)" + "models to test where mode is the key value pair list of m (model), s (small model), t (temperature), p (top-p)" ) .option("-o, --out ", "output folder") .option("-rmo, --remove-out", "remove output folder if it exists") diff --git a/packages/cli/src/test.ts b/packages/cli/src/test.ts index 3ffaa7b4be..0e7662ed1b 100644 --- a/packages/cli/src/test.ts +++ b/packages/cli/src/test.ts @@ -47,10 +47,20 @@ import { delay } from "es-toolkit" * @returns A ModelOptions object with model, temperature, and topP fields if applicable. */ function parseModelSpec(m: string): ModelOptions { - const values = parseKeyValuePairs(m) + const values = m + .split(/&/g) + .map((kv) => kv.split("=", 2)) + .reduce( + (acc, [key, value]) => { + acc[key] = decodeURIComponent(value) + return acc + }, + {} as Record + ) if (Object.keys(values).length > 1) return { model: values["m"], + smallModel: values["s"], temperature: normalizeFloat(values["t"]), topP: normalizeFloat(values["p"]), } diff --git a/packages/core/src/genaiscript-api-provider.mjs b/packages/core/src/genaiscript-api-provider.mjs index 76040f1be0..e951e21e07 100644 --- a/packages/core/src/genaiscript-api-provider.mjs +++ b/packages/core/src/genaiscript-api-provider.mjs @@ -22,7 +22,7 @@ class GenAIScriptApiProvider { } async callApi(prompt, context) { - const { model, temperature, top_p, cache, version, cli, quiet } = + const { model, smallModel, temperature, top_p, cache, version, cli, quiet } = this.config const { vars, logger } = context try { @@ -51,6 +51,7 @@ class GenAIScriptApiProvider { args.push("--json") if (quiet) args.push("--quiet") if (model) args.push("--model", model) + if (smallModel) args.push("--small-model", smallModel) if (temperature !== undefined) args.push("--temperature", temperature) if (top_p !== undefined) args.push("--top_p", top_p) diff --git a/packages/core/src/test.ts b/packages/core/src/test.ts index 2df8c2efa4..42b936596c 100644 --- a/packages/core/src/test.ts +++ b/packages/core/src/test.ts @@ -59,17 +59,19 @@ export function generatePromptFooConfiguration( prompts: [id], // Map model options to providers providers: models - .map(({ model, temperature, topP }) => ({ + .map(({ model, smallModel, temperature, topP }) => ({ model: model ?? host.defaultModelOptions.model, + smallModel: smallModel ?? host.defaultModelOptions.smallModel, temperature: !isNaN(temperature) ? temperature : host.defaultModelOptions.temperature, top_p: topP, })) - .map(({ model, temperature, top_p }) => ({ + .map(({ model, smallModel, temperature, top_p }) => ({ id: provider, label: [ model, + smallModel, `t=${temperature}`, top_p !== undefined ? `p=${top_p}` : undefined, ] @@ -77,6 +79,7 @@ export function generatePromptFooConfiguration( .join(":"), config: { model, + smallModel, temperature, top_p, cli, diff --git a/packages/core/src/types/prompt_template.d.ts b/packages/core/src/types/prompt_template.d.ts index 9493ac513e..df15d1cd16 100644 --- a/packages/core/src/types/prompt_template.d.ts +++ b/packages/core/src/types/prompt_template.d.ts @@ -131,7 +131,9 @@ interface ModelConnectionOptions { * @default gpt-4 * @example gpt-4 */ - smallModel?: OptionsOrString<"openai:gpt-4o-mini" | "openai:gpt-3.5-turbo"> + smallModel?: OptionsOrString< + "openai:gpt-4o-mini" | "openai:gpt-3.5-turbo" | "azure:gpt-4o-mini" + > } interface ModelOptions extends ModelConnectionOptions { diff --git a/packages/sample/genaisrc/blog-generate-knowledge.genai.js b/packages/sample/genaisrc/blog-generate-knowledge.genai.js index 731f9c18c4..a5fb8f4776 100644 --- a/packages/sample/genaisrc/blog-generate-knowledge.genai.js +++ b/packages/sample/genaisrc/blog-generate-knowledge.genai.js @@ -1,6 +1,6 @@ script({ title: "blog using generated knowledge", - model: "openai:gpt-3.5-turbo", + model: "small", description: "Using Generated Knowledge technique. More at https://learnprompting.org/docs/intermediate/generated_knowledge", tests: { diff --git a/packages/sample/genaisrc/console-eval.genai.js b/packages/sample/genaisrc/console-eval.genai.js index 46806d90da..044c213d70 100644 --- a/packages/sample/genaisrc/console-eval.genai.js +++ b/packages/sample/genaisrc/console-eval.genai.js @@ -1,5 +1,5 @@ script({ - model: "openai:gpt-3.5-turbo", + model: "small", tests: {}, }) diff --git a/packages/sample/genaisrc/csv.genai.mjs b/packages/sample/genaisrc/csv.genai.mjs index bbc81acfcf..7cbb109479 100644 --- a/packages/sample/genaisrc/csv.genai.mjs +++ b/packages/sample/genaisrc/csv.genai.mjs @@ -1,7 +1,7 @@ script({ files: "src/penguins.csv", tests: {}, - model: "openai:gpt-3.5-turbo", + model: "small", }) def("DATA", env.files, { sliceSample: 3 }) @@ -18,9 +18,9 @@ const srows = CSV.parse( `A|1 B|2 C|3`, - { delimiter: ",", headers: ["name", "value"] } + { delimiter: "|", headers: ["name", "value"] } ) -console.log(srows) +console.log({ srows }) if ( JSON.stringify(srows) === JSON.stringify([ diff --git a/packages/sample/genaisrc/defdata.genai.mjs b/packages/sample/genaisrc/defdata.genai.mjs index 6438cbdeb7..65fe9b8251 100644 --- a/packages/sample/genaisrc/defdata.genai.mjs +++ b/packages/sample/genaisrc/defdata.genai.mjs @@ -1,6 +1,6 @@ script({ title: "defData demo", - model: "openai:gpt-3.5-turbo", + model: "small", tests: { }, system: ["system"] diff --git a/packages/sample/genaisrc/defschema.genai.js b/packages/sample/genaisrc/defschema.genai.js index 18d36240bd..3fd39c4085 100644 --- a/packages/sample/genaisrc/defschema.genai.js +++ b/packages/sample/genaisrc/defschema.genai.js @@ -1,6 +1,6 @@ script({ tests: {}, - model: "openai:gpt-3.5-turbo", + model: "small", files: "src/cities.md" }) diff --git a/packages/sample/genaisrc/describe-image-run-prompt.genai.js b/packages/sample/genaisrc/describe-image-run-prompt.genai.js index 0b82e115d4..ba7c0093d5 100644 --- a/packages/sample/genaisrc/describe-image-run-prompt.genai.js +++ b/packages/sample/genaisrc/describe-image-run-prompt.genai.js @@ -1,6 +1,6 @@ script({ title: "Describe objects in each image", - model: "openai:gpt-3.5-turbo", + model: "small", group: "vision", maxTokens: 4000, system: [], diff --git a/packages/sample/genaisrc/diagrams.genai.mts b/packages/sample/genaisrc/diagrams.genai.mts index 42a64b81c1..81ee2344a6 100644 --- a/packages/sample/genaisrc/diagrams.genai.mts +++ b/packages/sample/genaisrc/diagrams.genai.mts @@ -1,5 +1,5 @@ script({ - model: "openai:gpt-3.5-turbo", + model: "small", tests: {}, }) $`Generate a diagram of a merge.` diff --git a/packages/sample/genaisrc/exec.genai.mjs b/packages/sample/genaisrc/exec.genai.mjs index 25bca271d7..5ca7916b6a 100644 --- a/packages/sample/genaisrc/exec.genai.mjs +++ b/packages/sample/genaisrc/exec.genai.mjs @@ -1,5 +1,5 @@ script({ - model: "openai:gpt-3.5-turbo", + model: "small", tests: { keywords: ["Python", "3."], }, diff --git a/packages/sample/genaisrc/fetch.genai.js b/packages/sample/genaisrc/fetch.genai.js index f83d9f5d44..ded696b053 100644 --- a/packages/sample/genaisrc/fetch.genai.js +++ b/packages/sample/genaisrc/fetch.genai.js @@ -1,5 +1,5 @@ script({ - model: "openai:gpt-3.5-turbo", + model: "small", tests: { keywords: "genaiscript", }, diff --git a/packages/sample/genaisrc/fileoutput.genai.mts b/packages/sample/genaisrc/fileoutput.genai.mts index dd7b39f05f..9110b53bb1 100644 --- a/packages/sample/genaisrc/fileoutput.genai.mts +++ b/packages/sample/genaisrc/fileoutput.genai.mts @@ -1,6 +1,6 @@ script({ title: "summarize all files", - model: "openai:gpt-3.5-turbo", + model: "small", files: "src/rag/markdown.md", tests: [ { diff --git a/packages/sample/genaisrc/flex.genai.mts b/packages/sample/genaisrc/flex.genai.mts index 92c6d00d99..fc1423e168 100644 --- a/packages/sample/genaisrc/flex.genai.mts +++ b/packages/sample/genaisrc/flex.genai.mts @@ -1,5 +1,5 @@ script({ - model: "openai:gpt-3.5-turbo", + model: "small", files: ["src/rag/markdown.md"], system: [], flexTokens: 20, diff --git a/packages/sample/genaisrc/fs.genai.mjs b/packages/sample/genaisrc/fs.genai.mjs index 5bf415a1ba..ebb0926705 100644 --- a/packages/sample/genaisrc/fs.genai.mjs +++ b/packages/sample/genaisrc/fs.genai.mjs @@ -1,5 +1,5 @@ script({ - model: "openai:gpt-3.5-turbo", + model: "small", tools: ["fs"], tests: {}, }) diff --git a/packages/sample/genaisrc/fuzz-search.genai.js b/packages/sample/genaisrc/fuzz-search.genai.js index bff374a160..ec9c6fa1fd 100644 --- a/packages/sample/genaisrc/fuzz-search.genai.js +++ b/packages/sample/genaisrc/fuzz-search.genai.js @@ -1,6 +1,6 @@ script({ title: "fuzz search", - model: "openai:gpt-3.5-turbo", + model: "small", tests: {}, }) const kw = (env.vars.keyword || "defdata") + "" diff --git a/packages/sample/genaisrc/gcc-container.genai.js b/packages/sample/genaisrc/gcc-container.genai.js index d39b7fa842..8651ed8593 100644 --- a/packages/sample/genaisrc/gcc-container.genai.js +++ b/packages/sample/genaisrc/gcc-container.genai.js @@ -1,5 +1,5 @@ script({ - model: "openai:gpt-3.5-turbo", + model: "small", }) const container = await host.container({ image: "gcc", diff --git a/packages/sample/genaisrc/git-history.genai.mts b/packages/sample/genaisrc/git-history.genai.mts index 6186c528f3..645fa9d6ae 100644 --- a/packages/sample/genaisrc/git-history.genai.mts +++ b/packages/sample/genaisrc/git-history.genai.mts @@ -1,5 +1,5 @@ script({ - model: "openai:gpt-3.5-turbo", + model: "small", title: "git-history", tests: {} }) const author = env.vars.author as string || "pelikhan" diff --git a/packages/sample/genaisrc/github.genai.mts b/packages/sample/genaisrc/github.genai.mts index b1ecb204a1..14064fe394 100644 --- a/packages/sample/genaisrc/github.genai.mts +++ b/packages/sample/genaisrc/github.genai.mts @@ -1,5 +1,5 @@ script({ - model: "openai:gpt-3.5-turbo", + model: "small", tests: {}, }) diff --git a/packages/sample/genaisrc/html.genai.mjs b/packages/sample/genaisrc/html.genai.mjs index e427dbe2bd..e43f8f12ed 100644 --- a/packages/sample/genaisrc/html.genai.mjs +++ b/packages/sample/genaisrc/html.genai.mjs @@ -1,5 +1,5 @@ script({ - model: "openai:gpt-3.5-turbo", + model: "small", title: "HTML to Text", tests: {}, }) diff --git a/packages/sample/genaisrc/import-template.genai.mts b/packages/sample/genaisrc/import-template.genai.mts index b1d92e6f8c..a563c9edb2 100644 --- a/packages/sample/genaisrc/import-template.genai.mts +++ b/packages/sample/genaisrc/import-template.genai.mts @@ -1,5 +1,5 @@ script({ - model: "openai:gpt-3.5-turbo", + model: "small", tests: { keywords: ["paris", "abracadabra"], }, diff --git a/packages/sample/genaisrc/json_object.genai.mjs b/packages/sample/genaisrc/json_object.genai.mjs index 59b1187ebc..f8ff94df85 100644 --- a/packages/sample/genaisrc/json_object.genai.mjs +++ b/packages/sample/genaisrc/json_object.genai.mjs @@ -1,5 +1,5 @@ script({ - model: "openai:gpt-3.5-turbo", + model: "small", responseType: "json_object", responseSchema: { type: "object", diff --git a/packages/sample/genaisrc/json_object_ex.genai.mjs b/packages/sample/genaisrc/json_object_ex.genai.mjs index 5ee403b125..4d51f7cdf3 100644 --- a/packages/sample/genaisrc/json_object_ex.genai.mjs +++ b/packages/sample/genaisrc/json_object_ex.genai.mjs @@ -1,5 +1,5 @@ script({ - model: "openai:gpt-3.5-turbo", + model: "small", responseType: "json_object", responseSchema: { characters: [{ name: "neo", age: 30 }] }, tests: {}, diff --git a/packages/sample/genaisrc/llm-as-expert.genai.mts b/packages/sample/genaisrc/llm-as-expert.genai.mts index ee2ee5d67f..01a9d812bb 100644 --- a/packages/sample/genaisrc/llm-as-expert.genai.mts +++ b/packages/sample/genaisrc/llm-as-expert.genai.mts @@ -45,7 +45,7 @@ defTool( }, async ({ prompt }) => { const res = await env.generator.runPrompt(prompt, { - model: "openai:gpt-3.5-turbo", + model: "small", label: "llm-gpt35", }) return res.text diff --git a/packages/sample/genaisrc/math-agent-system.genai.js b/packages/sample/genaisrc/math-agent-system.genai.js index c9c4b55550..1f7fbb6d03 100644 --- a/packages/sample/genaisrc/math-agent-system.genai.js +++ b/packages/sample/genaisrc/math-agent-system.genai.js @@ -1,6 +1,6 @@ script({ title: "math-agent-system", - model: "openai:gpt-3.5-turbo", + model: "small", description: "A port of https://ts.llamaindex.ai/examples/agent", system: ["system.math"], parameters: { diff --git a/packages/sample/genaisrc/mjs.genai.mjs b/packages/sample/genaisrc/mjs.genai.mjs index 0e22ad3d9a..1b0856ee7d 100644 --- a/packages/sample/genaisrc/mjs.genai.mjs +++ b/packages/sample/genaisrc/mjs.genai.mjs @@ -1,6 +1,6 @@ script({ title: "top-level-mjs", - model: "openai:gpt-3.5-turbo", + model: "small", files: ["src/rag/markdown.md"], tests: { files: ["src/rag/markdown.md"], diff --git a/packages/sample/genaisrc/mts.genai.mts b/packages/sample/genaisrc/mts.genai.mts index 9d87aa73e5..ed3d062eea 100644 --- a/packages/sample/genaisrc/mts.genai.mts +++ b/packages/sample/genaisrc/mts.genai.mts @@ -1,6 +1,6 @@ script({ title: "top-level-ts", - model: "openai:gpt-3.5-turbo", + model: "small", files: ["src/rag/markdown.md"], tests: { files: ["src/rag/markdown.md"], diff --git a/packages/sample/genaisrc/multi-turn.genai.js b/packages/sample/genaisrc/multi-turn.genai.js index 449276bc08..946b671dcb 100644 --- a/packages/sample/genaisrc/multi-turn.genai.js +++ b/packages/sample/genaisrc/multi-turn.genai.js @@ -1,5 +1,5 @@ script({ - model: "openai:gpt-3.5-turbo", + model: "small", title: "Multi-turn conversation", files: ["src/rag/markdown.md"], system: ["system", "system.files"], diff --git a/packages/sample/genaisrc/nested-args.genai.mts b/packages/sample/genaisrc/nested-args.genai.mts index 24d340ebd9..e883be434a 100644 --- a/packages/sample/genaisrc/nested-args.genai.mts +++ b/packages/sample/genaisrc/nested-args.genai.mts @@ -1,6 +1,6 @@ script({ title: "summarize with nested arguments", - model: "openai:gpt-3.5-turbo", + model: "small", files: ["src/rag/markdown.md", "src/penguins.csv"], tests: [ { diff --git a/packages/sample/genaisrc/output.genai.js b/packages/sample/genaisrc/output.genai.js index b7d081c012..2c56a2da63 100644 --- a/packages/sample/genaisrc/output.genai.js +++ b/packages/sample/genaisrc/output.genai.js @@ -1,5 +1,5 @@ script({ - model: "openai:gpt-3.5-turbo", + model: "small", title: "custom output", files: "src/rag/markdown.md", tests: { files: "src/rag/markdown.md" }, system: [], diff --git a/packages/sample/genaisrc/pdf-to-tweet.genai.js b/packages/sample/genaisrc/pdf-to-tweet.genai.js index 88926f7b0f..e3a441e7a3 100644 --- a/packages/sample/genaisrc/pdf-to-tweet.genai.js +++ b/packages/sample/genaisrc/pdf-to-tweet.genai.js @@ -1,5 +1,5 @@ script({ - model: "openai:gpt-3.5-turbo", + model: "small", title: "generate a tweet from a pdf file", tests: { files: "src/rag/loremipsum.pdf", diff --git a/packages/sample/genaisrc/rag.genai.js b/packages/sample/genaisrc/rag.genai.js index e4fc9b476f..e224482ae3 100644 --- a/packages/sample/genaisrc/rag.genai.js +++ b/packages/sample/genaisrc/rag.genai.js @@ -1,6 +1,6 @@ script({ title: "rag", - model: "openai:gpt-3.5-turbo", + model: "small", files: "src/rag/*", tests: { files: "src/rag/*", diff --git a/packages/sample/genaisrc/responseschema.genai.js b/packages/sample/genaisrc/responseschema.genai.js index 5b0be92fc2..666a0199a4 100644 --- a/packages/sample/genaisrc/responseschema.genai.js +++ b/packages/sample/genaisrc/responseschema.genai.js @@ -1,5 +1,5 @@ script({ - model: "openai:gpt-3.5-turbo", + model: "small", tests: { }, responseSchema: { diff --git a/packages/sample/genaisrc/run-prompt-summarize.genai.js b/packages/sample/genaisrc/run-prompt-summarize.genai.js index 5153b5b4ac..3f1d99e7c7 100644 --- a/packages/sample/genaisrc/run-prompt-summarize.genai.js +++ b/packages/sample/genaisrc/run-prompt-summarize.genai.js @@ -1,6 +1,6 @@ script({ title: "run prompt summarize", - model: "openai:gpt-3.5-turbo", + model: "small", tests: [ { files: ["src/rag/markdown.md"], diff --git a/packages/sample/genaisrc/script-files.genai.js b/packages/sample/genaisrc/script-files.genai.js index 94429704da..74f4739730 100644 --- a/packages/sample/genaisrc/script-files.genai.js +++ b/packages/sample/genaisrc/script-files.genai.js @@ -1,5 +1,5 @@ script({ - model: "openai:gpt-3.5-turbo", + model: "small", files: "src/rag/*.md", tests: {}, }) diff --git a/packages/sample/genaisrc/style/runprompt.genai.js b/packages/sample/genaisrc/style/runprompt.genai.js index 7267c688b1..9331e9df11 100644 --- a/packages/sample/genaisrc/style/runprompt.genai.js +++ b/packages/sample/genaisrc/style/runprompt.genai.js @@ -15,7 +15,7 @@ const resPoem = await runPrompt( _.$`write haiku poem` }, { - model: "openai:gpt-3.5-turbo", + model: "small", label: "generate poem", system: ["system"], } @@ -27,7 +27,7 @@ const resJSON = await runPrompt( _.$`generate 3 random numbers between 1 and 10 and respond in JSON` }, { - model: "openai:gpt-3.5-turbo", + model: "small", label: "generate json", responseType: "json_object", } diff --git a/packages/sample/genaisrc/summarize-files-function.genai.js b/packages/sample/genaisrc/summarize-files-function.genai.js index 9b13099c6c..b0995fb0a2 100644 --- a/packages/sample/genaisrc/summarize-files-function.genai.js +++ b/packages/sample/genaisrc/summarize-files-function.genai.js @@ -1,7 +1,7 @@ script({ title: "summarize-files-function", tools: ["fs"], - model: "openai:gpt-3.5-turbo", + model: "small", tests: { files: ["src/rag/*"], keywords: ["markdown", "lorem", "word"], diff --git a/packages/sample/genaisrc/summarize-import.genai.mjs b/packages/sample/genaisrc/summarize-import.genai.mjs index a2711e2963..3d6503cb7d 100644 --- a/packages/sample/genaisrc/summarize-import.genai.mjs +++ b/packages/sample/genaisrc/summarize-import.genai.mjs @@ -1,6 +1,6 @@ script({ title: "summarize all files using import", - model: "openai:gpt-3.5-turbo", + model: "small", tests: { files: ["src/rag/markdown.md"], keywords: "markdown", diff --git a/packages/sample/genaisrc/summarize-link.genai.js b/packages/sample/genaisrc/summarize-link.genai.js index d07f336407..720d79ca2c 100644 --- a/packages/sample/genaisrc/summarize-link.genai.js +++ b/packages/sample/genaisrc/summarize-link.genai.js @@ -1,6 +1,6 @@ script({ title: "summarize links", - model: "openai:gpt-3.5-turbo", + model: "small", description: "Given a URL, summarize the contents of the page", group: "hello world", system: ["system", "system.files"], diff --git a/packages/sample/genaisrc/summarize-max-tokens.genai.js b/packages/sample/genaisrc/summarize-max-tokens.genai.js index 63b7b4cb88..60bfa785ca 100644 --- a/packages/sample/genaisrc/summarize-max-tokens.genai.js +++ b/packages/sample/genaisrc/summarize-max-tokens.genai.js @@ -1,6 +1,6 @@ script({ title: "summarize with max tokens", - model: "openai:gpt-3.5-turbo", + model: "small", files: ["src/rag/*"], tests: { files: ["src/rag/*"], diff --git a/packages/sample/genaisrc/summarize-nested.genai.js b/packages/sample/genaisrc/summarize-nested.genai.js index 757cc7f67b..2d2cee86ae 100644 --- a/packages/sample/genaisrc/summarize-nested.genai.js +++ b/packages/sample/genaisrc/summarize-nested.genai.js @@ -1,6 +1,6 @@ script({ title: "summarize nested", - model: "openai:gpt-3.5-turbo", + model: "small", files: ["src/rag/*"], tests: { files: ["src/rag/*"], diff --git a/packages/sample/genaisrc/summarize-pdf.genai.js b/packages/sample/genaisrc/summarize-pdf.genai.js index 27ef8d4d04..21c8a5f2af 100644 --- a/packages/sample/genaisrc/summarize-pdf.genai.js +++ b/packages/sample/genaisrc/summarize-pdf.genai.js @@ -1,6 +1,6 @@ script({ title: "summarize pdf", - model: "openai:gpt-3.5-turbo", + model: "small", tests: { files: "src/rag/loremipsum.pdf", keywords: ["lorem", "ipsum"], diff --git a/packages/sample/genaisrc/summarize.genai.js b/packages/sample/genaisrc/summarize.genai.js index 812b38de8d..9b0f0367bb 100644 --- a/packages/sample/genaisrc/summarize.genai.js +++ b/packages/sample/genaisrc/summarize.genai.js @@ -1,6 +1,6 @@ script({ title: "summarize all files", - model: "openai:gpt-3.5-turbo", + model: "small", files: "src/rag/markdown.md", tests: [ { diff --git a/packages/sample/genaisrc/summary-of-summary-gpt35.genai.js b/packages/sample/genaisrc/summary-of-summary-gpt35.genai.js index 7597c81cdd..2229840392 100644 --- a/packages/sample/genaisrc/summary-of-summary-gpt35.genai.js +++ b/packages/sample/genaisrc/summary-of-summary-gpt35.genai.js @@ -1,6 +1,6 @@ script({ title: "summary of summary - gp35", - model: "openai:gpt-3.5-turbo", + model: "small", files: ["src/rag/*"], tests: { files: ["src/rag/*"], diff --git a/packages/sample/genaisrc/summary-of-summary-phi3.genai.js b/packages/sample/genaisrc/summary-of-summary-phi3.genai.js index bab0e6b18a..42f466e74f 100644 --- a/packages/sample/genaisrc/summary-of-summary-phi3.genai.js +++ b/packages/sample/genaisrc/summary-of-summary-phi3.genai.js @@ -1,5 +1,5 @@ script({ - model: "openai:gpt-3.5-turbo", + model: "small", title: "summary of summary - phi3", files: ["src/rag/*.md"], tests: { diff --git a/packages/sample/genaisrc/templating.genai.mts b/packages/sample/genaisrc/templating.genai.mts index c55c912864..31e48b8569 100644 --- a/packages/sample/genaisrc/templating.genai.mts +++ b/packages/sample/genaisrc/templating.genai.mts @@ -1,5 +1,5 @@ script({ - model: "openai:gpt-3.5-turbo", + model: "small", tests: { keywords: ["paris", "monday"], asserts: [ diff --git a/packages/sample/genaisrc/todo.genai.js b/packages/sample/genaisrc/todo.genai.js index a2d6407c09..4eb354d632 100644 --- a/packages/sample/genaisrc/todo.genai.js +++ b/packages/sample/genaisrc/todo.genai.js @@ -4,7 +4,7 @@ script({ group: "samples", system: ["system", "system.files"], temperature: 0, - model: "openai:gpt-3.5-turbo", + model: "small", tests: { files: "src/fib.ts", asserts: [{ diff --git a/packages/sample/genaisrc/tool-prompt.genai.js b/packages/sample/genaisrc/tool-prompt.genai.js index 3e8493920d..6efd5bc2f5 100644 --- a/packages/sample/genaisrc/tool-prompt.genai.js +++ b/packages/sample/genaisrc/tool-prompt.genai.js @@ -1,5 +1,5 @@ script({ - model: "openai:gpt-3.5-turbo", + model: "small", parameters: { topic: { type: "string", diff --git a/packages/sample/genaisrc/weather.genai.js b/packages/sample/genaisrc/weather.genai.js index 0f9b8e316a..76afd5f4f6 100644 --- a/packages/sample/genaisrc/weather.genai.js +++ b/packages/sample/genaisrc/weather.genai.js @@ -1,5 +1,5 @@ script({ - model: "openai:gpt-3.5-turbo", + model: "small", title: "Weather as function", description: "Query the weather for each city using a dummy weather function", diff --git a/packages/sample/genaisrc/workspace.genai.mjs b/packages/sample/genaisrc/workspace.genai.mjs index 3a650cbfb8..a61870b447 100644 --- a/packages/sample/genaisrc/workspace.genai.mjs +++ b/packages/sample/genaisrc/workspace.genai.mjs @@ -1,4 +1,4 @@ -script({ model: "openai:gpt-3.5-turbo", tests: {} }) +script({ model: "small", tests: {} }) const json = await workspace.readJSON("src/sample.json") if (json.foo !== "bar") throw new Error("Invalid JSON") const xml = await workspace.readXML("src/sample.xml") diff --git a/packages/sample/genaisrc/writefile.genai.js b/packages/sample/genaisrc/writefile.genai.js index 5dae6bf974..169bb8b29c 100644 --- a/packages/sample/genaisrc/writefile.genai.js +++ b/packages/sample/genaisrc/writefile.genai.js @@ -1,6 +1,6 @@ script({ tests: {}, - model: "openai:gpt-3.5-turbo", + model: "small", }) const fn = `temp/${Math.random() + ""}.txt` const content = JSON.stringify({ val: Math.random() + "" })