diff --git a/skillagent/skillengine.py b/skillagent/skillengine.py index de18d56..7486290 100644 --- a/skillagent/skillengine.py +++ b/skillagent/skillengine.py @@ -14,6 +14,7 @@ from appPublic.dictObject import DictObject from appPublic.log import info, debug, error, exception from appPublic.jsonConfig import getConfig from appPublic.uniqueID import getID +from appPublic.zmqapi import zmq_subcribe # 配置审计日志 @@ -250,15 +251,7 @@ class IndustrialSkillEngine: }) env = self.request._run_ns cnt = 0 - while True: - 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 + user_reply = await zmq_subcribe(sessionkey) debug(f'{user_reply=}===============================') prompt = f"{user_prompt}\n补充输入:{user_reply}" await self._run(prompt, context=context, is_retry=True) diff --git a/wwwroot/question_answered.dspy b/wwwroot/question_answered.dspy index d5440a8..d035db0 100644 --- a/wwwroot/question_answered.dspy +++ b/wwwroot/question_answered.dspy @@ -1,12 +1,13 @@ questionkey = params_kw.questionkey answer = params_kw.answer + if questionkey: - await session_setvalue(questionkey, answer) + await zmq_publish(questionkey, answer) return { "status":"SUCCEEDED", "data":{ "questionkey": questionkey, - "value": await session_getvalue(questionkey) + "value": answer } } else: