bugfix
This commit is contained in:
parent
cb5d7af4d9
commit
aa4a0b211c
@ -263,7 +263,7 @@ class IndustrialSkillEngine:
|
|||||||
f = env.get(d.function)
|
f = env.get(d.function)
|
||||||
if f is None:
|
if f is None:
|
||||||
e = Exception(f'function({d.function} is not in env')
|
e = Exception(f'function({d.function} is not in env')
|
||||||
exception(f'{e}')
|
exception(f'函数调用:{e}')
|
||||||
await self.write_output({
|
await self.write_output({
|
||||||
"status": "FAILED",
|
"status": "FAILED",
|
||||||
"error": f'{st=}, {e}'
|
"error": f'{st=}, {e}'
|
||||||
@ -275,18 +275,18 @@ class IndustrialSkillEngine:
|
|||||||
ret = await f(self.request, params_kw=d.params)
|
ret = await f(self.request, params_kw=d.params)
|
||||||
else:
|
else:
|
||||||
ret = f(self.request, params_kw=d.params)
|
ret = f(self.request, params_kw=d.params)
|
||||||
debug(f'函数调用:{st=}, {ret=}')
|
debug(f'函数调用:{st=}, {ret=}{format_exc()}')
|
||||||
await self.write_output({
|
await self.write_output({
|
||||||
"status": "SUCCEEDED",
|
"status": "SUCCEEDED",
|
||||||
"content": ret
|
"content": ret
|
||||||
})
|
})
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
exception(f'{e}\n{format_exc()}')
|
exception(f'函数调用:{e}\n{format_exc()}')
|
||||||
await self.write_output({
|
await self.write_output({
|
||||||
"status": "FAILED",
|
"status": "FAILED",
|
||||||
"error": f'{st=}, {e}'
|
"error": f'{st=}, {e}'
|
||||||
})
|
})
|
||||||
debug(f'调用函数返回')
|
debug(f'调用函数返回{format_exc()}')
|
||||||
return
|
return
|
||||||
if "REPLY: " in decision:
|
if "REPLY: " in decision:
|
||||||
sessionkey = getID()
|
sessionkey = getID()
|
||||||
@ -303,6 +303,7 @@ class IndustrialSkillEngine:
|
|||||||
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)
|
||||||
|
debug(f'reply: {format_exc()}')
|
||||||
return
|
return
|
||||||
if "EXEC:" in decision:
|
if "EXEC:" in decision:
|
||||||
cmd = decision.split("EXEC:")[1].strip()
|
cmd = decision.split("EXEC:")[1].strip()
|
||||||
@ -313,6 +314,7 @@ class IndustrialSkillEngine:
|
|||||||
"status": "SUCCEEDED",
|
"status": "SUCCEEDED",
|
||||||
"content": output
|
"content": output
|
||||||
}
|
}
|
||||||
|
debug(f'exe: {format_exc()}')
|
||||||
await self.write_output(output)
|
await self.write_output(output)
|
||||||
return
|
return
|
||||||
if "ANSWER:" in decision:
|
if "ANSWER:" in decision:
|
||||||
@ -323,5 +325,6 @@ class IndustrialSkillEngine:
|
|||||||
"content": output
|
"content": output
|
||||||
}
|
}
|
||||||
await self.write_output(output)
|
await self.write_output(output)
|
||||||
|
debug(f'answer: {format_exc()}')
|
||||||
return output
|
return output
|
||||||
debug(f' undefined decision:{decision}')
|
debug(f' undefined decision:{decision}{format_exc()}')
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user