sharsh02 commited on
Commit
55af743
1 Parent(s): 7dfa3aa

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -2
app.py CHANGED
@@ -571,6 +571,17 @@ def generate_final_response(prompt, history, context_files=[], ticker_stats=[],
571
  except Exception as e:
572
  yield f"Sorry, your query couldn't be processed. Retry with correct name of stock - An error occurred: {e}"
573
 
 
 
 
 
 
 
 
 
 
 
 
574
 
575
  theme ="JohnSmith9982/small_and_pretty"
576
 
@@ -613,11 +624,13 @@ my_chatbot = gr.Chatbot(
613
  line_breaks=False,
614
  likeable=True,
615
  layout="panel",
616
- placeholder = PLACEHOLDER
 
617
  )
618
 
619
  demo = gr.ChatInterface(
620
- fn=generate_final_response,
 
621
  chatbot=my_chatbot,
622
  title = '<h1 style="color: #FFFFFF; font-weight: bold; font-family: \'Arial\', sans-serif; text-align: center;">StockX</h1>',
623
  theme=theme,
 
571
  except Exception as e:
572
  yield f"Sorry, your query couldn't be processed. Retry with correct name of stock - An error occurred: {e}"
573
 
574
+
575
+ def initial_conversation():
576
+ return [
577
+ (None, "Welcome! I'm your AI assistant for Indian market research and stock analysis. Here's how you can use me:\n\n"
578
+ "1. You can ask queries like:\n"
579
+ " > What is the market news today?\n"
580
+ " > How is HCL share performing?\n"
581
+ " > Compare the financial performance of infosys and cyient?\n"
582
+ " > Who are the promoters of brightcomm group?\n"
583
+ "2. For any queries feel free to reach out [email protected] or sharad-deep-shukla on linkedin\n\n"
584
+ "3. To get started, ask about any indian stock!")
585
 
586
  theme ="JohnSmith9982/small_and_pretty"
587
 
 
624
  line_breaks=False,
625
  likeable=True,
626
  layout="panel",
627
+ placeholder = PLACEHOLDER,
628
+ value=initial_conversation()
629
  )
630
 
631
  demo = gr.ChatInterface(
632
+ fn=generate_final_response,
633
+ textbox=gr.MultimodalTextbox(lines=5, max_lines=30, container=False, placeholder="Type question to be answered by your AI assistent"),
634
  chatbot=my_chatbot,
635
  title = '<h1 style="color: #FFFFFF; font-weight: bold; font-family: \'Arial\', sans-serif; text-align: center;">StockX</h1>',
636
  theme=theme,