Closed pelikhan closed 3 weeks ago
Concerns detected:
The defImages
function has been removed from PromptContext
but added to RunPromptContext
. If there are any existing usages of defImages
from an instance of PromptContext
, this will lead to a breaking change. 🚨
The removal of defImages
from PromptContext
without a deprecation warning might affect consumers who are not aware of the change. It's a good practice to deprecate before removal to give consumers time to adapt. ⚠️
The addition of defImages
to RunPromptContext
without any apparent replacement or equivalent functionality in PromptContext
might indicate an incomplete refactoring or a missing update to the PromptContext
interface. 🧐
Suggested code fix:
defImages
is intended to be moved, ensure that there is a clear migration path for consumers of PromptContext
to switch to RunPromptContext
or another alternative method.defImages
is supposed to be available in both contexts, it should be added back to PromptContext
or an equivalent functionality should be provided.// If defImages should exist in both PromptContext and RunPromptContext, add it back to PromptContext:
interface PromptContext extends RunPromptContext {
// ...
defImages(files: StringLike, options?: DefImagesOptions): void
// ...
}
Given these concerns, the changes cannot be approved as is. 🛑
generated by genaiscript pr-review
Moving defImages logic to run prompt to allow image analysis in sub requests
Library Changes
defImages
function has been removed from thePromptContext
interface inpromptcontext.ts
.defImages
function has been added to theRunPromptContext
interface inrunpromptcontext.ts
. This function is responsible for defining images within the run prompt context, handling both string URLs and workspace files.defImages
function now appends the image node directly to the current node in the run prompt context, instead of appending it to the prompt child as it did before.CLI Changes
describe-image-run-prompt.genai.js
has been added to thepackages/sample/genaisrc
directory. This script is designed to describe objects in images using a run prompt with the model "gpt-4-turbo-v". It defines the images to be described and then summarizes the objects found in those images.