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

GitHub tool #931

Merged
merged 20 commits into from
Jan 30, 2025
Merged

GitHub tool #931

merged 20 commits into from
Jan 30, 2025

Conversation

EugeneLightsOn
Copy link
Collaborator

@EugeneLightsOn EugeneLightsOn commented Jan 30, 2025

Github tool implementation

AI Description

This PR adds support for the GitHub tool to the application.

Changes

  • A new file docs/custom_tool_guides/github.md is added, which provides instructions for setting up the GitHub tool.
  • The README.md file is updated to include a link to the new GitHub tool setup guide.
  • The poetry.lock file is modified to add the pygithub package, which is required for interacting with the GitHub API.
  • The pyproject.toml file is updated to include the pygithub package as a dependency.
  • The src/backend/chat/collate.py file is modified to import the ToolError class from backend.tools.base.
  • The src/backend/config/configuration.template.yaml file is updated to include GitHub-related configuration settings.
  • The src/backend/config/default_agent.py file is modified to include the Tool.Github.value.ID in the list of available tools.
  • The src/backend/config/secrets.template.yaml file is updated to include GitHub-related configuration settings.
  • The src/backend/config/settings.py file is modified to include a new class GithubSettings for managing GitHub-related settings.
  • The src/backend/config/tools.py file is updated to import the GithubTool class from backend.tools.github.tool.
  • The src/backend/main.py file is modified to use the settings object instead of Settings().get('auth.secret_key') for retrieving the authentication secret key.
  • New files src/backend/tools/github/__init__.py, src/backend/tools/github/auth.py, src/backend/tools/github/client.py, src/backend/tools/github/constants.py, src/backend/tools/github/tool.py, and src/backend/tools/github/utils.py are added, which provide the implementation of the GitHub tool.
  • The src/backend/tools/slack/tool.py file is updated to include the should_return_token parameter in the get_tool_definition method.
  • The src/interfaces/assistants_web/src/app/(main)/settings/Settings.tsx file is modified to import the TOOL_GITHUB_ID constant and use it in the Settings component.
  • The src/interfaces/assistants_web/src/assets/icons/Github.tsx file is added, which provides the SVG icon for the GitHub tool.
  • The src/interfaces/assistants_web/src/components/UI/Icon.tsx file is updated to include the Github icon in the IconList and the corresponding implementation in the getIcon function.
  • The src/interfaces/assistants_web/src/constants/tools.ts file is modified to include the TOOL_GITHUB_ID constant and the corresponding icon mapping in the TOOL_ID_TO_DISPLAY_INFO object.

Summary

The PR adds support for the GitHub tool, which allows users to search for repositories on GitHub. The changes include adding new files for the GitHub tool implementation, updating existing files to include GitHub-related configuration settings, and modifying the UI to include the GitHub tool in the list of available tools.

@EugeneLightsOn EugeneLightsOn changed the title Eugene/tlk 2709 add GitHub tool GitHub tool Jan 30, 2025
@codecov-commenter
Copy link

codecov-commenter commented Jan 30, 2025

Codecov Report

Attention: Patch coverage is 45.89372% with 112 lines in your changes missing coverage. Please review.

Project coverage is 80.66%. Comparing base (083a0af) to head (afcf1e0).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/backend/tools/github/auth.py 35.52% 49 Missing ⚠️
src/backend/tools/github/utils.py 32.65% 33 Missing ⚠️
src/backend/tools/github/tool.py 57.14% 18 Missing ⚠️
src/backend/tools/github/client.py 50.00% 11 Missing ⚠️
src/backend/main.py 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #931      +/-   ##
==========================================
- Coverage   81.29%   80.66%   -0.63%     
==========================================
  Files         281      286       +5     
  Lines       11477    11679     +202     
==========================================
+ Hits         9330     9421      +91     
- Misses       2147     2258     +111     

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

docs/custom_tool_guides/github.md Outdated Show resolved Hide resolved
src/backend/chat/collate.py Outdated Show resolved Hide resolved
src/backend/config/default_agent.py Outdated Show resolved Hide resolved
src/backend/tools/github/client.py Outdated Show resolved Hide resolved
src/backend/tools/base.py Outdated Show resolved Hide resolved
@EugeneLightsOn EugeneLightsOn merged commit 29f614e into main Jan 30, 2025
8 checks passed
@EugeneLightsOn EugeneLightsOn deleted the eugene/tlk-2709-add-github-tool branch January 30, 2025 17:43
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