Spaces:
Sleeping
Sleeping
remove useless tools
Browse files
agent.py
CHANGED
|
@@ -18,58 +18,6 @@ from supabase.client import Client, create_client
|
|
| 18 |
|
| 19 |
load_dotenv()
|
| 20 |
|
| 21 |
-
@tool
|
| 22 |
-
def multiply(a: int, b: int) -> int:
|
| 23 |
-
"""Multiply two numbers.
|
| 24 |
-
|
| 25 |
-
Args:
|
| 26 |
-
a: first int
|
| 27 |
-
b: second int
|
| 28 |
-
"""
|
| 29 |
-
return a * b
|
| 30 |
-
|
| 31 |
-
@tool
|
| 32 |
-
def add(a: int, b: int) -> int:
|
| 33 |
-
"""Add two numbers.
|
| 34 |
-
|
| 35 |
-
Args:
|
| 36 |
-
a: first int
|
| 37 |
-
b: second int
|
| 38 |
-
"""
|
| 39 |
-
return a + b
|
| 40 |
-
|
| 41 |
-
@tool
|
| 42 |
-
def subtract(a: int, b: int) -> int:
|
| 43 |
-
"""Subtract two numbers.
|
| 44 |
-
|
| 45 |
-
Args:
|
| 46 |
-
a: first int
|
| 47 |
-
b: second int
|
| 48 |
-
"""
|
| 49 |
-
return a - b
|
| 50 |
-
|
| 51 |
-
@tool
|
| 52 |
-
def divide(a: int, b: int) -> int:
|
| 53 |
-
"""Divide two numbers.
|
| 54 |
-
|
| 55 |
-
Args:
|
| 56 |
-
a: first int
|
| 57 |
-
b: second int
|
| 58 |
-
"""
|
| 59 |
-
if b == 0:
|
| 60 |
-
raise ValueError("Cannot divide by zero.")
|
| 61 |
-
return a / b
|
| 62 |
-
|
| 63 |
-
@tool
|
| 64 |
-
def modulus(a: int, b: int) -> int:
|
| 65 |
-
"""Get the modulus of two numbers.
|
| 66 |
-
|
| 67 |
-
Args:
|
| 68 |
-
a: first int
|
| 69 |
-
b: second int
|
| 70 |
-
"""
|
| 71 |
-
return a % b
|
| 72 |
-
|
| 73 |
@tool
|
| 74 |
def wiki_search(query: str) -> str:
|
| 75 |
"""Search Wikipedia for a query and return maximum 2 results.
|
|
@@ -138,14 +86,7 @@ create_retriever_tool = create_retriever_tool(
|
|
| 138 |
description="A tool to retrieve similar questions from a vector store.",
|
| 139 |
)
|
| 140 |
|
| 141 |
-
|
| 142 |
-
|
| 143 |
tools = [
|
| 144 |
-
multiply,
|
| 145 |
-
add,
|
| 146 |
-
subtract,
|
| 147 |
-
divide,
|
| 148 |
-
modulus,
|
| 149 |
wiki_search,
|
| 150 |
web_search,
|
| 151 |
arvix_search,
|
|
|
|
| 18 |
|
| 19 |
load_dotenv()
|
| 20 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
@tool
|
| 22 |
def wiki_search(query: str) -> str:
|
| 23 |
"""Search Wikipedia for a query and return maximum 2 results.
|
|
|
|
| 86 |
description="A tool to retrieve similar questions from a vector store.",
|
| 87 |
)
|
| 88 |
|
|
|
|
|
|
|
| 89 |
tools = [
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 90 |
wiki_search,
|
| 91 |
web_search,
|
| 92 |
arvix_search,
|