File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
packages/jupyter-ai/jupyter_ai/personas Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -335,14 +335,15 @@ def load_persona_classes(self) -> list[type[BasePersona]]:
335
335
self .log .info (f"Root directory does not exist: { self .root_dir } " )
336
336
return persona_classes
337
337
338
- # Find all .py files in the root directory
339
- py_files = glob (os .path .join (self .root_dir , "*.py" ))
338
+ # Find all .py files in the root directory that contain "persona" in the name
339
+ all_py_files = glob (os .path .join (self .root_dir , "*.py" ))
340
+ py_files = [f for f in all_py_files if "persona" in Path (f ).stem .lower ()]
340
341
341
342
if not py_files :
342
- self .log .info (f"No Python files found in directory: { self .root_dir } " )
343
+ self .log .info (f"No Python files with 'persona' in the name found in directory: { self .root_dir } " )
343
344
return persona_classes
344
345
345
- self .log .info (f"Found { len (py_files )} Python files in { self .root_dir } " )
346
+ self .log .info (f"Found { len (py_files )} Python files with 'persona' in the name in { self .root_dir } " )
346
347
self .log .info ("PENDING: Loading persona classes from local Python files..." )
347
348
start_time_ns = time_ns ()
348
349
You can’t perform that action at this time.
0 commit comments