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

Clean up existing tools to prepare for GentPool #21

Merged
merged 1 commit into from
Jun 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions gentopia/tools/__init__.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,15 @@
from .basetool import BaseTool
from .calculator import Calculator
from .doc_store_look_up import DocStoreLookUp
# from .dummy_tool import DummyTool
from .google_search import GoogleSearch
from .llm import LLM
from .search_doc import SearchDoc
from .wikipedia import Wikipedia
from .wolfram_alpha import WolframAlpha
from .zip_code import ZipCodeRetriever


def load_tools(name: str) -> BaseTool:
if name == "calculator":
return Calculator
elif name == "doc_store_look_up":
return DocStoreLookUp
elif name == "google_search":
return GoogleSearch
elif name == "llm":
Expand All @@ -25,7 +20,5 @@ def load_tools(name: str) -> BaseTool:
return Wikipedia
elif name == "wolfram_alpha":
return WolframAlpha
elif name == "zip_code":
return ZipCodeRetriever
else:
raise NotImplementedError
22 changes: 0 additions & 22 deletions gentopia/tools/doc_store_look_up.py

This file was deleted.

1 change: 0 additions & 1 deletion gentopia/tools/dummy_tool.py

This file was deleted.

7 changes: 3 additions & 4 deletions gentopia/tools/search_doc.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,9 @@ class SearchDoc(BaseTool):
name = "SearchDoc"
args_schema: Optional[Type[BaseModel]] = create_model("SearchDocArgs", query=(str, ...))
doc_path: Optional[str] = None
doc_name: Optional[str] = None
description: str = f"A vector store that searches for similar and related content in document: {doc_name}. " \
f"The result is a huge chunk of text related to your search but can also " \
f"contain irrelevant info. Input should be a search query."
doc_name: Optional[str] = ""
description: str = f"A search engine looking for relevant text chunk in a document: {doc_name}. " \
f"Input should be a search query."

def _run(self, query: AnyStr) -> AnyStr:
loader = TextLoader(self.doc_path)
Expand Down
40 changes: 0 additions & 40 deletions gentopia/tools/zip_code.py

This file was deleted.