bugfix
This commit is contained in:
parent
814c927b61
commit
024fd55699
@ -256,6 +256,7 @@ class IndustrialSkillEngine:
|
||||
await self.write_output(output)
|
||||
if "CALL: " in decision:
|
||||
st = decision[6:]
|
||||
debug(f'函数调用:{st=}')
|
||||
d = DictObject(**json.loads(st))
|
||||
env = self.request._run_ns
|
||||
f = env.get(d.function)
|
||||
@ -263,6 +264,7 @@ class IndustrialSkillEngine:
|
||||
e = Exception(f'function({d.function} is not in env')
|
||||
exception(f'{e}')
|
||||
raise e
|
||||
try:
|
||||
ret = ''
|
||||
if inspect.iscoroutinefunction(f):
|
||||
ret = await f(self.request, params_kw=d.params)
|
||||
@ -272,6 +274,12 @@ class IndustrialSkillEngine:
|
||||
"status": "SUCCEEDED",
|
||||
"content": ret
|
||||
})
|
||||
except Exception as e:
|
||||
exception(f'{e}\n{format_exc()}')
|
||||
await self.write_output({
|
||||
"status": "FAILED",
|
||||
"error": f'{e}'
|
||||
})
|
||||
return
|
||||
if "REPLY: " in decision:
|
||||
sessionkey = getID()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user