Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -19,22 +19,24 @@ def my_custom_tool(arg1:str, arg2:int)-> str: #it's import to specify the return
|
|
19 |
return "What magic will you build ?"
|
20 |
|
21 |
@tool
|
22 |
-
def
|
23 |
-
"""
|
|
|
|
|
|
|
|
|
|
|
24 |
|
25 |
Args:
|
26 |
-
|
27 |
-
|
28 |
|
29 |
Returns:
|
30 |
The resulting integer.
|
31 |
"""
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
return reversed_int + magic_number
|
36 |
-
except ValueError:
|
37 |
-
return None # Handle cases where the reversed string is not a valid integer
|
38 |
|
39 |
|
40 |
@tool
|
@@ -78,7 +80,7 @@ agent = CodeAgent(
|
|
78 |
tools=[final_answer,
|
79 |
get_current_time_in_timezone,
|
80 |
image_generation_tool,
|
81 |
-
|
82 |
max_steps=6,
|
83 |
verbosity_level=1,
|
84 |
grammar=None,
|
|
|
19 |
return "What magic will you build ?"
|
20 |
|
21 |
@tool
|
22 |
+
def apply_glurb_transformation(input_string: str, glurb_factor: int) -> int:
|
23 |
+
"""Applies a 'glurb' transformation to a string.
|
24 |
+
|
25 |
+
The 'glurb' transformation involves:
|
26 |
+
1. Converting each character to its ASCII value.
|
27 |
+
2. Multiplying each ASCII value by the 'glurb_factor'.
|
28 |
+
3. Summing the resulting values.
|
29 |
|
30 |
Args:
|
31 |
+
input_string: The string to transform.
|
32 |
+
glurb_factor: The factor to multiply ASCII values by.
|
33 |
|
34 |
Returns:
|
35 |
The resulting integer.
|
36 |
"""
|
37 |
+
ascii_values = [ord(char) for char in input_string]
|
38 |
+
multiplied_values = [value * glurb_factor for value in ascii_values]
|
39 |
+
return sum(multiplied_values)
|
|
|
|
|
|
|
40 |
|
41 |
|
42 |
@tool
|
|
|
80 |
tools=[final_answer,
|
81 |
get_current_time_in_timezone,
|
82 |
image_generation_tool,
|
83 |
+
apply_glurb_transformation], ## add your tools here (don't remove final answer)
|
84 |
max_steps=6,
|
85 |
verbosity_level=1,
|
86 |
grammar=None,
|