Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Set metadata to an empty dict by default #217

Merged
merged 1 commit into from
Apr 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions agents-api/agents_api/activities/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,12 @@ class ChatML(BaseModel):
token_count: Optional[int] = None


class BaseTask(BaseModel): ...
class BaseTask(BaseModel):
...


class BaseTaskArgs(BaseModel): ...
class BaseTaskArgs(BaseModel):
...


class AddPrinciplesTaskArgs(BaseTaskArgs):
Expand Down
6 changes: 4 additions & 2 deletions agents-api/agents_api/clients/worker/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,12 @@ class ChatML(BaseModel):
token_count: Optional[int] = None


class BaseTask(BaseModel): ...
class BaseTask(BaseModel):
...


class BaseTaskArgs(BaseModel): ...
class BaseTaskArgs(BaseModel):
...


class MemoryManagementTaskArgs(BaseTaskArgs):
Expand Down
2 changes: 1 addition & 1 deletion agents-api/agents_api/models/agent/patch_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def patch_agent_query(
"""
# Construct the query for updating agent information in the database.
# Agent update query
metadata = update_data.pop("metadata", {})
metadata = update_data.pop("metadata", {}) or {}
agent_update_cols, agent_update_vals = cozo_process_mutate_data(
{
**{k: v for k, v in update_data.items() if v is not None},
Expand Down
2 changes: 1 addition & 1 deletion agents-api/agents_api/models/session/patch_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def patch_session_query(
:assert some
"""

metadata = update_data.pop("metadata", {})
metadata = update_data.pop("metadata", {}) or {}

session_update_cols, session_update_vals = cozo_process_mutate_data(
{k: v for k, v in update_data.items() if v is not None}
Expand Down
2 changes: 1 addition & 1 deletion agents-api/agents_api/models/user/patch_user.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

def patch_user_query(developer_id: UUID, user_id: UUID, **update_data) -> pd.DataFrame:
# Prepare data for mutation by filtering out None values and adding system-generated fields.
metadata = update_data.pop("metadata", {})
metadata = update_data.pop("metadata", {}) or {}
user_update_cols, user_update_vals = cozo_process_mutate_data(
{
**{k: v for k, v in update_data.items() if v is not None},
Expand Down
Loading