mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-07-20 19:36:08 +00:00
proxy后向兼容,修复部分报错
This commit is contained in:
@@ -45,8 +45,9 @@ class ModelRequest():
|
||||
|
||||
def request(self, **kwargs):
|
||||
if self.proxy != None: #异步请求
|
||||
loop = asyncio.new_event_loop()
|
||||
self.runtime = threading.Thread(
|
||||
target=asyncio.run,
|
||||
target=loop.run_until_complete,
|
||||
args=(self.__a_request__(**kwargs),)
|
||||
)
|
||||
self.runtime.start()
|
||||
|
||||
Reference in New Issue
Block a user