Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,40 +1,19 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
from agentos_core import AgentCore
|
| 3 |
|
| 4 |
-
|
| 5 |
-
# Create your first agent instance
|
| 6 |
-
agent = AgentCore()
|
| 7 |
-
|
| 8 |
-
# Test prompt
|
| 9 |
-
test_prompt = "Hello Agent, summarize what you are."
|
| 10 |
-
response = agent.run(test_prompt)
|
| 11 |
|
| 12 |
-
|
| 13 |
-
|
|
|
|
| 14 |
|
| 15 |
iface = gr.Interface(
|
| 16 |
fn=interact,
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
if prompt.lower() in ["exit", "quit"]:
|
| 23 |
-
print("Exiting Agent...")
|
| 24 |
-
break
|
| 25 |
|
| 26 |
-
response = agent.run(prompt)
|
| 27 |
-
print("Agent:", response)
|
| 28 |
-
|
| 29 |
-
iface.launch()
|
| 30 |
if __name__ == "__main__":
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
while True:
|
| 34 |
-
prompt = input("You: ")
|
| 35 |
-
if prompt.lower() in ["exit", "quit"]:
|
| 36 |
-
print("Exiting Agent...")
|
| 37 |
-
break
|
| 38 |
-
|
| 39 |
-
response = agent.run(prompt)
|
| 40 |
-
print("Agent:", response)
|
|
|
|
| 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()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|