File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
py/samples/prompt_demo/src Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change 2020import structlog
2121from pydantic import BaseModel , Field
2222
23- from genkit .ai import Genkit
23+ from genkit .ai import ActionKind , Genkit
2424from genkit .core .action import ActionRunContext
2525from genkit .plugins .google_genai import GoogleAI
2626
@@ -128,13 +128,13 @@ async def tell_story(input: StoryInput, ctx: ActionRunContext) -> str:
128128
129129
130130async def main ():
131- actions = ai .registry .list_serializable_actions ()
131+ prompts = ai .registry .get_actions_by_kind (ActionKind .PROMPT )
132+ executable_prompts = ai .registry .get_actions_by_kind (ActionKind .EXECUTABLE_PROMPT )
133+ all_prompts = list (prompts .keys ()) + list (executable_prompts .keys ())
132134
133- # Filter for prompts
134- prompts = [key for key in actions .keys () if key .startswith (('/prompt/' , '/executable-prompt/' ))]
135- await logger .ainfo ('Registry Status' , total_actions = len (actions ), loaded_prompts = prompts )
135+ await logger .ainfo ('Registry Status' , loaded_prompts = all_prompts )
136136
137- if not prompts :
137+ if not all_prompts :
138138 await logger .awarning ('No prompts found! Check directory structure.' )
139139 return
140140
You can’t perform that action at this time.
0 commit comments