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

Conversation

whiterabbit1983
Copy link
Contributor

@whiterabbit1983 whiterabbit1983 commented Oct 11, 2024

Important

create_or_update_agent now excludes unset fields from default_settings, and a test is skipped in test_docs_queries.py.

  • Behavior:
    • In create_or_update_agent, default_settings now uses model_dump(exclude_unset=True) to exclude unset fields.
  • Tests:
    • Skips test model: get docs in test_docs_queries.py with a note to execute embedding workflow to fix it.

This description was created by Ellipsis for b49f435. It will automatically update as commits are pushed.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Looks good to me! Reviewed everything up to 9e9cbcd in 8 seconds

More details
  • Looked at 13 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. agents-api/agents_api/models/agent/create_or_update_agent.py:86
  • Draft comment:
    The use of model_dump(exclude_unset=True) ensures only explicitly set fields are included, preventing unset fields from overwriting existing settings. This aligns with the PR's intent to exclude unset fields.
  • Reason this comment was not posted:
    Confidence changes required: 0%
    The change in the PR modifies how default_settings is extracted from data. The new method uses model_dump(exclude_unset=True), which ensures that only fields that have been explicitly set are included. This is a good change as it prevents default settings from being overwritten with unset fields, aligning with the PR's intent.

Workflow ID: wflow_1EGEAHxCj7VneZl0


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

@creatorrr
Copy link
Contributor

@whiterabbit1983 :

  │ ❱  86 │   default_settings = data.default_settings.model_dump(exclude_un │  
  │    87 │                                                                  │  
  │    88 │   settings_cols, settings_vals = cozo_process_mutate_data(       │  
  │    89 │   │   {                                                          │  
  │                                                                          │  
  │ ╭────────────────────────── locals ───────────────────────────╮          │  
  │ │   agent_data = {                                            │          │  
  │ │                │   'metadata': {},                          │          │  
  │ │                │   'name': 'test agent',                    │          │  
  │ │                │   'about': 'test agent about',             │          │  
  │ │                │   'model': 'gpt-4o-mini',                  │          │  
  │ │                │   'instructions': ['test instruction'],    │          │  
  │ │                │   'default_settings': {}                   │          │  
  │ │                }                                            │          │  
  │ │     agent_id = UUID('3486f9c1-c1f9-49ef-9931-bddd95522cb4') │          │  
  │ │         data = CreateOrUpdateAgentRequest(                  │          │  
  │ │                │   metadata={},                             │          │  
  │ │                │   name='test agent',                       │          │  
  │ │                │   about='test agent about',                │          │  
  │ │                │   model='gpt-4o-mini',                     │          │  
  │ │                │   instructions=['test instruction'],       │          │  
  │ │                │   default_settings={}                      │          │  
  │ │                )                                            │          │  
  │ │ developer_id = UUID('00000000-0000-0000-0000-000000000000') │          │  
  │ ╰─────────────────────────────────────────────────────────────╯          │  
  ╰──────────────────────────────────────────────────────────────────────────╯  
  AttributeError: 'dict' object has no attribute 'model_dump'                   

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Looks good to me! Incremental review on 9874cbc in 10 seconds

More details
  • Looked at 17 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. agents-api/agents_api/models/agent/create_or_update_agent.py:87
  • Draft comment:
    The PR description mentions using model_dump(exclude_unset=True), but the code uses model_dump(exclude_none=True). Please ensure the description matches the code changes.
  • Reason this comment was not posted:
    Comment did not seem useful.

Workflow ID: wflow_faQcNDzLyGoQ7e5q


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Looks good to me! Incremental review on b49f435 in 8 seconds

More details
  • Looked at 21 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. agents-api/tests/test_docs_queries.py:44
  • Draft comment:
    Consider adding a more detailed reason or a reference to a task/issue tracker in the @skip decorator for better context.
  • Reason this comment was not posted:
    Confidence changes required: 33%
    The use of @skip decorator is appropriate for tests that are not ready to be executed. However, it would be beneficial to include a more detailed reason or a reference to a task or issue tracker for better context.

Workflow ID: wflow_KtLWpeQHMIkWoPWk


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

@whiterabbit1983 whiterabbit1983 merged commit 6bd24eb into dev Oct 12, 2024
4 checks passed
@whiterabbit1983 whiterabbit1983 deleted the f/agent-default-settings branch October 12, 2024 13:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants