Skip to content

Commit

Permalink
add instruction to LLM to avoid functions. names
Browse files Browse the repository at this point in the history
  • Loading branch information
pelikhan committed Aug 20, 2024
1 parent 05e9afb commit 6e0e523
Show file tree
Hide file tree
Showing 20 changed files with 58 additions and 51 deletions.
4 changes: 2 additions & 2 deletions docs/genaisrc/genaiscript.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

35 changes: 18 additions & 17 deletions docs/src/content/docs/reference/scripts/system.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -472,23 +472,6 @@ defTool(
`````
### `system.functions`
use functions
`````js wrap title="system.functions"
system({
title: "use functions"
})

$`Use tools if possible.`
`````
### `system.math`
Math expression evaluator
Expand Down Expand Up @@ -816,6 +799,24 @@ $`Also, you are an expert technical document writer.`;
`````
### `system.tools`
Tools support
`````js wrap title="system.tools"
system({
title: "Tools support",
})

$`Use tools if possible. **Do NOT invent function names**. **Do NOT use function names starting with 'functions.'.`

`````
### `system.typescript`
Export TypeScript Developer
Expand Down
4 changes: 2 additions & 2 deletions genaisrc/genaiscript.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions packages/core/src/genaisrc/genaiscript.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 0 additions & 5 deletions packages/core/src/genaisrc/system.functions.genai.js

This file was deleted.

5 changes: 5 additions & 0 deletions packages/core/src/genaisrc/system.tools.genai.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
system({
title: "Tools support",
})

$`Use tools if possible. **Do NOT invent function names**. **Do NOT use function names starting with 'functions.'.`
1 change: 1 addition & 0 deletions packages/core/src/systems.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export function resolveSystems(prj: Project, template: PromptScript) {
}

if (template.tools) {
systems.push("system.tools")
arrayify(template.tools).forEach((tool) =>
systems.push(...resolveTools(prj, tool))
)
Expand Down
2 changes: 1 addition & 1 deletion packages/sample/genaisrc/code-opt-fn.genai.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ script({
"Optimize code to run faster, modified from https://twitter.com/mattshumer_/status/1719403205950349588.",
maxTokens: 2000,
group: "samples",
system: ["system.functions"],
system: ["system.tools"],
})

defTool("check_syntax", "Checks code for syntax errors", {
Expand Down
4 changes: 2 additions & 2 deletions packages/sample/genaisrc/genaiscript.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/sample/genaisrc/hockey-line-wizard.genai.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ script({
model: "gpt-4",
title: "hockey-line-wizard",
temperature: 0.01,
system: ["system", "system.functions", "system.zero_shot_cot"],
system: ["system", "system.tools", "system.zero_shot_cot"],
})

const players = [
Expand Down
4 changes: 2 additions & 2 deletions packages/sample/genaisrc/node/genaiscript.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions packages/sample/genaisrc/python/genaiscript.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions packages/sample/genaisrc/style/genaiscript.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions packages/sample/src/aici/genaiscript.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 6e0e523

Please sign in to comment.