File size: 780 Bytes
371b61f
 
 
 
 
 
 
 
 
 
 
 
fe1d5fb
371b61f
 
 
fe1d5fb
371b61f
 
 
 
 
fe1d5fb
 
371b61f
 
 
 
20c725a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import os
import sys
import gradio as gr

from dotenv import load_dotenv
load_dotenv()
sys.path.append('./phidata')

from agents.research_agent import research_agent

def query_research_agent(user_query):
    if not user_query.strip():
        return "Please enter a research topic."
    try:
        return research_agent.run(input=user_query)
    except Exception as e:
        return f"Error: {str(e)}"

iface = gr.Interface(
    fn=query_research_agent,
    inputs=gr.Textbox(lines=2, placeholder="Enter your research query here..."),
    outputs="text",
    title="Exa Research Agent",
    description="This AI agent uses Exa.ai to search the web for research articles and returns concise results.",
    allow_flagging="never"
)

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