Tpayne101 commited on
Commit
8f143f0
·
verified ·
1 Parent(s): c486d43

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -10
app.py CHANGED
@@ -1,19 +1,22 @@
1
  import gradio as gr
2
  from agentos_core import AgentCore
3
 
 
4
  agent = AgentCore()
5
 
6
- def interact(prompt):
7
- response = agent.run(prompt)
8
- return response
 
 
9
 
 
10
  iface = gr.Interface(
11
- fn=interact,
12
- inputs=gr.Textbox(lines=2, placeholder="Type a message to your Agent..."),
13
- outputs="text",
14
- title="AgentOS MVP",
15
- description="Your self-learning AgentCore running with telemetry + memory.",
16
  )
17
 
18
- if __name__ == "__main__":
19
- iface.launch()
 
1
  import gradio as gr
2
  from agentos_core import AgentCore
3
 
4
+ # Initialize your Agent
5
  agent = AgentCore()
6
 
7
+ # Function to handle prompt input/output
8
+ def run_agent(prompt):
9
+ if not prompt or prompt.strip() == "":
10
+ return "⚠️ Please enter a valid prompt."
11
+ return agent.run(prompt)
12
 
13
+ # Launch Gradio interface
14
  iface = gr.Interface(
15
+ fn=run_agent,
16
+ inputs=gr.Textbox(label="Enter Prompt"),
17
+ outputs=gr.Textbox(label="Agent Output"),
18
+ title="🧠 AgentOS MVP",
19
+ description="Your self-learning AgentCore running with telemetry + memory."
20
  )
21
 
22
+ iface.launch()