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
Show file tree
Hide file tree
Changes from 4 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
4 changes: 2 additions & 2 deletions agents-api/tests/test_docs_queries.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Tests for entry queries

from ward import test
from ward import test, skip

from agents_api.autogen.openapi_model import CreateDocRequest
from agents_api.models.docs.create_doc import create_doc
Expand Down Expand Up @@ -41,7 +41,7 @@ def _(
)


# TODO: Execute embedding workflow to fix this test and other docs tests
@skip("Execute embedding workflow to fix this test and other docs tests")
@test("model: get docs")
def _(client=cozo_client, doc=test_doc, developer_id=test_developer_id):
get_doc(
Expand Down
Loading