Alberto Carmona commited on
Commit
70d0791
·
1 Parent(s): f4631b5

Add agent workflow diagram and enhance agent description in app.py

Browse files
Files changed (2) hide show
  1. agent_diagram.png +0 -0
  2. app.py +28 -3
agent_diagram.png ADDED
app.py CHANGED
@@ -4,16 +4,41 @@ from basic_llama_agent import BasicLammaAgent
4
 
5
  agent_instance = BasicLammaAgent()
6
 
7
- async def llmResponse(message, *args):
 
8
  return await agent_instance(message)
9
 
10
- demo = gr.ChatInterface(
11
  llmResponse,
12
  title="Personalized News Agent",
13
- description="An agent that helps you manage your interests and get personalized news with sentiment, entity analysis, implications, background events, and social media opinion levels.",
 
 
 
 
 
 
 
 
14
  type="messages"
15
  )
16
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
17
 
18
  if __name__ == "__main__":
19
  demo.launch()
 
4
 
5
  agent_instance = BasicLammaAgent()
6
 
7
+
8
+ async def llmResponse(message, *args):
9
  return await agent_instance(message)
10
 
11
+ agent_chat = gr.ChatInterface(
12
  llmResponse,
13
  title="Personalized News Agent",
14
+ description=(
15
+ "A conversational agent that helps you discover and analyze news on topics of your interest. "
16
+ "You can:\n"
17
+ "- Get the latest news articles for your query\n"
18
+ "- Ask for implications of a news article\n"
19
+ "- Request background events leading up to a news story\n"
20
+ "- Explore summarized social media reactions (positive/negative) to news events\n\n"
21
+ "The agent uses tools for news retrieval, implication generation, event chronology, and social sentiment analysis."
22
+ ),
23
  type="messages"
24
  )
25
 
26
+ info_tab = gr.Blocks()
27
+ with info_tab:
28
+ gr.Markdown("# Personalized News Agent")
29
+ gr.Markdown(
30
+ "A conversational agent that helps you discover and analyze news on topics of your interest. "
31
+ "You can:\n"
32
+ "- Get the latest news articles for your query\n"
33
+ "- Ask for implications of a news article\n"
34
+ "- Request background events leading up to a news story\n"
35
+ "- Explore summarized social media reactions (positive/negative) to news events\n\n"
36
+ "The agent uses tools for news retrieval, implication generation, event chronology, and social sentiment analysis.")
37
+ gr.Image(value="agent_diagram.png", label="Agent Workflow Diagram")
38
+
39
+
40
+ demo = gr.TabbedInterface([info_tab, agent_chat], ["Info", "Agent Chat"])
41
+
42
 
43
  if __name__ == "__main__":
44
  demo.launch()