salmg commited on
Commit
eb1f46c
verified
1 Parent(s): e7a045e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -8
app.py CHANGED
@@ -1,4 +1,4 @@
1
- from agents import Agent, Runner, Tool, function_tool # Llama al SDK de agentes
2
  import gradio as gr
3
  import os
4
  from datetime import datetime
@@ -16,18 +16,18 @@ def add(a: float, b: float):
16
  return {"result": a + b}
17
 
18
  # 4. Registra las herramientas en formato Tool
19
- tools = [
20
- Tool.from_function(get_time, name="get_time",
21
- description="Revisa la hora actual"),
22
- Tool.from_function(add, name="add",
23
- description="Suma dos n煤meros, recibe a y b")
24
- ]
25
 
26
  # 5. Crea el agente, asign谩ndole herramientas y una breve instrucci贸n
27
  agent = Agent(
28
  name="SimpleAgent",
29
  instructions="Eres un asistente que puede revisar la hora y sumar n煤meros.",
30
- tools=tools
31
  )
32
 
33
  # 6. Funci贸n que usa Runner para procesar mensajes
 
1
+ from agents import Agent, Runner, function_tool # Llama al SDK de agentes
2
  import gradio as gr
3
  import os
4
  from datetime import datetime
 
16
  return {"result": a + b}
17
 
18
  # 4. Registra las herramientas en formato Tool
19
+ # tools = [
20
+ # Tool.from_function(get_time, name="get_time",
21
+ # description="Revisa la hora actual"),
22
+ # Tool.from_function(add, name="add",
23
+ # description="Suma dos n煤meros, recibe a y b")
24
+ # ]
25
 
26
  # 5. Crea el agente, asign谩ndole herramientas y una breve instrucci贸n
27
  agent = Agent(
28
  name="SimpleAgent",
29
  instructions="Eres un asistente que puede revisar la hora y sumar n煤meros.",
30
+ tools=[get_time, add]
31
  )
32
 
33
  # 6. Funci贸n que usa Runner para procesar mensajes