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: Exclude unset fields from agent's default settings #628

Merged
merged 5 commits into from
Oct 12, 2024
Merged
Changes from 3 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: 5 additions & 1 deletion agents-api/agents_api/models/agent/create_or_update_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,11 @@ def create_or_update_agent(
data.default_settings = data.default_settings or {}

agent_data = data.model_dump()
default_settings = agent_data.pop("default_settings")
default_settings = (
data.default_settings.model_dump(exclude_none=True)
if data.default_settings
else {}
)

settings_cols, settings_vals = cozo_process_mutate_data(
{
Expand Down
Loading