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 @@ -308,14 +308,15 @@ def load_persona_classes(self) -> list[type[BasePersona]]:
308
308
self .log .info (f"Root directory does not exist: { self .root_dir } " )
309
309
return persona_classes
310
310
311
- # Find all .py files in the root directory
312
- py_files = glob (os .path .join (self .root_dir , "*.py" ))
311
+ # Find all .py files in the root directory that contain "persona" in the name
312
+ all_py_files = glob (os .path .join (self .root_dir , "*.py" ))
313
+ py_files = [f for f in all_py_files if "persona" in Path (f ).stem .lower ()]
313
314
314
315
if not py_files :
315
- self .log .info (f"No Python files found in directory: { self .root_dir } " )
316
+ self .log .info (f"No Python files with 'persona' in the name found in directory: { self .root_dir } " )
316
317
return persona_classes
317
318
318
- self .log .info (f"Found { len (py_files )} Python files in { self .root_dir } " )
319
+ self .log .info (f"Found { len (py_files )} Python files with 'persona' in the name in { self .root_dir } " )
319
320
self .log .info ("PENDING: Loading persona classes from local Python files..." )
320
321
start_time_ns = time_ns ()
321
322
You can’t perform that action at this time.
0 commit comments