Skip to content

Commit

Permalink
chore: Remove extra safety
Browse files Browse the repository at this point in the history
  • Loading branch information
whiterabbit1983 committed Dec 27, 2024
1 parent db9ceed commit 5d0e9a1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions agents-api/agents_api/queries/chat/prepare_chat_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def _transform(d):
d["users"] = d.get("users") or []
d["agents"] = d.get("agents") or []

for tool in d.get("toolsets", []) or []:
for tool in d.get("toolsets") or []:
if not tool:
continue

Expand All @@ -122,13 +122,13 @@ def _transform(d):
toolsets[agent_id] = [tool]

d["session"]["updated_at"] = utcnow()
d["users"] = d.get("users", []) or []
d["users"] = d.get("users") or []

transformed_data = {
**d,
"session": make_session(
agents=[a["id"] for a in d.get("agents", []) or []],
users=[u["id"] for u in d.get("users", []) or []],
agents=[a["id"] for a in d.get("agents") or []],
users=[u["id"] for u in d.get("users") or []],
**d["session"],
),
"toolsets": [
Expand Down

0 comments on commit 5d0e9a1

Please sign in to comment.