Skip to content

Commit

Permalink
call logs bugs main (#1173)
Browse files Browse the repository at this point in the history
  • Loading branch information
jedan2506 authored Aug 31, 2023
1 parent 4fa5f9d commit 48e68cf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions superagi/apm/call_log_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def fetch_data(self, model: str):
func.sum(CallLogs.tokens_consumed),
func.count(CallLogs.id),
func.count(distinct(CallLogs.agent_id))
).filter(CallLogs.model == model).first()
).filter(CallLogs.model == model, CallLogs.org_id == self.organisation_id).first()

if result is None:
return None
Expand All @@ -51,7 +51,7 @@ def fetch_data(self, model: str):
}

# Fetch all runs for this model
runs = self.session.query(CallLogs).filter(CallLogs.model == model).all()
runs = self.session.query(CallLogs).filter(CallLogs.model == model, CallLogs.org_id == self.organisation_id).all()
for run in runs:
# Get agent's name using agent_id as a foreign key
agent = self.session.query(Agent).filter(Agent.id == run.agent_id).first()
Expand Down

0 comments on commit 48e68cf

Please sign in to comment.