Skip to content

Commit

Permalink
Fix: Fixed the issue that the agent list page failed to load #3827 (#…
Browse files Browse the repository at this point in the history
…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)
  • Loading branch information
cike8899 authored Dec 6, 2024
1 parent 655b01a commit 311a475
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
5 changes: 2 additions & 3 deletions agent/canvas.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,17 +224,16 @@ def prepare2run(cpns):
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
Expand Down
3 changes: 1 addition & 2 deletions api/db/services/llm_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,7 @@ def increase_usage(cls, tenant_id, llm_type, used_tokens, llm_name=None):
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)\
Expand Down

0 comments on commit 311a475

Please sign in to comment.