Skip to content

Commit

Permalink
added Minimap integration
Browse files Browse the repository at this point in the history
  • Loading branch information
ClaytonSmith committed Jun 17, 2024
1 parent 7a954d1 commit d2915f2
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
22 changes: 20 additions & 2 deletions src/backend/config/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,14 @@
ReadFileTool,
SearchFileTool,
TavilyInternetSearch,
LangChainMinimapRetriever
)

"""
List of available tools. Each tool should have a name, implementation, is_visible and category.
List of available tools. Each tool should have a name, implementation, is_visible and category.
They can also have kwargs if necessary.
You can switch the visibility of a tool by changing the is_visible parameter to True or False.
You can switch the visibility of a tool by changing the is_visible parameter to True or False.
If a tool is not visible, it will not be shown in the frontend.
If you want to add a new tool, check the instructions on how to implement a retriever in the documentation.
Expand All @@ -32,6 +33,7 @@ class ToolName(StrEnum):
Python_Interpreter = "Python_Interpreter"
Calculator = "Calculator"
Tavily_Internet_Search = "Internet_Search"
MiniMap = "MiniMap"


ALL_TOOLS = {
Expand All @@ -52,6 +54,22 @@ class ToolName(StrEnum):
category=Category.DataLoader,
description="Retrieves documents from Wikipedia using LangChain.",
),
ToolName.MiniMap: ManagedTool(
name=ToolName.MiniMap,
implementation=LangChainMinimapRetriever,
parameter_definitions={
"query": {
"description": "Query for searching the news. It can be a topic, a named entities, or a quoted keyword.",
"type": "str",
"required": True,
}
},
is_visible=True,
is_available=LangChainMinimapRetriever.is_available(),
error_message="Minimap API not available.",
category=Category.DataLoader,
description="Fetches the most relevant news and content from Minimap.ai.",
),
ToolName.Search_File: ManagedTool(
name=ToolName.Search_File,
implementation=SearchFileTool,
Expand Down
2 changes: 2 additions & 0 deletions src/backend/tools/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from backend.tools.lang_chain import LangChainVectorDBRetriever, LangChainWikiRetriever
from backend.tools.python_interpreter import PythonInterpreter
from backend.tools.tavily import TavilyInternetSearch
from backend.tools.minimap import LangChainMinimapRetriever

__all__ = [
"Calculator",
Expand All @@ -12,4 +13,5 @@
"TavilyInternetSearch",
"ReadFileTool",
"SearchFileTool",
"LangChainMinimapRetriever",
]

0 comments on commit d2915f2

Please sign in to comment.