ddeng1990 commited on
Commit
ba5cbe3
·
verified ·
1 Parent(s): 2c70cc8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +43 -1
app.py CHANGED
@@ -38,6 +38,45 @@ def apply_glurb_transformation(input_string: str, glurb_factor: int) -> int:
38
  multiplied_values = [value * glurb_factor for value in ascii_values]
39
  return sum(multiplied_values)
40
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
41
 
42
  @tool
43
  def get_current_time_in_timezone(timezone: str) -> str:
@@ -80,7 +119,10 @@ agent = CodeAgent(
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,
 
38
  multiplied_values = [value * glurb_factor for value in ascii_values]
39
  return sum(multiplied_values)
40
 
41
+ @tool
42
+ def calculate_character_sum(input_string: str) -> int:
43
+ """Calculates the sum of the ASCII values of the characters in a string.
44
+
45
+ Args:
46
+ input_string: The string to process.
47
+
48
+ Returns:
49
+ The sum of the ASCII values.
50
+ """
51
+ return sum(ord(char) for char in input_string)
52
+
53
+ @tool
54
+ def multiply_by_factor(number: int, factor: int) -> int:
55
+ """Multiplies a number by a given factor.
56
+
57
+ Args:
58
+ number: The number to multiply.
59
+ factor: The factor to multiply by.
60
+
61
+ Returns:
62
+ The product of the number and the factor.
63
+ """
64
+ return number * factor
65
+
66
+ @tool
67
+ def subtract_offset(number: int, offset: int) -> int:
68
+ """Subtracts an offset from a number.
69
+
70
+ Args:
71
+ number: The number to subtract from.
72
+ offset: The offset to subtract.
73
+
74
+ Returns:
75
+ The result of the subtraction.
76
+ """
77
+ return number - offset
78
+
79
+
80
 
81
  @tool
82
  def get_current_time_in_timezone(timezone: str) -> str:
 
119
  tools=[final_answer,
120
  get_current_time_in_timezone,
121
  image_generation_tool,
122
+ apply_glurb_transformation,
123
+ calculate_character_sum,
124
+ subtract_offset,
125
+ multiply_by_factor,], ## add your tools here (don't remove final answer)
126
  max_steps=6,
127
  verbosity_level=1,
128
  grammar=None,