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

Improve agent creation flow #814

Merged
merged 8 commits into from
Oct 22, 2024

Conversation

EugeneLightsOn
Copy link
Collaborator

@EugeneLightsOn EugeneLightsOn commented Oct 16, 2024

Create deployments and models during the agent creation flow if they are not present in the database but have configurations in the codebase.

AI Description

This PR introduces new functions and updates existing ones to enhance the deployment and model management system.

  • New Functions:

    • find_config_by_deployment_id and find_config_by_deployment_name in src/backend/config/deployments.py enable configuration retrieval by deployment ID or name.
    • create_deployment_by_config in src/backend/crud/deployment.py facilitates deployment creation from a configuration.
    • get_model_by_name in src/backend/crud/model.py retrieves a model by its name.
    • create_model_by_config in src/backend/crud/model.py creates a new model based on a configuration.
  • Updated Functions:

    • validate_deployment_model in src/backend/services/request_validators.py now checks deployment config settings and creates deployments and models if they are not found.
    • test_create_agent_deployment_not_in_db in src/backend/tests/unit/routers/test_agent.py tests agent creation with a deployment not in the database.
    • test_streaming_chat_with_tools_not_in_agent_tools and test_streaming_chat_with_agent_tools_and_empty_request_tools in src/backend/tests/unit/routers/test_chat.py have been updated to use the "tavily_web_search" tool.

@EugeneLightsOn EugeneLightsOn force-pushed the eugene/TLK-1771_improve_agent-creation_flow branch from dbd603c to c460dde Compare October 16, 2024 18:27
@codecov-commenter
Copy link

codecov-commenter commented Oct 16, 2024

Codecov Report

Attention: Patch coverage is 58.82353% with 28 lines in your changes missing coverage. Please review.

Project coverage is 79.68%. Comparing base (547827f) to head (938d69a).

Files with missing lines Patch % Lines
src/backend/tests/unit/routers/test_agent.py 37.50% 10 Missing ⚠️
src/backend/crud/model.py 52.94% 8 Missing ⚠️
src/backend/crud/deployment.py 50.00% 5 Missing ⚠️
src/backend/tests/unit/routers/test_chat.py 0.00% 3 Missing ⚠️
src/backend/config/deployments.py 90.00% 1 Missing ⚠️
src/backend/services/request_validators.py 90.90% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #814      +/-   ##
==========================================
- Coverage   79.80%   79.68%   -0.12%     
==========================================
  Files         243      243              
  Lines       10355    10417      +62     
==========================================
+ Hits         8264     8301      +37     
- Misses       2091     2116      +25     

☔ 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.

Small change requested

@EugeneLightsOn EugeneLightsOn added this pull request to the merge queue Oct 22, 2024
Merged via the queue into main with commit ea4a660 Oct 22, 2024
6 checks passed
@EugeneLightsOn EugeneLightsOn deleted the eugene/TLK-1771_improve_agent-creation_flow branch October 22, 2024 18:49
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