-
Notifications
You must be signed in to change notification settings - Fork 126
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor tracing logic and add summarize-concurrent script (#718)
* Refactor tracing logic and add summarize-concurrent script for concurrent file summarization. * Add trace details handling and refactor trace methods in core and CLI packages * speed up build
- Loading branch information
Showing
7 changed files
with
105 additions
and
54 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
script({ | ||
title: "summarize concurrently", | ||
model: "openai:gpt-3.5-turbo", | ||
files: "src/rag/*", | ||
}) | ||
|
||
const summaries = await Promise.all( | ||
env.files.map((file) => | ||
runPrompt( | ||
(_) => { | ||
_.def("FILE", file) | ||
_.$`Summarize FILE with one paragraph.` | ||
}, | ||
{ label: file.filename } | ||
) | ||
) | ||
) | ||
|
||
summaries.forEach((s) => def("FILE", s.text)) | ||
|
||
$`Summarize FILE.` |