[Feature][rest_client] io交互应该使用 asyncio 模式提高性能,thread 模式 会导致频繁上下文切换
Search before asking
- [X] I had searched in the issues and found no similar feature requirement.
Description
io交互应该使用 asyncio 模式提高性能,thread 模式 会导致频繁上下文切换
Are you willing to submit PR?
- [ ] Yes I am willing to submit a PR!
Search before asking
- [x] I had searched in the issues and found no similar feature requirement.
Description
io交互应该使用 asyncio 模式提高性能,thread 模式 会导致频繁上下文切换
Are you willing to submit PR?
- [ ] Yes I am willing to submit a PR!
Thanks for your feedback. Could you modify the corresponding code and submit PR to us?
Since the codebase was not designed with asyncio in mind, I don't think this task can be accomplished easily. Using asyncio may introduce some challenges, particularly because the Python code needs to interact with Java. In terms of performance, the context-switching overhead is negligible compared to the latency of LLM invocations, which typically take several seconds. Let me know if you'd like further adjustments!
KAG v0.7 has been update to take advantange of asyncio.