Spaces:
Runtime error
Runtime error
Update agent.py
Browse files
agent.py
CHANGED
|
@@ -7,20 +7,20 @@ class add(Tool):
|
|
| 7 |
This tool adds two integers together and returns an integer.
|
| 8 |
|
| 9 |
Args:
|
| 10 |
-
a: first
|
| 11 |
-
b: second
|
| 12 |
"""
|
| 13 |
inputs = {
|
| 14 |
"a":{
|
| 15 |
-
"type":"
|
| 16 |
-
"description":"first
|
| 17 |
},
|
| 18 |
"b":{
|
| 19 |
-
"type":"
|
| 20 |
-
"description":"second
|
| 21 |
}
|
| 22 |
}
|
| 23 |
-
output_type = "
|
| 24 |
|
| 25 |
def forward(self, a: int, b: int):
|
| 26 |
return a + b
|
|
@@ -32,20 +32,20 @@ class subtract(Tool):
|
|
| 32 |
This tool subtracts two integers and returns an integer.
|
| 33 |
|
| 34 |
Args:
|
| 35 |
-
a: first
|
| 36 |
-
b: second
|
| 37 |
"""
|
| 38 |
inputs = {
|
| 39 |
"a":{
|
| 40 |
-
"type":"
|
| 41 |
-
"description":"first
|
| 42 |
},
|
| 43 |
"b":{
|
| 44 |
-
"type":"
|
| 45 |
-
"description":"second
|
| 46 |
}
|
| 47 |
}
|
| 48 |
-
output_type = "
|
| 49 |
|
| 50 |
def forward(self, a: int, b: int):
|
| 51 |
return a - b
|
|
@@ -56,20 +56,20 @@ class multiply(Tool):
|
|
| 56 |
This tool multiplies two integers and returns an integer.
|
| 57 |
|
| 58 |
Args:
|
| 59 |
-
a: first
|
| 60 |
-
b: second
|
| 61 |
"""
|
| 62 |
inputs = {
|
| 63 |
"a":{
|
| 64 |
-
"type":"
|
| 65 |
-
"description":"first
|
| 66 |
},
|
| 67 |
"b":{
|
| 68 |
-
"type":"
|
| 69 |
-
"description":"second
|
| 70 |
}
|
| 71 |
}
|
| 72 |
-
output_type = "
|
| 73 |
|
| 74 |
def forward(self, a: int, b: int):
|
| 75 |
return a * b
|
|
@@ -80,20 +80,20 @@ class divide(Tool):
|
|
| 80 |
This tool divides two integers and returns an integer.
|
| 81 |
|
| 82 |
Args:
|
| 83 |
-
a: first
|
| 84 |
-
b: second
|
| 85 |
"""
|
| 86 |
inputs = {
|
| 87 |
"a":{
|
| 88 |
-
"type":"
|
| 89 |
-
"description":"first
|
| 90 |
},
|
| 91 |
"b":{
|
| 92 |
-
"type":"
|
| 93 |
-
"description":"second
|
| 94 |
}
|
| 95 |
}
|
| 96 |
-
output_type = "
|
| 97 |
|
| 98 |
def forward(self, a: int, b: int):
|
| 99 |
if b == 0:
|
|
@@ -106,20 +106,20 @@ class modulo(Tool):
|
|
| 106 |
This tool returns the modulus of two integers
|
| 107 |
|
| 108 |
Args:
|
| 109 |
-
a: first
|
| 110 |
-
b: second
|
| 111 |
"""
|
| 112 |
inputs = {
|
| 113 |
"a":{
|
| 114 |
-
"type":"
|
| 115 |
-
"description":"first
|
| 116 |
},
|
| 117 |
"b":{
|
| 118 |
-
"type":"
|
| 119 |
-
"description":"second
|
| 120 |
}
|
| 121 |
}
|
| 122 |
-
output_type = "
|
| 123 |
|
| 124 |
def forward(self, a: int, b: int):
|
| 125 |
return a % b
|
|
|
|
| 7 |
This tool adds two integers together and returns an integer.
|
| 8 |
|
| 9 |
Args:
|
| 10 |
+
a: first integer
|
| 11 |
+
b: second integer
|
| 12 |
"""
|
| 13 |
inputs = {
|
| 14 |
"a":{
|
| 15 |
+
"type":"integer",
|
| 16 |
+
"description":"first integer"
|
| 17 |
},
|
| 18 |
"b":{
|
| 19 |
+
"type":"integer",
|
| 20 |
+
"description":"second integer"
|
| 21 |
}
|
| 22 |
}
|
| 23 |
+
output_type = "integer"
|
| 24 |
|
| 25 |
def forward(self, a: int, b: int):
|
| 26 |
return a + b
|
|
|
|
| 32 |
This tool subtracts two integers and returns an integer.
|
| 33 |
|
| 34 |
Args:
|
| 35 |
+
a: first integer
|
| 36 |
+
b: second integer
|
| 37 |
"""
|
| 38 |
inputs = {
|
| 39 |
"a":{
|
| 40 |
+
"type":"integer",
|
| 41 |
+
"description":"first integer"
|
| 42 |
},
|
| 43 |
"b":{
|
| 44 |
+
"type":"integer",
|
| 45 |
+
"description":"second integer"
|
| 46 |
}
|
| 47 |
}
|
| 48 |
+
output_type = "integer"
|
| 49 |
|
| 50 |
def forward(self, a: int, b: int):
|
| 51 |
return a - b
|
|
|
|
| 56 |
This tool multiplies two integers and returns an integer.
|
| 57 |
|
| 58 |
Args:
|
| 59 |
+
a: first integer
|
| 60 |
+
b: second integer
|
| 61 |
"""
|
| 62 |
inputs = {
|
| 63 |
"a":{
|
| 64 |
+
"type":"integer",
|
| 65 |
+
"description":"first integer"
|
| 66 |
},
|
| 67 |
"b":{
|
| 68 |
+
"type":"integer",
|
| 69 |
+
"description":"second integer"
|
| 70 |
}
|
| 71 |
}
|
| 72 |
+
output_type = "integer"
|
| 73 |
|
| 74 |
def forward(self, a: int, b: int):
|
| 75 |
return a * b
|
|
|
|
| 80 |
This tool divides two integers and returns an integer.
|
| 81 |
|
| 82 |
Args:
|
| 83 |
+
a: first integer
|
| 84 |
+
b: second integer
|
| 85 |
"""
|
| 86 |
inputs = {
|
| 87 |
"a":{
|
| 88 |
+
"type":"integer",
|
| 89 |
+
"description":"first integer"
|
| 90 |
},
|
| 91 |
"b":{
|
| 92 |
+
"type":"integer",
|
| 93 |
+
"description":"second integer"
|
| 94 |
}
|
| 95 |
}
|
| 96 |
+
output_type = "integer"
|
| 97 |
|
| 98 |
def forward(self, a: int, b: int):
|
| 99 |
if b == 0:
|
|
|
|
| 106 |
This tool returns the modulus of two integers
|
| 107 |
|
| 108 |
Args:
|
| 109 |
+
a: first integer
|
| 110 |
+
b: second integer
|
| 111 |
"""
|
| 112 |
inputs = {
|
| 113 |
"a":{
|
| 114 |
+
"type":"integer",
|
| 115 |
+
"description":"first integer"
|
| 116 |
},
|
| 117 |
"b":{
|
| 118 |
+
"type":"integer",
|
| 119 |
+
"description":"second integer"
|
| 120 |
}
|
| 121 |
}
|
| 122 |
+
output_type = "integer"
|
| 123 |
|
| 124 |
def forward(self, a: int, b: int):
|
| 125 |
return a % b
|