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-1249 and TLK-1250 - LlamaIndex file tool and documentation improvements #779

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

Conversation

EugeneLightsOn
Copy link
Collaborator

@EugeneLightsOn EugeneLightsOn commented Sep 18, 2024

LlamaIndex file tool and documentation improvements

AI Description

This PR introduces changes to the configuration and setup documentation, as well as updates to the src/backend/chat/custom/custom.py and src/community/tools/llama_index.py files.

Configuration and Setup Documentation

  • The docs/config_details/config_description.md file is added, providing an explanation of the configuration parameters.
  • The docs/setup.md file is updated to include a link to the configuration parameters explanation.

src/backend/chat/custom/custom.py

  • The get_managed_tools function is modified to accept an optional full_schema parameter.
  • The call_chat function is updated to use the get_managed_tools function with full_schema=True to retrieve managed tools with their full schema.
  • The call_chat function now filters tools based on their category, specifically tools with the Category.FileLoader category.
  • The update_chat_history_with_tool_results function is modified to remove tools based on their category, rather than their name.

src/community/tools/llama_index.py

  • The LlamaIndexUploadPDFRetriever class is updated to use the VectorStoreIndex class for indexing and retrieval.
  • The call method is modified to accept a ctx parameter and use it to retrieve files and user information.
  • The call method now checks for the presence of a query and files before proceeding with retrieval.
  • The call method retrieves files based on their IDs and user ID, ensuring that only relevant files are processed.
  • The call method uses the StringIterableReader to load file content, and the SentenceSplitter to split sentences for embedding and indexing.
  • The call method now returns an empty list if no files are retrieved or if the query is empty.

New Files

  • src/backend/tools/utils/tools_checkers.py: This file contains utility functions for checking tool categories and community tools.
  • src/community/config/tools.py: This file defines the CommunityToolName class, which represents community tools and their configurations.

@EugeneLightsOn EugeneLightsOn force-pushed the eugene/TLK-1249_TLK-TLK-1250-Llama_reader_and_doc_improvements branch from 17dfb41 to 4eb7f12 Compare September 18, 2024 22:06
@codecov-commenter
Copy link

codecov-commenter commented Sep 19, 2024

Codecov Report

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

Project coverage is 80.13%. Comparing base (e6fa042) to head (6f627e3).

Files with missing lines Patch % Lines
src/backend/chat/custom/custom.py 80.00% 2 Missing ⚠️
src/backend/tools/utils/tools_checkers.py 66.66% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #779      +/-   ##
==========================================
- Coverage   80.13%   80.13%   -0.01%     
==========================================
  Files         238      239       +1     
  Lines       10378    10388      +10     
==========================================
+ Hits         8316     8324       +8     
- Misses       2062     2064       +2     

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

Looks great to me, thank you!

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