bugfix
This commit is contained in:
parent
20e352f79a
commit
1ea77072b5
@ -14,6 +14,7 @@ from appPublic.dictObject import DictObject
|
|||||||
from appPublic.log import info, debug, error, exception
|
from appPublic.log import info, debug, error, exception
|
||||||
from appPublic.jsonConfig import getConfig
|
from appPublic.jsonConfig import getConfig
|
||||||
from appPublic.uniqueID import getID
|
from appPublic.uniqueID import getID
|
||||||
|
from appPublic.zmqapi import zmq_subcribe
|
||||||
|
|
||||||
# 配置审计日志
|
# 配置审计日志
|
||||||
|
|
||||||
@ -250,15 +251,7 @@ class IndustrialSkillEngine:
|
|||||||
})
|
})
|
||||||
env = self.request._run_ns
|
env = self.request._run_ns
|
||||||
cnt = 0
|
cnt = 0
|
||||||
while True:
|
user_reply = await zmq_subcribe(sessionkey)
|
||||||
await asyncio.sleep(0.5)
|
|
||||||
user_reply = await env.session_getvalue(sessionkey)
|
|
||||||
if user_reply:
|
|
||||||
break
|
|
||||||
if cnt >= 60:
|
|
||||||
debug(f'env.session_getvalue("{sessionkey}") get None')
|
|
||||||
cnt = 0
|
|
||||||
cnt += 1
|
|
||||||
debug(f'{user_reply=}===============================')
|
debug(f'{user_reply=}===============================')
|
||||||
prompt = f"{user_prompt}\n补充输入:{user_reply}"
|
prompt = f"{user_prompt}\n补充输入:{user_reply}"
|
||||||
await self._run(prompt, context=context, is_retry=True)
|
await self._run(prompt, context=context, is_retry=True)
|
||||||
|
|||||||
@ -1,12 +1,13 @@
|
|||||||
questionkey = params_kw.questionkey
|
questionkey = params_kw.questionkey
|
||||||
answer = params_kw.answer
|
answer = params_kw.answer
|
||||||
|
|
||||||
if questionkey:
|
if questionkey:
|
||||||
await session_setvalue(questionkey, answer)
|
await zmq_publish(questionkey, answer)
|
||||||
return {
|
return {
|
||||||
"status":"SUCCEEDED",
|
"status":"SUCCEEDED",
|
||||||
"data":{
|
"data":{
|
||||||
"questionkey": questionkey,
|
"questionkey": questionkey,
|
||||||
"value": await session_getvalue(questionkey)
|
"value": answer
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else:
|
else:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user