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

backend: Tool config improvements #822

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

backend: Tool config improvements #822

wants to merge 19 commits into from

Conversation

tianjing-li
Copy link
Collaborator

@tianjing-li tianjing-li commented Oct 28, 2024

Some tool refactoring, renaming of schemas to improve code readability. More to come

AI Description

This PR introduces several changes to the project's codebase, primarily focusing on tool configuration, testing, and documentation.

Tool Configuration

  • The src/backend/config/tools.py file has been updated to use the Tool enum and ToolDefinition class for tool management.
  • The ToolName enum and ManagedTool class have been removed, and the get_available_tools() function now returns a dictionary of ToolDefinition objects.
  • The src/backend/schemas/tool.py file has been modified to introduce the ToolCategory enum and ToolDefinition class, replacing the Category enum and ManagedTool class.
  • The src/backend/tests/unit/configuration.yaml file has been updated to remove the enabled_tools section.
  • The src/backend/config/settings.py file has been modified to remove the enabled_tools field from the ToolSettings class.
  • The src/backend/config/configuration.template.yaml file has been updated to remove the enabled_tools section.
  • The src/backend/tests/unit/crud/test_agent_tool_metadata.py, src/backend/tests/unit/crud/test_tool_auth.py, src/backend/tests/unit/factories/agent.py, src/backend/tests/unit/factories/agent_tool_metadata.py, and src/backend/tests/unit/factories/tool_auth.py files have been modified to use the Tool enum for tool references.
  • The src/backend/tests/unit/crud/test_agent.py file has been updated to use the Tool enum for tool references in agent creation and update tests.
  • The src/backend/tests/integration/routers/test_agent.py file has been modified to use the Tool enum for tool references in agent creation tests.
  • The src/backend/cli/constants.py file has been updated to introduce the Tool enum and COMMUNITY_TOOLS dictionary for community tool configuration.
  • The src/backend/cli/main.py file has been modified to import the COMMUNITY_TOOLS dictionary from src/backend/cli/constants.py.
  • The src/backend/routers/auth.py, src/backend/routers/tool.py, src/backend/services/auth/strategies/base.py, src/backend/services/chat.py, src/backend/services/file.py, and src/backend/services/request_validators.py files have been updated to use the get_available_tools() function for tool retrieval.
  • The src/backend/main.py file has been modified to import the logging module and set the log level for the pydantic logger to ERROR.
  • The src/backend/pytest.ini file has been updated to include a filterwarnings entry to ignore UserWarning messages from the pydantic module.
  • The src/backend/chat/custom/custom.py, src/backend/chat/custom/tool_calls.py, and src/backend/tests/unit/chat/test_tool_calls.py files have been modified to use the get_available_tools() function for tool retrieval.
  • The src/backend/tests/unit/chat/test_tool_calls.py file has been updated to include a mock_get_available_tools() fixture for mocking the get_available_tools() function.
  • The src/backend/tests/unit/chat/test_tool_calls.py file has been modified to use the Tool enum for tool references in test cases.
  • The src/backend/tests/unit/chat/test_tool_calls.py file has been updated to use the ToolDefinition class for tool definitions in test cases.
  • The src/backend/tests/unit/chat/test_tool_calls.py file has been modified to use the ToolDefinition class for tool definitions in test cases.
  • The src/backend/tests/unit/chat/test_tool_calls.py file has been updated to use the ToolDefinition class for tool definitions in test cases.
  • The src/backend/tests/unit/chat/test_tool_calls.py file has been modified to use the ToolDefinition class for tool definitions in test cases.
  • The src/backend/tests/unit/chat/test_tool_calls.py file has been updated to use the ToolDefinition class for tool definitions in test cases.
  • The src/backend/tests/unit/chat/test_tool_calls.py file has been modified to use the ToolDefinition class for tool definitions in test cases.
  • The src/backend/tests/unit/chat/test_tool_calls.py file has been updated to use the ToolDefinition class for tool definitions in test cases.
  • The src/backend/tests/unit/chat/test_tool_calls.py file has been modified to use the ToolDefinition class for tool definitions in test cases.
  • The src/backend/tests/unit/chat/test_tool_calls.py file has been updated to use the ToolDefinition class for tool definitions in test cases.
  • The src/backend/tests/unit/chat/test_tool_calls.py file has been modified to use the ToolDefinition class for tool definitions in test cases.
  • The src/backend/tests/unit/chat/test_tool_calls.py file has been updated to use the ToolDefinition class for tool definitions in test cases.
  • The src/backend/tests/unit/chat/test_tool_calls.py file has been modified to use the ToolDefinition class for tool definitions in test cases.
  • The src/backend/tests/unit/chat/test_tool_calls.py file has been updated to use the ToolDefinition class for tool definitions in test cases.
  • The src/backend/tests/unit/chat/test_tool_calls.py file has been modified to use the ToolDefinition class for tool definitions in test cases.
  • The src/backend/tests/unit/chat/test_tool_calls.py file has been updated to use the ToolDefinition class for tool definitions in test cases.
  • The src/backend/tests/unit/chat/test_tool_calls.py file has been modified to use the ToolDefinition class for tool definitions in test cases.
  • The src/backend/tests/unit/chat/test_tool_calls.py file has been updated to use the ToolDefinition class for tool definitions in test cases.
  • The src/backend/tests/unit/chat/test_tool_calls.py file has been modified to use the ToolDefinition class for tool definitions in test cases.
  • The src/backend/tests/unit/chat/test_tool_calls.py file has been updated to use the ToolDefinition class for tool definitions in test cases.
  • The src/backend/tests/unit/chat/test_tool_calls.py file has been modified to use the ToolDefinition class for tool definitions in test cases.
  • The src/backend/tests/unit/chat/test_tool_calls.py file has been updated to use the ToolDefinition class for tool definitions in test cases.
  • The src/backend/tests/unit/chat/test_tool_calls.py file has been modified to use the ToolDefinition class for tool definitions in test cases.
  • The src/backend/tests/unit/chat/test_tool_calls.py file has been updated to use the ToolDefinition class for tool definitions in test cases.
  • The src/backend/tests/unit/chat/test_tool_calls.py file has been modified to use the ToolDefinition class for tool definitions in test cases.
  • The src/backend/tests/unit/chat/test_tool_calls.py file has been updated to use the ToolDefinition class for tool definitions in test cases.
  • The src/backend/tests/unit/chat/test_tool_calls.py file has been updated to use the ToolDefinition class for tool definitions in test cases.
  • The src/backend/tests/unit/chat/test_tool_calls.py file has been updated to use the ToolDefinition class for tool definitions in test cases.
  • The src/backend/tests/unit/chat/test_tool_calls.py file has been modified to use the ToolDefinition class for tool definitions in test cases.
  • The src/backend/tests/unit/chat/test_tool_calls.py file has been updated to use the ToolDefinition class for tool definitions in test cases.
  • The src/backend/tests/unit/chat/test_tool_calls.py file has been modified to use the ToolDefinition class for tool definitions in test cases.
  • The src/backend/tests/unit/chat/test_tool_calls.py file has been updated to use the ToolDefinition class for tool definitions in test cases.
  • The src/backend/tests/unit/chat/test_tool_calls.py file has been modified to use the ToolDefinition class for tool definitions in test cases.
  • The src/backend/tests/unit/chat/test_tool_calls.py file has been updated to use the ToolDefinition class for tool definitions in test cases.
  • The src/backend/tests/unit/chat/test_tool_calls.py file has been modified to use the ToolDefinition class for tool definitions in test cases.
  • The src/backend/tests/unit/chat/test_tool_calls.py file has been updated to use the ToolDefinition class for tool definitions in test cases.
  • The src/backend/tests/unit/chat/test_tool_calls.py file has been modified to use the ToolDefinition class for tool definitions in test cases.
  • The src/backend/tests/unit/chat/test_tool_calls.py file has been updated to use the ToolDefinition class for tool definitions in test cases.
  • The src/backend/tests/unit/chat/test_tool_calls.py file has been modified to use the ToolDefinition class for tool definitions in test cases.
  • The src/backend/tests/unit/chat/test_tool_calls.py file has been updated to use the ToolDefinition class for tool definitions in test cases.
  • The src/backend/tests/unit/chat/test_tool_calls.py file has been modified to use the ToolDefinition class for tool definitions in test cases.
  • The src/backend/tests/unit/chat/test_tool_calls.py file has been updated to use the ToolDefinition class for tool definitions in test cases.
  • The src/backend/tests/unit/chat/test_tool_calls.py file has been modified to use the ToolDefinition class for tool definitions in test cases.
  • The src/backend/tests/unit/chat/test_tool_calls.py file has been updated to use the ToolDefinition class for tool definitions in test cases.
  • The src/backend/tests/unit/chat/test_tool_calls.py file has been modified to use the ToolDefinition class for tool definitions in test cases.
  • The src/backend/tests/unit/chat/test_tool_calls.py file has been updated to use the ToolDefinition class for tool definitions in test cases.
  • The src/backend/tests/unit/chat/test_tool_calls.py file has been modified to use the ToolDefinition class for tool definitions in test cases.
  • The src/backend/tests/unit/chat/test_tool_calls.py file has been updated to use the ToolDefinition class for tool definitions in test cases.
  • The src/backend/tests/unit/chat/test_tool_calls.py file has been modified to use the ToolDefinition class for tool definitions in test cases.
  • The src/backend/tests/unit/chat/test_tool_calls.py file has been updated to use the ToolDefinition class for tool definitions in test cases.
  • The src/backend/tests/unit/chat/test_tool_calls.py file has been modified to use the ToolDefinition class for tool definitions in test cases.
  • The src/backend/tests/unit/chat/test_tool_calls.py file has been updated to use the ToolDefinition class for tool definitions in test cases.
  • The src/backend/tests/unit/chat/test_tool_calls.py file has been modified to use the ToolDefinition class for tool definitions in test cases.
  • The src/backend/tests/unit/chat/test_tool_calls.py file has been updated to use the ToolDefinition class for tool definitions in test cases.
  • The src/backend/tests/unit/chat/test_tool_calls.py file has been modified to use the ToolDefinition class for tool definitions in test cases.
  • The src/backend/tests/unit/chat/test_tool_calls.py file has been updated to use the ToolDefinition class for tool definitions in test cases.
  • The src/backend/tests/unit/chat/test_tool_calls.py file has been modified to use the ToolDefinition class for tool definitions in test cases.
  • The src/backend/tests/unit/chat/test_tool_calls.py file has been updated to use the ToolDefinition class for tool definitions in test cases.
  • The src/backend/tests/unit/chat/test_tool_calls.py file has been modified to use the ToolDefinition class for tool definitions in test cases.
  • The src/backend/tests/unit/chat/test_tool_calls.py file has been updated to use the ToolDefinition class for tool definitions in test cases.
  • The src/backend/tests/unit/chat/test_tool_calls.py file has been modified to use the ToolDefinition class for tool definitions in test cases.
  • The src/backend/tests/unit/chat/test_tool_calls.py file has been updated to use the ToolDefinition class for tool definitions in test cases.
  • The src/backend/tests/unit/chat/test_tool_calls.py file has been modified to use the ToolDefinition class for tool definitions in test cases.
  • The src/backend/tests/unit/chat/test_tool_calls.py file has been updated to use the ToolDefinition class for tool definitions in test cases.
  • The src/backend/tests/unit/chat/test_tool_calls.py file has been modified to use the ToolDefinition class for tool definitions in test cases.
  • The src/backend/tests/unit/chat/test_tool_calls.py file has been updated to use the ToolDefinition class for tool definitions in test cases.
  • The src/backend/tests/unit/chat/test_tool_calls.py file has been modified to use the ToolDefinition class for tool definitions in test cases.
  • The src/backend/tests/unit/chat/test_tool_calls.py file has been updated to use the ToolDefinition class for tool definitions in test cases.
  • The src/backend/tests/unit/chat/test_tool_calls.py file has been modified to use the ToolDefinition class for tool definitions in test cases.
  • The src/backend/tests/unit/chat/test_tool_calls.py file has been modified to use the ToolDefinition class for tool definitions in test cases.
  • The src/backend/tests/unit/chat/test_tool_calls.py file has been updated to use the ToolDefinition class for tool definitions in test cases.
  • The src/backend/tests/unit/chat/test_tool_calls.py file has been modified to use the ToolDefinition class for tool definitions in test cases.
  • The src/backend/tests/unit/chat/test_tool_calls.py file has been updated to use the ToolDefinition class for tool definitions in test cases.
  • The src/backend/tests/unit/chat/test_tool_calls.py file has been modified to use the ToolDefinition class for tool definitions in test cases.
  • The src/backend/tests/unit/chat/test_tool_calls.py file has been updated to use the ToolDefinition class for tool definitions in test cases.
  • The src/backend/tests/unit/chat/test_tool_calls.py file has been modified to use the ToolDefinition class for tool definitions in test cases.

@codecov-commenter
Copy link

codecov-commenter commented Oct 28, 2024

Codecov Report

Attention: Patch coverage is 64.28571% with 60 lines in your changes missing coverage. Please review.

Project coverage is 53.69%. Comparing base (404f286) to head (c01c05c).

Files with missing lines Patch % Lines
src/backend/tools/tavily_search.py 28.57% 10 Missing ⚠️
src/backend/config/tools.py 76.19% 5 Missing ⚠️
src/backend/routers/auth.py 16.66% 5 Missing ⚠️
src/backend/tools/base.py 72.22% 5 Missing ⚠️
src/backend/tests/unit/routers/test_chat.py 20.00% 4 Missing ⚠️
src/backend/cli/constants.py 0.00% 3 Missing ⚠️
src/backend/routers/tool.py 50.00% 3 Missing ⚠️
src/backend/services/request_validators.py 25.00% 3 Missing ⚠️
src/backend/tools/files.py 75.00% 3 Missing ⚠️
src/backend/chat/custom/custom.py 50.00% 2 Missing ⚠️
... and 15 more
Additional details and impacted files
@@             Coverage Diff             @@
##             main     #822       +/-   ##
===========================================
- Coverage   79.12%   53.69%   -25.43%     
===========================================
  Files         250      204       -46     
  Lines       10673     7762     -2911     
===========================================
- Hits         8445     4168     -4277     
- Misses       2228     3594     +1366     

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

@tianjing-li tianjing-li changed the title WIP backend: Initial tool refactoring - more to come Oct 28, 2024
@tianjing-li tianjing-li changed the title backend: Initial tool refactoring - more to come backend: Tool config improvements - WIP Oct 30, 2024
@tianjing-li tianjing-li changed the title backend: Tool config improvements - WIP backend: Tool config improvements Nov 1, 2024
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