Skip to content

Commit

Permalink
πŸ”„ Update model to "small" in all script definitions πŸ’»
Browse files Browse the repository at this point in the history
  • Loading branch information
pelikhan committed Oct 17, 2024
1 parent 9775c66 commit ba1aa44
Show file tree
Hide file tree
Showing 52 changed files with 58 additions and 55 deletions.
4 changes: 2 additions & 2 deletions docs/src/content/docs/reference/cli/commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ Arguments:
Options:
--models <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)

Check failure on line 85 in docs/src/content/docs/reference/cli/commands.md

View workflow job for this annotation

GitHub Actions / build

The updated documentation for the `--models` option is unclear. The addition of 's (small model)' is not formatted consistently with the other key-value pairs and lacks a clear explanation. Consider revising for clarity and consistency.
-o, --out <folder> output folder
-rmo, --remove-out remove output folder if it exists
--cli <string> override path to the cli
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ export async function cli() {
)
.option(
"--models <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)"

Check failure on line 188 in packages/cli/src/cli.ts

View workflow job for this annotation

GitHub Actions / build

The description for the "--models" option has been updated to include "s (small model)", but it's not clear what "s" stands for. Consider updating the description to make it more descriptive and user-friendly. 😊
)
.option("-o, --out <folder>", "output folder")
.option("-rmo, --remove-out", "remove output folder if it exists")
Expand Down
1 change: 1 addition & 0 deletions packages/cli/src/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ function parseModelSpec(m: string): ModelOptions {
if (Object.keys(values).length > 1)
return {
model: values["m"],
smallModel: values["s"],

Check failure on line 54 in packages/cli/src/test.ts

View workflow job for this annotation

GitHub Actions / build

A new key "s" (smallModel) is being parsed from the input, but there is no validation to check if the key "s" actually exists in the input. This could lead to undefined behavior if the key is not present. Please add a validation check for the "s" key. 🧐
temperature: normalizeFloat(values["t"]),
topP: normalizeFloat(values["p"]),
}
Expand Down
4 changes: 3 additions & 1 deletion packages/core/src/types/prompt_template.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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"
>

Check failure on line 136 in packages/core/src/types/prompt_template.d.ts

View workflow job for this annotation

GitHub Actions / build

The type of "smallModel" has been expanded to include "***:gpt-4o-mini". If this new type is not handled properly in the code where "smallModel" is used, it could lead to unexpected behavior. Please ensure that all parts of the code that use "smallModel" can handle the new type. πŸ‘
}

interface ModelOptions extends ModelConnectionOptions {
Expand Down
2 changes: 1 addition & 1 deletion packages/sample/genaisrc/blog-generate-knowledge.genai.js
Original file line number Diff line number Diff line change
@@ -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: {
Expand Down
2 changes: 1 addition & 1 deletion packages/sample/genaisrc/console-eval.genai.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
script({
model: "openai:gpt-3.5-turbo",
model: "small",
tests: {},
})

Expand Down
6 changes: 3 additions & 3 deletions packages/sample/genaisrc/csv.genai.mjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
script({
files: "src/penguins.csv",
tests: {},
model: "openai:gpt-3.5-turbo",
model: "small",
})

def("DATA", env.files, { sliceSample: 3 })
Expand All @@ -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([
Expand Down
2 changes: 1 addition & 1 deletion packages/sample/genaisrc/defdata.genai.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
script({
title: "defData demo",
model: "openai:gpt-3.5-turbo",
model: "small",
tests: {
},
system: ["system"]
Expand Down
2 changes: 1 addition & 1 deletion packages/sample/genaisrc/defschema.genai.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
script({
tests: {},
model: "openai:gpt-3.5-turbo",
model: "small",
files: "src/cities.md"
})

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
script({
title: "Describe objects in each image",
model: "openai:gpt-3.5-turbo",
model: "small",
group: "vision",
maxTokens: 4000,
system: [],
Expand Down
2 changes: 1 addition & 1 deletion packages/sample/genaisrc/diagrams.genai.mts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
script({
model: "openai:gpt-3.5-turbo",
model: "small",
tests: {},
})
$`Generate a diagram of a merge.`
2 changes: 1 addition & 1 deletion packages/sample/genaisrc/exec.genai.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
script({
model: "openai:gpt-3.5-turbo",
model: "small",
tests: {
keywords: ["Python", "3."],
},
Expand Down
2 changes: 1 addition & 1 deletion packages/sample/genaisrc/fetch.genai.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
script({
model: "openai:gpt-3.5-turbo",
model: "small",
tests: {
keywords: "genaiscript",
},
Expand Down
2 changes: 1 addition & 1 deletion packages/sample/genaisrc/fileoutput.genai.mts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
script({
title: "summarize all files",
model: "openai:gpt-3.5-turbo",
model: "small",
files: "src/rag/markdown.md",
tests: [
{
Expand Down
2 changes: 1 addition & 1 deletion packages/sample/genaisrc/flex.genai.mts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
script({
model: "openai:gpt-3.5-turbo",
model: "small",
files: ["src/rag/markdown.md"],
system: [],
flexTokens: 20,
Expand Down
2 changes: 1 addition & 1 deletion packages/sample/genaisrc/fs.genai.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
script({
model: "openai:gpt-3.5-turbo",
model: "small",
tools: ["fs"],
tests: {},
})
Expand Down
2 changes: 1 addition & 1 deletion packages/sample/genaisrc/fuzz-search.genai.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
script({
title: "fuzz search",
model: "openai:gpt-3.5-turbo",
model: "small",
tests: {},
})
const kw = (env.vars.keyword || "defdata") + ""
Expand Down
2 changes: 1 addition & 1 deletion packages/sample/genaisrc/gcc-container.genai.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
script({
model: "openai:gpt-3.5-turbo",
model: "small",
})
const container = await host.container({
image: "gcc",
Expand Down
2 changes: 1 addition & 1 deletion packages/sample/genaisrc/git-history.genai.mts
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
2 changes: 1 addition & 1 deletion packages/sample/genaisrc/github.genai.mts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
script({
model: "openai:gpt-3.5-turbo",
model: "small",
tests: {},
})

Expand Down
2 changes: 1 addition & 1 deletion packages/sample/genaisrc/html.genai.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
script({
model: "openai:gpt-3.5-turbo",
model: "small",
title: "HTML to Text",
tests: {},
})
Expand Down
2 changes: 1 addition & 1 deletion packages/sample/genaisrc/import-template.genai.mts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
script({
model: "openai:gpt-3.5-turbo",
model: "small",
tests: {
keywords: ["paris", "abracadabra"],
},
Expand Down
2 changes: 1 addition & 1 deletion packages/sample/genaisrc/json_object.genai.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
script({
model: "openai:gpt-3.5-turbo",
model: "small",
responseType: "json_object",
responseSchema: {
type: "object",
Expand Down
2 changes: 1 addition & 1 deletion packages/sample/genaisrc/json_object_ex.genai.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
script({
model: "openai:gpt-3.5-turbo",
model: "small",
responseType: "json_object",
responseSchema: { characters: [{ name: "neo", age: 30 }] },
tests: {},
Expand Down
2 changes: 1 addition & 1 deletion packages/sample/genaisrc/llm-as-expert.genai.mts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion packages/sample/genaisrc/math-agent-system.genai.js
Original file line number Diff line number Diff line change
@@ -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: {
Expand Down
2 changes: 1 addition & 1 deletion packages/sample/genaisrc/mjs.genai.mjs
Original file line number Diff line number Diff line change
@@ -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"],
Expand Down
2 changes: 1 addition & 1 deletion packages/sample/genaisrc/mts.genai.mts
Original file line number Diff line number Diff line change
@@ -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"],
Expand Down
2 changes: 1 addition & 1 deletion packages/sample/genaisrc/multi-turn.genai.js
Original file line number Diff line number Diff line change
@@ -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"],
Expand Down
2 changes: 1 addition & 1 deletion packages/sample/genaisrc/nested-args.genai.mts
Original file line number Diff line number Diff line change
@@ -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: [
{
Expand Down
2 changes: 1 addition & 1 deletion packages/sample/genaisrc/output.genai.js
Original file line number Diff line number Diff line change
@@ -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: [],
Expand Down
2 changes: 1 addition & 1 deletion packages/sample/genaisrc/pdf-to-tweet.genai.js
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
2 changes: 1 addition & 1 deletion packages/sample/genaisrc/rag.genai.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
script({
title: "rag",
model: "openai:gpt-3.5-turbo",
model: "small",
files: "src/rag/*",
tests: {
files: "src/rag/*",
Expand Down
2 changes: 1 addition & 1 deletion packages/sample/genaisrc/responseschema.genai.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
script({
model: "openai:gpt-3.5-turbo",
model: "small",
tests: {
},
responseSchema: {
Expand Down
2 changes: 1 addition & 1 deletion packages/sample/genaisrc/run-prompt-summarize.genai.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
script({
title: "run prompt summarize",
model: "openai:gpt-3.5-turbo",
model: "small",
tests: [
{
files: ["src/rag/markdown.md"],
Expand Down
2 changes: 1 addition & 1 deletion packages/sample/genaisrc/script-files.genai.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
script({
model: "openai:gpt-3.5-turbo",
model: "small",
files: "src/rag/*.md",
tests: {},
})
Expand Down
4 changes: 2 additions & 2 deletions packages/sample/genaisrc/style/runprompt.genai.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const resPoem = await runPrompt(
_.$`write haiku poem`
},
{
model: "openai:gpt-3.5-turbo",
model: "small",
label: "generate poem",
system: ["system"],
}
Expand All @@ -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",
}
Expand Down
2 changes: 1 addition & 1 deletion packages/sample/genaisrc/summarize-files-function.genai.js
Original file line number Diff line number Diff line change
@@ -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"],
Expand Down
2 changes: 1 addition & 1 deletion packages/sample/genaisrc/summarize-import.genai.mjs
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
2 changes: 1 addition & 1 deletion packages/sample/genaisrc/summarize-link.genai.js
Original file line number Diff line number Diff line change
@@ -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"],
Expand Down
2 changes: 1 addition & 1 deletion packages/sample/genaisrc/summarize-max-tokens.genai.js
Original file line number Diff line number Diff line change
@@ -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/*"],
Expand Down
2 changes: 1 addition & 1 deletion packages/sample/genaisrc/summarize-nested.genai.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
script({
title: "summarize nested",
model: "openai:gpt-3.5-turbo",
model: "small",
files: ["src/rag/*"],
tests: {
files: ["src/rag/*"],
Expand Down
2 changes: 1 addition & 1 deletion packages/sample/genaisrc/summarize-pdf.genai.js
Original file line number Diff line number Diff line change
@@ -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"],
Expand Down
2 changes: 1 addition & 1 deletion packages/sample/genaisrc/summarize.genai.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
script({
title: "summarize all files",
model: "openai:gpt-3.5-turbo",
model: "small",
files: "src/rag/markdown.md",
tests: [
{
Expand Down
2 changes: 1 addition & 1 deletion packages/sample/genaisrc/summary-of-summary-gpt35.genai.js
Original file line number Diff line number Diff line change
@@ -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/*"],
Expand Down
2 changes: 1 addition & 1 deletion packages/sample/genaisrc/summary-of-summary-phi3.genai.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
script({
model: "openai:gpt-3.5-turbo",
model: "small",
title: "summary of summary - phi3",
files: ["src/rag/*.md"],
tests: {
Expand Down
2 changes: 1 addition & 1 deletion packages/sample/genaisrc/templating.genai.mts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
script({
model: "openai:gpt-3.5-turbo",
model: "small",
tests: {
keywords: ["paris", "monday"],
asserts: [
Expand Down
2 changes: 1 addition & 1 deletion packages/sample/genaisrc/todo.genai.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: [{
Expand Down
Loading

0 comments on commit ba1aa44

Please sign in to comment.