-
Notifications
You must be signed in to change notification settings - Fork 126
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
Refactor system handling and update type definitions #701
Conversation
… and tools in templates
…and extendability
@@ -265,7 +266,7 @@ export async function createPromptContext( | |||
role: "system", | |||
content: "", | |||
} | |||
for (const systemId of system) { | |||
for (const systemId of resolveSystems(prj, runOptions)) { |
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 resolveSystems
is missing the second argument runOptions
. This could lead to unexpected behavior or runtime errors. Please ensure that the necessary arguments are provided. 🧐
generated by pr-review-commit
missing_argument
return { | ||
type: "function", | ||
name, | ||
description: dedent(description), |
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 dedent
is not defined in this scope. Please ensure that it is imported or defined before use. 🕵️♀️
generated by pr-review-commit
undefined_function
The changes in the GIT_DIFF look good overall. Here is a short summary:
No concerns were found in these changes. The code looks good and the changes improve the code quality. LGTM 🚀
|
@@ -215,7 +216,7 @@ export async function createPromptContext( | |||
}, | |||
runPrompt: async (generator, runOptions): Promise<RunPromptResult> => { | |||
try { | |||
const { label, system = [] } = runOptions || {} | |||
const { label } = runOptions || {} |
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 system
array from runOptions
is no longer being destructured, which could lead to system
being undefined in the following code.
generated by pr-review-commit
missing_system
return { | ||
type: "function", | ||
name, | ||
description: dedent(description), |
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 dedent
function is being used to format the description
but it's not imported in this file. This could lead to a runtime error.
generated by pr-review-commit
missing_dedent_import
/** | ||
* Budget of tokens to apply the prompt flex renderer. | ||
*/ | ||
flexTokens?: number |
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 flexTokens
property is added to the ModelOptions
interface but it's not clear what it does or what type it should be. It would be helpful to add a type and a more detailed comment explaining its purpose.
generated by pr-review-commit
missing_flexTokens_definition
This pull request includes several commits that refactor the system handling in the codebase. It moves the
flexTokens
property fromScriptRuntimeOptions
toModelOptions
in the types file. It also removes an extra line in theprompt_template.d.ts
file. These changes improve clarity and extendability in the system resolution and update functions.resolveSystems()
. The variablesystem
is no longer destructured fromrunOptions
. Instead,systemId
is resolved within a for loop from the execution ofresolveSystems(prj, runOptions)
.resolveSystems()
is introduced in "systems.ts", whereby systems are resolved based on a given script instead of a template. Also, there is a modification in the usage ofarrayify()
function to convert the system parameters to an array.ScriptRuntimeOptions
, is split into two interfaces -ScriptRuntimeOptions
andPromptSystemOptions
for better categorization of options related to system scripts and runtime respectively. This leads to an extension ofPromptSystemOptions
inPromptScript
interface andPromptGeneratorOptions
.nested-agents.genai.mts
is added. This defines two new tools namely "agent_file_system" and "agent_code_interpreter". These tools are defined to execute the LLM (low-latency model) requests for searching/reading from the file system and to execute python code.