-
Notifications
You must be signed in to change notification settings - Fork 130
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add RangeOptions interface for line range specification (#777)
* ✨ feat: add RangeOptions interface with line range * ✨ feat: add RangeOptions to DefOptions interface * ✨ feat(core): add extractRange function to liner * ✨ feat: add defrange script and tests * feat: add fs_ask_file and improve cost render logic 💡 * 🛠️ refactor: Modify file slicing and tool handling * ✨ refactor: set default file count & update paths * documentation update script * ✨ feat(docs): add caching and update file path pattern
- Loading branch information
Showing
12 changed files
with
154 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
script({ | ||
model: "small", | ||
files: "src/basic.prompty", | ||
tests: { | ||
keywords: ["CORRECT1", "CORRECT2", "CORRECT3"], | ||
}, | ||
}) | ||
|
||
def("START", env.files, { lineStart: 23 }) | ||
def("END", env.files, { lineEnd: 27 }) | ||
|
||
def("RANGE", env.files, { lineStart: 23, lineEnd: 27 }) | ||
|
||
$`Respond CORRECT1 if START start with "system:" otherwise INCORRECT` | ||
$`Respond CORRECT2 if END end with "user:" otherwise INCORRECT` | ||
$`Respond CORRECT3 if RANGE start with "system:" and end with "user:" otherwise INCORRECT` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
script({ | ||
title: "Pull Request Descriptor", | ||
description: "Generate a pull request description from the git diff", | ||
temperature: 0.5, | ||
tools: ["fs", "md"], | ||
system: ["system", "system.files"], | ||
cache: "docs-up" | ||
}) | ||
|
||
const tip = env.vars.tip | ||
const defaultBranch = await git.defaultBranch() | ||
const branch = await git.branch() | ||
if (branch === defaultBranch) cancel("you are already on the default branch") | ||
|
||
// compute diff | ||
const changes = await git.diff({ | ||
base: defaultBranch, | ||
paths: [ | ||
"**/prompt_template.d.ts", | ||
"**/prompt_type.d.ts", | ||
"packages/sample/**", | ||
], | ||
}) | ||
console.log(changes) | ||
|
||
// task | ||
$`You are an expert software developer and architect. | ||
## Task | ||
- Analyze and summarize the changes in the codebase described in GIT_DIFF in your own dialog and extract a list of impacted public APIs. | ||
- Find the list of related documentation pages of those APIs that need to be updated. | ||
- Update the documentation markdown files according to the changes. | ||
## Guidance | ||
${tip || ""} | ||
- the documentation markdown is located under docs/src/content/docs/**/*.md* | ||
- do NOT try to call tools within the agents | ||
- do NOT create new documentation pages | ||
` | ||
|
||
def("GIT_DIFF", changes, { maxTokens: 30000 }) | ||
defFileOutput( | ||
"docs/src/content/docs/**/*.md*", | ||
"Updated documentation markdown pages" | ||
) |