Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@MengqinShen
Copy link
Contributor

CHANGLOG:

  1. Update prompt.py file to match prompt.ts file in JS SDK
  2. Update prompt.test file to verify the changes added in prompt.py
  3. Update _registry.py file

@pavelgj
Copy link
Collaborator

pavelgj commented Dec 16, 2025

/gemini review

@pavelgj
Copy link
Collaborator

pavelgj commented Dec 16, 2025

@gemini-code-assist

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a 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+.

@gemini-code-assist
Copy link
Contributor

Thanks for tagging me! I'm currently processing the review for this pull request based on your /gemini review request. I'll post the full review shortly.

@MengqinShen MengqinShen marked this pull request as ready for review December 16, 2025 22:20
@yesudeep yesudeep changed the title feat(py):addin directory and file prompt loading in genkit matching JS SDK feat(py): add directory and file prompt loading in genkit matching JS SDK Dec 16, 2025
@yesudeep yesudeep merged commit 4363712 into main Dec 16, 2025
10 checks passed
@yesudeep yesudeep deleted the feat/adding-directory-and-file-prompt-loading-in-genkit branch December 16, 2025 22:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants