File size: 2,027 Bytes
a74fb91
 
0ff0452
a74fb91
0ff0452
a7ce4c8
70d0791
 
0ff0452
a7ce4c8
70d0791
0ff0452
a7ce4c8
70d0791
 
 
 
 
 
 
 
 
0ff0452
a74fb91
 
70d0791
 
 
 
 
 
 
 
 
 
 
30c6085
9e4c382
30c6085
70d0791
 
 
 
 
a74fb91
 
 
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import gradio as gr

from basic_llama_agent import BasicLammaAgent

agent_instance = BasicLammaAgent()


async def llmResponse(message, *args):
    return await agent_instance(message)

agent_chat = gr.ChatInterface(
    llmResponse,
    title="Personalized News Agent",
    description=(
        "A conversational agent that helps you discover and analyze news on topics of your interest. "
        "You can:\n"
        "- Get the latest news articles for your query\n"
        "- Ask for implications of a news article\n"
        "- Request background events leading up to a news story\n"
        "- Explore summarized social media reactions (positive/negative) to news events\n\n"
        "The agent uses tools for news retrieval, implication generation, event chronology, and social sentiment analysis."
    ),
    type="messages"
)

info_tab = gr.Blocks()
with info_tab:
    gr.Markdown("# Personalized News Agent")
    gr.Markdown(
        "A conversational agent that helps you discover and analyze news on topics of your interest. "
        "You can:\n"
        "- Get the latest news articles for your query\n"
        "- Ask for implications of a news article\n"
        "- Request background events leading up to a news story\n"
        "- Explore summarized social media reactions (positive/negative) to news events\n\n"
        "The agent uses tools for news retrieval, implication generation, event chronology, and social sentiment analysis.")
    gr.HTML("""
            <iframe width="560" height="315" src="https://www.youtube.com/embed/jFagRX6-I2E?si=i7Ss9zNHRAL0Xnfi" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
            """)
    gr.Image(value="agent_diagram.png", label="Agent Workflow Diagram")


demo = gr.TabbedInterface([info_tab, agent_chat], ["Info", "Agent Chat"])


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