File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed
py/packages/genkit/src/genkit/ai Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -575,13 +575,17 @@ def tool_fn_wrapper(*args: Any) -> Any: # noqa: ANN401
575575 if multipart :
576576 tool_metadata ['tool' ] = {'multipart' : True }
577577
578+ common_params = {
579+ 'name' : tool_name ,
580+ 'description' : tool_description ,
581+ 'metadata_fn' : func ,
582+ }
583+
578584 action = self .registry .register_action (
579- name = tool_name ,
580585 kind = tool_kind ,
581- description = tool_description ,
582586 fn = tool_fn_wrapper ,
583- metadata_fn = func ,
584587 metadata = tool_metadata ,
588+ ** common_params ,
585589 )
586590
587591 # For non-multipart tools, also register a tool.v2 wrapper that
@@ -596,12 +600,10 @@ async def v2_wrapper_fn(*args: Any) -> dict[str, object]: # noqa: ANN401
596600 return {'output' : result }
597601
598602 self .registry .register_action (
599- name = tool_name ,
600603 kind = cast (ActionKind , ActionKind .TOOL_V2 ),
601- description = tool_description ,
602604 fn = v2_wrapper_fn ,
603- metadata_fn = func ,
604605 metadata = {'type' : 'tool.v2' },
606+ ** common_params ,
605607 )
606608
607609 @wraps (func )
You can’t perform that action at this time.
0 commit comments