-
Notifications
You must be signed in to change notification settings - Fork 616
feat(py): add directory and file prompt loading in genkit matching JS SDK #3955
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
feat(py): add directory and file prompt loading in genkit matching JS SDK #3955
Conversation
|
/gemini review |
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.
Code Review
This pull request significantly enhances prompt management by introducing lazy-loaded, file-based prompts and a new prompt method in the Genkit class. Key changes include adding functions to load prompts, partials, and helpers from .prompt files, which register both PROMPT (returning GenerateRequest) and EXECUTABLE_PROMPT (returning GenerateActionOptions) actions. The ExecutablePrompt class gains an as_tool method to expose prompts as actions and a to_generate_request utility function is added. Docstrings were removed from define_indexer and inline imports of GenkitError were introduced, which were noted in review comments. Additionally, the review highlighted a potential AttributeError in as_tool due to commented-out internal attributes and a strong circular reference in prompt action registration that could lead to memory leaks, suggesting the use of weakref. Dependency updates in uv.lock were also made to support opentelemetry-exporter-gcp-monitoring and adjust grpcio versions for Python 3.14+.
|
Thanks for tagging me! I'm currently processing the review for this pull request based on your |
CHANGLOG: