Skip to content

Commit

Permalink
fix: Update sessions with given IDs only
Browse files Browse the repository at this point in the history
  • Loading branch information
whiterabbit1983 committed Apr 22, 2024
1 parent 32ecc5a commit a71ad5a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions agents-api/agents_api/models/session/patch_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,11 @@ def patch_session_query(
session_update_query = f"""
{{
input[{session_update_cols}] <- $session_update_vals
ids[session_id, developer_id] <- [[to_uuid($session_id), to_uuid($developer_id)]]
?[{all_fields}, metadata, updated_at] :=
input[{session_update_cols}],
ids[session_id, developer_id],
*sessions{{
{rest_fields}, metadata: md, @ "NOW"
}},
Expand Down
4 changes: 4 additions & 0 deletions agents-api/agents_api/models/session/update_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,11 @@ def update_session_query(
session_update_query = f"""
{{
input[{session_update_cols}] <- $session_update_vals
ids[session_id, developer_id] <- [[to_uuid($session_id), to_uuid($developer_id)]]
?[{all_fields}, updated_at] :=
input[{session_update_cols}],
ids[session_id, developer_id],
*sessions{{
{rest_fields}, @ "NOW"
}},
Expand All @@ -69,6 +71,8 @@ def update_session_query(
}}
"""

print(session_update_query)

combined_query = "{" + assertion_query + "}" + session_update_query

return (
Expand Down

0 comments on commit a71ad5a

Please sign in to comment.