ktluege commited on
Commit
eb0b446
Β·
verified Β·
1 Parent(s): 297d17d

Update agent.py

Browse files
Files changed (1) hide show
  1. agent.py +20 -5
agent.py CHANGED
@@ -14,17 +14,32 @@ load_dotenv()
14
 
15
  # ========== TOOLS ==========
16
  @tool
17
- def multiply(a: int, b: int) -> int: return a * b
 
 
 
18
  @tool
19
- def add(a: int, b: int) -> int: return a + b
 
 
 
20
  @tool
21
- def subtract(a: int, b: int) -> int: return a - b
 
 
 
22
  @tool
23
  def divide(a: int, b: int) -> float:
24
- if b == 0: raise ValueError("Cannot divide by zero.")
 
 
25
  return a / b
 
26
  @tool
27
- def modulus(a: int, b: int) -> int: return a % b
 
 
 
28
  @tool
29
  def wiki_search(query: str) -> str:
30
  search_docs = WikipediaLoader(query=query, load_max_docs=2).load()
 
14
 
15
  # ========== TOOLS ==========
16
  @tool
17
+ def multiply(a: int, b: int) -> int:
18
+ """Multiply two integers."""
19
+ return a * b
20
+
21
  @tool
22
+ def add(a: int, b: int) -> int:
23
+ """Add two integers."""
24
+ return a + b
25
+
26
  @tool
27
+ def subtract(a: int, b: int) -> int:
28
+ """Subtract two integers."""
29
+ return a - b
30
+
31
  @tool
32
  def divide(a: int, b: int) -> float:
33
+ """Divide two numbers. Raises ValueError if dividing by zero."""
34
+ if b == 0:
35
+ raise ValueError("Cannot divide by zero.")
36
  return a / b
37
+
38
  @tool
39
+ def modulus(a: int, b: int) -> int:
40
+ """Compute modulus (remainder) of two integers."""
41
+ return a % b
42
+
43
  @tool
44
  def wiki_search(query: str) -> str:
45
  search_docs = WikipediaLoader(query=query, load_max_docs=2).load()