-
Notifications
You must be signed in to change notification settings - Fork 132
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add runPrompt to import list and create new script for llm-as-expert with Rush albums filter and sorting logic #695
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,6 +25,7 @@ | |
"retrieval", | ||
"fetchText", | ||
"cancel", | ||
"runPrompt", | ||
Check failure on line 28 in packages/core/src/importprompt.ts GitHub Actions / build
Check failure on line 28 in packages/core/src/importprompt.ts GitHub Actions / build
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The "runPrompt" function is added to the array but it's not used anywhere in the changes. Please make sure to use it or remove it if it's not necessary. 😊
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The addition of "runPrompt" function in the array seems to be a new feature. Please ensure to add tests for this new functionality to maintain the code quality. 🧪
|
||
] | ||
|
||
const oldGlb: any = {} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
script({ | ||
model: "openai:gpt-4o", | ||
tests: { | ||
keywords: [ | ||
"Permanent Waves", | ||
"Moving Pictures", | ||
"Signals", | ||
"Power Windows", | ||
], | ||
}, | ||
}) | ||
// https://github.com/Stevenic/agentm-js/blob/main/examples/filter-discography.ts | ||
const rushAlbums = [ | ||
"Grace Under Pressure", | ||
"Hemispheres", | ||
"Permanent Waves", | ||
"Presto", | ||
"Clockwork Angels", | ||
"Roll the Bones", | ||
"Signals", | ||
"Rush", | ||
"Power Windows", | ||
"Fly by Night", | ||
"A Farewell to Kings", | ||
"2112", | ||
"Snakes & Arrows", | ||
"Test for Echo", | ||
"Caress of Steel", | ||
"Moving Pictures", | ||
"Counterparts", | ||
"Vapor Trails", | ||
"Hold Your Fire", | ||
] | ||
|
||
defData("RUSH_ALBUMS", rushAlbums) | ||
|
||
defTool( | ||
"llm-gpt35", | ||
"Invokes gpt-3.5-turbo to execute a LLM request", | ||
{ | ||
prompt: { | ||
type: "string", | ||
description: "the prompt to be executed by the LLM", | ||
}, | ||
}, | ||
async ({ prompt }) => { | ||
const res = await runPrompt(prompt, { | ||
model: "openai:gpt-3.5-turbo", | ||
label: "llm-gpt35", | ||
}) | ||
return res.text | ||
} | ||
) | ||
|
||
defTool( | ||
"llm-4o", | ||
"Invokes gpt-4o to execute a LLM request", | ||
{ | ||
prompt: { | ||
type: "string", | ||
description: "the prompt to be executed by the LLM", | ||
}, | ||
}, | ||
async ({ prompt }) => { | ||
const res = await runPrompt(prompt, { | ||
model: "openai:gpt-4o", | ||
label: "llm-4o", | ||
}) | ||
return res.text | ||
} | ||
) | ||
|
||
$` | ||
Filter the list to only include rush albums released in the 1980's. | ||
|
||
Sort the result from the previous task chronologically from oldest to newest. | ||
|
||
Validate results. | ||
|
||
Report as YAML list. | ||
|
||
Let's solve this step by step. | ||
Use gpt-3.5 for filter and sort options. | ||
Use gpt-4o for validation. | ||
` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The function "runPrompt" is added to the array but its definition is not found in the changes. Please ensure that this function is defined elsewhere in your code. 🧐