[BUG]运行start脚本时No module named 'tool_call_utils'
Traceback (most recent call last):
File "G:\NagaAgent\main.py", line 13, in
总之最后是搞定了 似乎是api_server.py和外面有个core循环引用的问题 不知道其他人有没有这个问题 如果有的话 可以看这个解决方案 解决方案: 确保正确的包结构:
在 G:\NagaAgent\ 目录下创建一个空的 init.py 文件。 在 G:\NagaAgent\apiserver\ 目录下创建一个空的 init.py 文件。 修正 apiserver/api_server.py 中的导入:
修复 tool_call_utils 的导入: 将 from tool_call_utils import ... 改为 from .tool_call_utils import ... (注意前面的点 .)。 移除手动路径设置: 删除 sys.path.insert(...) 的代码行。 修复 NagaConversation 的类型提示: 将 naga_agent: Optional[NagaConversation] 改为 naga_agent: Optional['NagaConversation'] (用单引号括起来)。 延迟 NagaConversation 的实际导入和实例化: 删除 api_server.py 文件顶部(顶层作用域)的任何 from conversation_core import NagaConversation 导入语句。 确保 from conversation_core import NagaConversation 和 naga_agent = NagaConversation() 的代码 仅在 lifespan 函数内部 执行。 验证 conversation_core.py 中的导入:
确认导入语句是 from apiserver.tool_call_utils import ... (绝对导入)。 确认 conversation_core.py 在文件顶部没有导入 api_server 或 NagaConversation。
这个已修复,只是还没传
好的
检测脚本里对c++ build tool和powershell环境检测有问题 需要我提pr吗
可以