salmg commited on
Commit
fda2e6d
verified
1 Parent(s): ab4c3ae

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -6
app.py CHANGED
@@ -4,16 +4,16 @@ import gradio as gr
4
 
5
  @function_tool
6
  def get_weather(city: str) -> str:
7
- return f"The weather in {city} is sunny"
8
 
9
  agent = Agent(
10
- name="Haiku agent",
11
- instructions="Always respond in haiku form",
12
- model="o3-mini",
13
  tools=[get_weather],
14
  )
15
 
16
- # 馃憞 Esta funci贸n es ahora as铆ncrona
17
  async def chat_fn(user_message, history):
18
  context = {"history": history}
19
  result = await Runner.run(agent, user_message, context=context)
@@ -21,7 +21,6 @@ async def chat_fn(user_message, history):
21
 
22
  demo = gr.ChatInterface(
23
  fn=chat_fn,
24
- title="Agente Simple con OpenAI Agents SDK",
25
  description="Pregunta el clima.",
26
  )
27
 
 
4
 
5
  @function_tool
6
  def get_weather(city: str) -> str:
7
+ return f"El clima en {city} es diferente!"
8
 
9
  agent = Agent(
10
+ name="Agente de ciberseguridad",
11
+ instructions="Siempre responde pensando de forma critica y en tono profesinal, eres un agente de ciberseguridad.",
12
+ model="gpt-4.1-mini",
13
  tools=[get_weather],
14
  )
15
 
16
+ # Funci贸n as铆ncrona
17
  async def chat_fn(user_message, history):
18
  context = {"history": history}
19
  result = await Runner.run(agent, user_message, context=context)
 
21
 
22
  demo = gr.ChatInterface(
23
  fn=chat_fn,
 
24
  description="Pregunta el clima.",
25
  )
26