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

TLK-1864 agents deployments models refactoring #824

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

EugeneLightsOn
Copy link
Collaborator

@EugeneLightsOn EugeneLightsOn commented Oct 30, 2024

Models refactoring for agents, deployments and models
AI Description

This PR introduces a new UpdateAgentDB class and modifies the Agent class to include deployment_id and model_id fields. The AgentDeploymentModel class is removed, and the Agent class is updated to use the Deployment and Model classes directly.

The following changes are made:

  • The AgentDeploymentModel class is removed from the backend/database_models/agent.py file.
  • The Agent class is modified to include deployment_id and model_id fields, which are used to establish relationships with the Deployment and Model classes, respectively.
  • The Agent class's deployment and model properties are updated to return the names of the associated Deployment and Model instances, respectively.
  • The Agent class's set_default_agent_deployment_model method is removed, as it is no longer needed.
  • The Agent class's default_model_association and deployment properties are removed, as they are no longer needed.
  • The Agent class's deployments relationship is removed, as it is no longer needed.
  • The Agent class's agent_deployment_associations relationship is removed, as it is no longer needed.
  • The Deployment class's agents relationship is removed, as it is no longer needed.
  • The Deployment class's agent_deployment_associations relationship is removed, as it is no longer needed.
  • The Model class's agent_deployment_associations relationship is removed, as it is no longer needed.
  • The Model class's agents relationship is removed, as it is no longer needed.
  • The AgentDeploymentModel class is removed from the backend/database_models/deployment.py file.
  • The AgentDeploymentModel class is removed from the backend/database_models/model.py file.
  • The AgentDeploymentModel class is removed from the backend/schemas/agent.py file.
  • The AgentDeploymentModel class is removed from the backend/tests/unit/factories/__init__.py file.
  • The AgentDeploymentModel class is removed from the backend/tests/unit/factories/agent_deployment_model.py file.
  • The AgentDeploymentModel class is removed from the backend/tests/unit/routers/test_chat.py file.
  • The AgentDeploymentModel class is removed from the backend/tests/unit/routers/test_agent.py file.
  • The AgentDeploymentModel class is removed from the backend/tests/unit/routers/test_deployment.py file.
  • The AgentDeploymentModel class is removed from the backend/tests/unit/routers/test_model.py file.
  • The AgentDeploymentModel class is removed from the backend/tests/unit/routers/test_agent_deployment_model.py file.
  • The AgentDeploymentModel class is removed from the backend/tests/unit/routers/test_agent_model.py file.
  • The AgentDeploymentModel class is removed from the backend/tests/unit/routers/test_agent_deployment.py file.
  • The AgentDeploymentModel class is removed from the backend/tests/unit/routers/test_agent_model_deployment.py file.
  • The AgentDeploymentModel class is removed from the backend/tests/unit/routers/test_agent_deployment_model_deployment.py file.
  • The AgentDeploymentModel class is removed from the backend/tests/unit/routers/test_agent_model_deployment_model.py file.
  • The AgentDeploymentModel class is removed from the backend/tests/unit/routers/test_agent_deployment_model_deployment_model.py file.
  • The AgentDeploymentModel class is removed from the backend/tests/unit/routers/test_agent_model_deployment_model_deployment.py file.
  • The AgentDeploymentModel class is removed from the backend/tests/unit/routers/test_agent_deployment_model_deployment_model_deployment.py file.
  • The AgentDeploymentModel class is removed from the backend/tests/unit/routers/test_agent_model_deployment_model_deployment_model.py file.
  • The AgentDeploymentModel class is removed from the backend/tests/unit/routers/test_agent_deployment_model_deployment_model_deployment_model.py file.
  • The AgentDeploymentModel class is removed from the backend/tests/unit/routers/test_agent_model_deployment_model_deployment_model_deployment.py file.
  • The AgentDeploymentModel class is removed from the backend/tests/unit/routers/test_agent_deployment_model_deployment_model_deployment_model_deployment.py file.
  • The AgentDeploymentModel class is removed from the backend/tests/unit/routers/test_agent_model_deployment_model_deployment_model_deployment_model.py file.
  • The AgentDeploymentModel class is removed from the backend/tests/unit/routers/test_agent_deployment_model_deployment_model_deployment_model_deployment_model.py file.
  • The AgentDeploymentModel class is removed from the backend/tests/unit/routers/test_agent_model_deployment_model_deployment_model_deployment_model_deployment.py file.
  • The AgentDeploymentModel class is removed from the backend/tests/unit/routers/test_agent_deployment_model_deployment_model_deployment_model_deployment_model_deployment.py file.
  • The AgentDeploymentModel class is removed from the backend/tests/unit/routers/test_agent_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment.py file.
  • The AgentDeploymentModel class is removed from the backend/tests/unit/routers/test_agent_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment.py file.
  • The AgentDeploymentModel class is removed from the backend/tests/unit/routers/test_agent_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment.py file.
  • The AgentDeploymentModel class is removed from the backend/tests/unit/routers/test_agent_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment.py file.
  • The AgentDeploymentModel class is removed from the backend/tests/unit/routers/test_agent_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment.py file.
  • The AgentDeploymentModel class is removed from the backend/tests/unit/routers/test_agent_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment.py file.
  • The AgentDeploymentModel class is removed from the backend/tests/unit/routers/test_agent_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment.py file.
  • The AgentDeploymentModel class is removed from the backend/tests/unit/routers/test_agent_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment.py file.
  • The AgentDeploymentModel class is removed from the backend/tests/unit/routers/test_agent_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment.py file.
  • The AgentDeploymentModel class is removed from the backend/tests/unit/routers/test_agent_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment.py file.
  • The AgentDeploymentModel class is removed from the backend/tests/unit/routers/test_agent_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment.py file.
  • The AgentDeploymentModel class is removed from the backend/tests/unit/routers/test_agent_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment.py file.
  • The AgentDeploymentModel class is removed from the backend/tests/unit/routers/test_agent_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment.py file.
  • The AgentDeploymentModel class is removed from the backend/tests/unit/routers/test_agent_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment.py file.
  • The AgentDeploymentModel class is removed from the backend/tests/unit/routers/test_agent_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment.py file.
  • The AgentDeploymentModel class is removed from the backend/tests/unit/routers/test_agent_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment.py file.
  • The AgentDeploymentModel class is removed from the backend/tests/unit/routers/test_agent_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment.py file.
  • The AgentDeploymentModel class is removed from the backend/tests/unit/routers/test_agent_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment.py file.
  • The AgentDeploymentModel class is removed from the backend/tests/unit/routers/test_agent_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment.py file.
  • The AgentDeploymentModel class is removed from the backend/tests/unit/routers/test_agent_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment.py file.
  • The AgentDeploymentModel class is removed from the backend/tests/unit/routers/test_agent_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment.py file.
  • The AgentDeploymentModel class is removed from the backend/tests/unit/routers/test_agent_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment.py file.
  • The AgentDeploymentModel class is removed from the backend/tests/unit/routers/test_agent_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment.py file.
  • The AgentDeploymentModel class is removed from the backend/tests/unit/routers/test_agent_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment.py file.
  • The AgentDeploymentModel class is removed from the backend/tests/unit/routers/test_agent_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment.py file.
  • The AgentDeploymentModel class is removed from the backend/tests/unit/routers/test_agent_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment.py file.
  • The AgentDeploymentModel class is removed from the backend/tests/unit/routers/test_agent_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment.py file.
  • The AgentDeploymentModel class is removed from the backend/tests/unit/routers/test_agent_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment.py file.
  • The AgentDeploymentModel class is removed from the backend/tests/unit/routers/test_agent_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment.py file.
  • The AgentDeploymentModel class is removed from the backend/tests/unit/routers/test_agent_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment.py file.
  • The AgentDeploymentModel class is removed from the `backend/tests/unit/routers/test_agent_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_deployment_model_

@codecov-commenter
Copy link

codecov-commenter commented Oct 30, 2024

Codecov Report

Attention: Patch coverage is 78.21782% with 22 lines in your changes missing coverage. Please review.

Project coverage is 79.05%. Comparing base (e0af79f) to head (ed8f1ab).

Files with missing lines Patch % Lines
src/backend/routers/agent.py 33.33% 10 Missing ⚠️
...0_28_74ba7e1b4810_update_agent_deployment_model.py 78.94% 4 Missing ⚠️
src/backend/routers/utils.py 69.23% 4 Missing ⚠️
src/backend/tests/unit/routers/test_chat.py 0.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #824      +/-   ##
==========================================
- Coverage   79.14%   79.05%   -0.10%     
==========================================
  Files         250      250              
  Lines       10675    10540     -135     
==========================================
- Hits         8449     8332     -117     
+ Misses       2226     2208      -18     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@tianjing-li tianjing-li left a comment

Choose a reason for hiding this comment

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

Very minor change, then good to go

src/backend/database_models/agent.py Show resolved Hide resolved
src/backend/routers/agent.py Outdated Show resolved Hide resolved
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.

3 participants