bmarlin96 commited on
Commit
fe36f09
·
verified ·
1 Parent(s): fe64876

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +22 -1
app.py CHANGED
@@ -8,7 +8,7 @@ from Gradio_UI import GradioUI
8
  import datetime
9
  import pytz
10
  import yaml
11
-
12
  # ✅ This is the CORRECT and SIMPLE agent
13
  from smolagents.agents import CodeAgent
14
  from smolagents import HfApiModel
@@ -20,6 +20,27 @@ from Gradio_UI import GradioUI
20
  # ✅ Define tools directly here
21
  # -----------------------------
22
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
23
  @tool
24
  def my_custom_tool(arg1: str, arg2: int) -> str:
25
  """A tool that does nothing yet
 
8
  import datetime
9
  import pytz
10
  import yaml
11
+ import math
12
  # ✅ This is the CORRECT and SIMPLE agent
13
  from smolagents.agents import CodeAgent
14
  from smolagents import HfApiModel
 
20
  # ✅ Define tools directly here
21
  # -----------------------------
22
 
23
+ @tool
24
+ def sigmoid_transform(x1: float, x2: float, x3: float) -> dict:
25
+ """Applies the sigmoid transformation to three numbers.
26
+
27
+ Args:
28
+ x1: First number
29
+ x2: Second number
30
+ x3: Third number
31
+
32
+ Returns:
33
+ A dictionary with sigmoid-transformed values.
34
+ """
35
+ def sigmoid(x):
36
+ return 1 / (1 + math.exp(-x))
37
+
38
+ return {
39
+ "x1_sigmoid": sigmoid(x1),
40
+ "x2_sigmoid": sigmoid(x2),
41
+ "x3_sigmoid": sigmoid(x3)
42
+ }
43
+
44
  @tool
45
  def my_custom_tool(arg1: str, arg2: int) -> str:
46
  """A tool that does nothing yet