Skip to content

Commit

Permalink
Fixed a tool and added removing old tools
Browse files Browse the repository at this point in the history
  • Loading branch information
onuratakan committed Apr 9, 2024
1 parent 441b3f7 commit 8342508
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
10 changes: 9 additions & 1 deletion tiger/public_tiger.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,22 @@ def get_file_dict(directory):
import inspect
import dill


currently_index = tiger_client.get_all()

for each in get_file_dict(directory).values():
tool_name = each["tool_name"]
tool_obj = each["tool_obj"]
tool_requirements = each["tool_requirements"]


if tool_name in currently_index:
currently_index.delete(tool_name)

tiger_client.set(tool_name, tool_obj)
tiger_client.clear_requirements(tool_name)
[tiger_client.add_requirement(tool_name, requirement) for requirement in tool_requirements]
print(tool_name)


for each in currently_index:
tiger_client.delete(each)
2 changes: 1 addition & 1 deletion tiger/tools/search/duckduckgo.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ def search(query:str, max_number:int=20) -> list:
return [result["href"] for result in DDGS().text(query, max_results=max_number)]


tool_name = "system.duckduckgo"
tool_name = "search.duckduckgo"
tool_obj = search
tool_requirements = ["duckduckgo-search==5.3.0"]

0 comments on commit 8342508

Please sign in to comment.