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

[DO NOT MERGE ] Decouple frontend tool config #836

Closed
wants to merge 40 commits into from

Conversation

tianjing-li
Copy link
Collaborator

@tianjing-li tianjing-li commented Nov 8, 2024

Thank you for contributing to the Cohere Toolkit!

  • PR title: "area: description"

    • Where "area" is whichever of interface, frontend, model, tools, backend, etc. is being modified. Use "docs: ..." for purely docs changes, "infra: ..." for CI changes.
    • Example: "deployment: add Azure model option"
  • PR message: Delete this entire checklist and replace with

    • Description: a description of the change
    • Issue: the issue # it fixes, if applicable
    • Dependencies: any dependencies required for this change
  • Add tests and docs: Please include testing and documentation for your changes

  • Lint and test: Run make lint and make run-tests

AI Description

This PR introduces several changes to the codebase, primarily focused on enabling HTTPS for local development and updating the Slack tool configuration.

Enabling HTTPS for Local Development

The PR adds a new section titled "Setup HTTPS for Local Development" in the documentation. It provides instructions for generating a self-signed certificate and key using a specific command in the project root directory. This setup is essential for enabling HTTPS in the local development environment.

Slack Tool Configuration

The PR modifies the src/interfaces/assistants_web/src/constants/tools.ts file to enable the Slack tool in the frontend. It adds the TOOL_SLACK_ID to the AGENT_SETTINGS_TOOLS list and removes it from the BASE_AGENT_EXCLUDED_TOOLS list. This change ensures that the Slack tool is available for use in the frontend.

Tool Visibility and Availability

The PR introduces a new property, is_enabled, in the ToolDefinition class. This property replaces the is_visible property in various files, including src/backend/schemas/tool.py, src/backend/tools/brave_search/tool.py, src/backend/tools/calculator.py, and more. The is_enabled property is used to determine whether a tool is enabled and accessible.

Default Tool Configuration

The PR adds a new property, is_default_tool, to the ToolDefinition class. This property is used to identify default tools. The PR also introduces a new function, getDefaultAgent, in the CohereClient class, which filters and returns default tools based on their names and is_default_tool property.

Other Changes

  • The PR updates the DiscoverAgentCard component to use the checkIsDefaultAgent function instead of checkIsBaseAgent.
  • It removes the BASE_AGENT_TOOLS constant and replaces it with a filter based on the is_default_tool property.
  • The PR adds a new interface, FieldValues, to define the structure of agent settings fields.
  • It also updates the CreateAgent component to use the useListDefaultTool hook and set default tool IDs.
  • The PR removes the BASE_AGENT constant and replaces it with cohereServerClient.getDefaultAgent().

Summary

In summary, the PR focuses on enabling HTTPS for local development, updating Slack tool configuration, and introducing new properties for tool visibility, availability, and default tool configuration. These changes enhance the codebase's functionality and improve the overall user experience.

@codecov-commenter
Copy link

codecov-commenter commented Nov 8, 2024

Codecov Report

Attention: Patch coverage is 60.00000% with 4 lines in your changes missing coverage. Please review.

Project coverage is 79.22%. Comparing base (535a77a) to head (a314980).

Files with missing lines Patch % Lines
src/backend/tests/unit/routers/test_chat.py 0.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #836      +/-   ##
==========================================
- Coverage   79.22%   79.22%   -0.01%     
==========================================
  Files         250      250              
  Lines       10587    10589       +2     
==========================================
+ Hits         8388     8389       +1     
- Misses       2199     2200       +1     

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

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