Fix: Fixed the issue that the agent list page failed to load #3827 (#3902)

### What problem does this PR solve?

Fix: Fixed the issue that the agent list page failed to load #3827

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
balibabu 2024-12-06 17:05:40 +08:00 committed by GitHub
parent 655b01a0a4
commit 311a475b6f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 5 deletions

View File

@ -224,17 +224,16 @@ class Canvas(ABC):
for m in prepare2run([switch_out]):
yield {"content": m, "running_status": True}
except Exception as e:
yield {"content": "*Exception*: {}".format(e), "running_status": True}
logging.exception("Canvas.run got exception")
raise e
continue
try:
for m in prepare2run(cpn["downstream"]):
yield {"content": m, "running_status": True}
except Exception as e:
yield {"content": "*Exception*: {}".format(e), "running_status": True}
logging.exception("Canvas.run got exception")
ran += 1
raise e
if ran >= len(self.path[-1]) and waiting:
without_dependent_checking = waiting

View File

@ -196,8 +196,7 @@ class TenantLLMService(CommonService):
else:
tenant_llms = cls.query(tenant_id=tenant_id, llm_name=llm_name)
if not tenant_llms:
if not llm_factory: llm_factory = mdlnm
num = cls.model.create(tenant_id=tenant_id, llm_factory=llm_factory, llm_name=llm_name, used_tokens=used_tokens)
return num
else:
tenant_llm = tenant_llms[0]
num = cls.model.update(used_tokens=tenant_llm.used_tokens + used_tokens)\