microsoft / genaiscript

Generative AI Scripting
https://microsoft.github.io/genaiscript/
MIT License
81 stars 22 forks source link

defImages in sub prompts #525

Closed pelikhan closed 3 weeks ago

pelikhan commented 3 weeks ago

Moving defImages logic to run prompt to allow image analysis in sub requests

Library Changes

CLI Changes

generated by genaiscript pr-describe

github-actions[bot] commented 3 weeks ago

Concerns detected:

  1. 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. 🚨

  2. 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. ⚠️

  3. 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:

// 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