将同步的文件读取、代码解析和分块操作改为异步实现,使用 asyncio.to_thread 将 CPU 密集型操作放到线程池执行,避免阻塞事件循环。主要修改包括: - 在 TreeSitterParser 和 CodeSplitter 中添加异步解析方法 - 修改 CodeIndexer 使用异步文件读取和分块 - 为 FileReadTool 和 FileSearchTool 添加异步文件读取支持 |
||
|---|---|---|
| .. | ||
| __init__.py | ||
| embeddings.py | ||
| indexer.py | ||
| retriever.py | ||
| splitter.py | ||