Skip to content

Commit

Permalink
Remove agent model parameters and refactor git log and diff commands …
Browse files Browse the repository at this point in the history
…in scripts
  • Loading branch information
pelikhan committed Oct 1, 2024
1 parent df33a82 commit d1987b8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 28 deletions.
18 changes: 0 additions & 18 deletions docs/src/content/docs/reference/scripts/system.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,6 @@ Agent that can find, search or read files to accomplish tasks
`````js wrap title="system.agent_fs"
system({
title: "Agent that can find, search or read files to accomplish tasks",
parameters: {
agentFsModel: {
type: "string",
description: "Model to use for the agent",
},
},
})

const model = env.vars.agentFsModel

Check failure on line 112 in docs/src/content/docs/reference/scripts/system.mdx

View workflow job for this annotation

GitHub Actions / build

Reference to env.vars.agentFsModel remains after parameter removal.
Expand Down Expand Up @@ -172,12 +166,6 @@ Agent that can query Git to accomplish tasks.
`````js wrap title="system.agent_git"
system({
title: "Agent that can query Git to accomplish tasks.",
parameters: {
agentGitModel: {
type: "string",
description: "Model to use for the agent",
},
},
})

const model = env.vars.agentGitModel

Check failure on line 171 in docs/src/content/docs/reference/scripts/system.mdx

View workflow job for this annotation

GitHub Actions / build

Reference to env.vars.agentGitModel remains after parameter removal.
Expand Down Expand Up @@ -234,12 +222,6 @@ Agent that can query GitHub to accomplish tasks.
`````js wrap title="system.agent_github"
system({
title: "Agent that can query GitHub to accomplish tasks.",
parameters: {
agentGithubModel: {
type: "string",
description: "Model to use for the agent",
},
},
})

const model = env.vars.agentGithubModel

Check failure on line 227 in docs/src/content/docs/reference/scripts/system.mdx

View workflow job for this annotation

GitHub Actions / build

Reference to env.vars.agentGithubModel remains after parameter removal.
Expand Down
22 changes: 12 additions & 10 deletions packages/sample/genaisrc/git-release-notes.genai.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,12 @@ const product = env.vars.product || "GenAIScript"

// find previous tag
const { version } = await workspace.readJSON("package.json")
const tag = await git.exec(["describe", "--tags", "--abbrev=0", "HEAD^"])
const commits = await git.exec([
"log",
"--grep='(skip ci|THIRD_PARTY_NOTICES|genai)'",
"--invert-grep",
"--no-merges",
`HEAD...${tag}`,
])
const tag = await git.lastTag()
const commits = await git.log({
excludedGrep: "(skip ci|THIRD_PARTY_NOTICES|genai)",
base: tag,
head: "HEAD",
})
const diff = await git.diff({
base: tag,
head: "HEAD",
Expand All @@ -27,7 +25,11 @@ const diff = await git.diff({
],
})

const commitsName = def("COMMITS", commits, { maxTokens: 4000 })
const commitsName = def(
"COMMITS",
commits.map(({ message }) => message).join("\n"),
{ maxTokens: 4000 }
)
const diffName = def("DIFF", diff, { maxTokens: 20000 })

$`
Expand All @@ -51,5 +53,5 @@ for the upcoming release ${version} of ${product} on GitHub.
- do NOT add a top level title
- do NOT mention ignore commits or instructions
- be concise
- do not wrap text in markdown section
`

0 comments on commit d1987b8

Please sign in to comment.