File size: 687 Bytes
99ea28d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import gradio as gr
from agent_app import ask_agent  # Make sure this file exists in your repo

def chat_with_agent(prompt):
    """Handles user queries."""
    try:
        response = ask_agent(prompt)
        return response
    except Exception as e:
        return f"⚠️ Error: {e}"

demo = gr.Interface(
    fn=chat_with_agent,
    inputs=gr.Textbox(label="Ask your Google Sheet Agent", placeholder="e.g., Show me engineers' average MTTR by manager"),
    outputs=gr.Textbox(label="Agent Response"),
    title="Google Sheet Agent",
    description="An AI agent connected to Google Sheets to analyze data and generate summaries."
)

if __name__ == "__main__":
    demo.launch()