-
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 runPrompt usage and remove fetchText and cancel from import prompts #700
Conversation
@@ -23,8 +23,6 @@ export async function importPrompt( | |||
"parsers", | |||
"env", | |||
"retrieval", | |||
"fetchText", | |||
"cancel", | |||
"runPrompt", |
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 functions fetchText
and cancel
have been removed. If these functions are being used elsewhere in the code, this could lead to undefined function errors. Please ensure that these functions are either not being used elsewhere, or that appropriate replacements have been provided. 🕵️♀️
generated by pr-review-commit
removed_functions
@@ -2263,10 +2267,6 @@ interface PromptContext extends ChatGenerationContext { | |||
system(options: PromptSystemArgs): void | |||
defFileMerge(fn: FileMergeHandler): void | |||
defOutputProcessor(fn: PromptOutputProcessorHandler): void |
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
has been removed from the PromptContext
interface. If this function is being used in any implementations of this interface, this could lead to undefined function errors. Please ensure that this function is either not being used in any implementations, or that an appropriate replacement has been provided. 🧐
generated by pr-review-commit
removed_function
runPrompt( | ||
generator: string | PromptGenerator, | ||
options?: PromptGeneratorOptions | ||
): Promise<RunPromptResult> |
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
has been added to the ChatGenerationContext
interface. If this function is not implemented in all classes that implement this interface, this could lead to unimplemented function errors. Please ensure that this function is implemented in all classes that use this interface. 🚀
generated by pr-review-commit
added_function
The pull request mainly involves moving the These changes are likely made for architecture reasons or to improve the structure of the program, potentially optimizing how Without context on the reason for these changes and the overall codebase, I cannot definitively say if these changes are good or not. However, the changes seem to be relatively simple and straightforward if the above mentioned points are handled appropriately. Therefore, my response is "LGTM 🚀", with the caveat that the developer ensures all references to
|
This pull request refactors the usage of the
runPrompt
function in the codebase and removes thefetchText
andcancel
parameters from the import prompts. This improves the code by simplifying the prompt generation process and removing unnecessary parameters.importPrompt
function inpackages/core/src/importprompt.ts
, specifically the removal offetchText
andcancel
elements.packages/core/src/types/prompt_template.d.ts
. The functionrunPrompt()
got moved from thePromptContext
interface to theChatGenerationContext
interface. This change seems to be a restructuring of the hierarchy of these interfaces.runPrompt()
got a new home! 🏡packages/sample/genaisrc/llm-as-expert.genai.mts
,runPrompt()
function calls got updated to use a new instanceenv.generator.runPrompt
. This implies an architectural change in the app, defining more specific origins for the runPrompt function calls.packages/sample/genaisrc/pr-create.genai.mts
, though thefinishReason
was also removed from the destructured return ofrunPrompt()
.finishReason
may no longer be part of the return contract ofrunPrompt()
, or simply isn't needed here.