Update app.py
Browse files
app.py
CHANGED
|
@@ -1,17 +1,17 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
-
|
| 3 |
-
from agents.process_aware_agent import build_agent # adapt to your actual API
|
| 4 |
-
|
| 5 |
-
agent = create_agent_graph()
|
| 6 |
|
| 7 |
def chat_fn(message, history):
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
return
|
| 12 |
-
return str(result)
|
| 13 |
|
| 14 |
-
demo = gr.ChatInterface(
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
|
| 16 |
if __name__ == "__main__":
|
| 17 |
demo.launch(server_name="0.0.0.0", server_port=7860)
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
+
from agents.process_aware_agent import run_agent
|
|
|
|
|
|
|
|
|
|
| 3 |
|
| 4 |
def chat_fn(message, history):
|
| 5 |
+
try:
|
| 6 |
+
return run_agent(message)
|
| 7 |
+
except Exception as e:
|
| 8 |
+
return f"Error: {str(e)}"
|
|
|
|
| 9 |
|
| 10 |
+
demo = gr.ChatInterface(
|
| 11 |
+
fn=chat_fn,
|
| 12 |
+
title="Process-Aware LangGraph Agent",
|
| 13 |
+
description="Chat with a process-aware LangGraph agent."
|
| 14 |
+
)
|
| 15 |
|
| 16 |
if __name__ == "__main__":
|
| 17 |
demo.launch(server_name="0.0.0.0", server_port=7860)
|