Spaces:
Sleeping
Sleeping
| 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() | |