BroBro87 commited on
Commit
a2464d8
·
verified ·
1 Parent(s): 37e3995

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -1
app.py CHANGED
@@ -42,7 +42,13 @@ def find_hackernews_posts(message,history):
42
  )
43
 
44
  result = crew.kickoff()
45
- return result
 
 
 
 
 
 
46
 
47
  chat_interface = gr.ChatInterface(
48
  fn=find_hackernews_posts,
 
42
  )
43
 
44
  result = crew.kickoff()
45
+ formatted_result = "Here are some relevant Hacker News posts:\n\n"
46
+ for post in result.__str__.split('\n'):
47
+ if post.strip():
48
+ formatted_result += f"• {post.strip()}\n"
49
+
50
+ # Return the result in the format expected by the Chatbot component
51
+ return [(message, formatted_result)]
52
 
53
  chat_interface = gr.ChatInterface(
54
  fn=find_hackernews_posts,