MCPcopy Create free account
hub / github.com/VectifyAI/OpenKB / on_new_files

Function on_new_files

openkb/cli.py:1844–1853  ·  view source on GitHub ↗
(paths)

Source from the content-addressed store, hash-verified

1842 raw_dir.mkdir(exist_ok=True)
1843
1844 def on_new_files(paths):
1845 for p in paths:
1846 fp = Path(p)
1847 if fp.suffix.lower() not in SUPPORTED_EXTENSIONS:
1848 click.echo(
1849 f"Skipping unsupported file type: {fp.suffix}. "
1850 f"Supported: {', '.join(sorted(SUPPORTED_EXTENSIONS))}"
1851 )
1852 continue
1853 add_single_file(fp, kb_dir)
1854
1855 click.echo(f"Watching {raw_dir} for new documents. Press Ctrl+C to stop.")
1856 watch_directory(raw_dir, on_new_files)

Callers

nothing calls this directly

Calls 1

add_single_fileFunction · 0.85

Tested by

no test coverage detected