rchrdgwr commited on
Commit
ef651f8
1 Parent(s): 286e1c9

customer research

Browse files
__pycache__/app.cpython-311.pyc CHANGED
Binary files a/__pycache__/app.cpython-311.pyc and b/__pycache__/app.cpython-311.pyc differ
 
__pycache__/classes.cpython-311.pyc CHANGED
Binary files a/__pycache__/classes.cpython-311.pyc and b/__pycache__/classes.cpython-311.pyc differ
 
__pycache__/utils_customer_research.cpython-311.pyc CHANGED
Binary files a/__pycache__/utils_customer_research.cpython-311.pyc and b/__pycache__/utils_customer_research.cpython-311.pyc differ
 
__pycache__/utils_objections.cpython-311.pyc CHANGED
Binary files a/__pycache__/utils_objections.cpython-311.pyc and b/__pycache__/utils_objections.cpython-311.pyc differ
 
app.py CHANGED
@@ -23,6 +23,15 @@ openai_api_key = os.getenv("OPENAI_API_KEY")
23
  tavily_api_key = os.getenv("TAVILY_API_KEY")
24
  langchain_api_key = os.getenv("LANGCHAIN_API_KEY")
25
 
 
 
 
 
 
 
 
 
 
26
  llm_model = "gpt-4o-mini"
27
  set_llm_cache(InMemoryCache())
28
  client = OpenAI(api_key=openai_api_key)
@@ -80,6 +89,7 @@ async def on_action_display_queries_responses(action):
80
  @cl.on_chat_start
81
  async def on_chat_start():
82
  session_state = SessionState()
 
83
  cl.user_session.set("session_state", session_state)
84
  session_state.llm_model = llm_model
85
  print(session_state)
 
23
  tavily_api_key = os.getenv("TAVILY_API_KEY")
24
  langchain_api_key = os.getenv("LANGCHAIN_API_KEY")
25
 
26
+ def set_session_state_variables(session_state):
27
+ if "DO_CUSTOMER_RESEARCH" in os.environ:
28
+ do_customer_research = os.getenv("DO_CUSTOMER_RESEARCH")
29
+ if do_customer_research.lower() == "true":
30
+ session_state.do_customer_research = True
31
+ else:
32
+ session_state.do_customer_research = False
33
+
34
+
35
  llm_model = "gpt-4o-mini"
36
  set_llm_cache(InMemoryCache())
37
  client = OpenAI(api_key=openai_api_key)
 
89
  @cl.on_chat_start
90
  async def on_chat_start():
91
  session_state = SessionState()
92
+ set_session_state_variables(session_state)
93
  cl.user_session.set("session_state", session_state)
94
  session_state.llm_model = llm_model
95
  print(session_state)
classes.py CHANGED
@@ -8,8 +8,8 @@ class SessionState:
8
  ask_objections = True
9
  use_objection_cache = True
10
  do_ragas_evaluation = False
11
- customer_research_report_md = "HSBC Quarterly Report 2024-10-16.md"
12
- customer_research_report_pdf = "HSBC Quarterly Report 2024-10-16.pdf"
13
  bettetech_value_proposition_pdf = "BetterTech Lending Analytics Solution.pdf"
14
  do_voice = True
15
  status = "active"
@@ -45,8 +45,8 @@ class SessionState:
45
  self.ask_objections = True
46
  self.use_objection_cache = True
47
  self.do_ragas_evaluation = False
48
- self.customer_research_report_md = "HSBC Quarterly Report 2024-10-16.md"
49
- self.customer_research_report_pdf = "HSBC Quarterly Report 2024-10-16.pdf"
50
  self.bettetech_value_proposition_pdf = "BetterTech Lending Analytics Solution.pdf"
51
  self.do_voice = True
52
  self.status = "active"
 
8
  ask_objections = True
9
  use_objection_cache = True
10
  do_ragas_evaluation = False
11
+ customer_research_report_md = "HSBC Quarterly Report 2024-10-19.md"
12
+ customer_research_report_pdf = "HSBC Quarterly Report 2024-10-19.pdf"
13
  bettetech_value_proposition_pdf = "BetterTech Lending Analytics Solution.pdf"
14
  do_voice = True
15
  status = "active"
 
45
  self.ask_objections = True
46
  self.use_objection_cache = True
47
  self.do_ragas_evaluation = False
48
+ self.customer_research_report_md = "HSBC Quarterly Report 2024-10-19.md"
49
+ self.customer_research_report_pdf = "HSBC Quarterly Report 2024-10-19.pdf"
50
  self.bettetech_value_proposition_pdf = "BetterTech Lending Analytics Solution.pdf"
51
  self.do_voice = True
52
  self.status = "active"
reports/HSBC Quarterly Report 2024-10-19.md ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # HSBC Quarterly Report - Q3 2024
2
+
3
+ ## Overview
4
+ HSBC Holdings plc, one of the largest banking and financial services organizations in the world, continues to navigate a complex global financial landscape. As of October 2024, the bank is focusing on enhancing its digital capabilities, expanding its wealth management services, and restructuring its operations in certain markets.
5
+
6
+ ## Financial Performance
7
+ In the first half of 2024, HSBC reported a robust performance despite global economic uncertainties. The bank's operating expenses rose by 3% to $8.1 billion, primarily due to increased technology costs. This investment in technology is part of HSBC's strategy to improve operational efficiency and customer experience ([HSBC Interim Results 2024](https://www.hsbc.com/-/files/hsbc/investors/hsbc-results/2024/interim/pdfs/hsbc-holdings-plc/240731-interim-report-2024.pdf)).
8
+
9
+ ## Strategic Developments
10
+ ### Digital Innovations
11
+ HSBC has launched a new venture called SemFi, in partnership with Tradeshift, aimed at providing embedded finance solutions to business clients. This initiative will allow SME suppliers on e-commerce platforms to access digital invoice financing, thereby enhancing their cash flow management ([Finextra](https://www.finextra.com/newsarticle/44827/hsbc-launches-embedded-finance-venture)).
12
+
13
+ ### Wealth Management Expansion
14
+ The bank is also targeting the mass affluent market in the UK, with plans to double its assets under management in the wealth business to £100 billion ($131 billion) over the next five years. This move aligns with the broader trend in the UK wealth management sector, which has seen significant growth ([Financial Express](https://today.thefinancialexpress.com.bd/trade-market/hsbc-looks-to-double-uk-wealth-business-as-banks-target-mass-affluent-1724516994)).
15
+
16
+ ## Leadership Changes
17
+ In October 2024, HSBC announced the resignation of its Group COO, John Hinshaw, after five years in the role. Suzy White, a long-time HSBC executive, has been appointed as the interim COO while a formal recruitment process is underway ([FinTech Futures](https://www.fintechfutures.com/2024/10/hsbc-group-coo-john-hinshaw-steps-down-after-five-years/)).
18
+
19
+ ## Market Challenges
20
+ Despite its strong performance, HSBC faces challenges, including rising recession fears in the US and geopolitical tensions that could impact its operations. The bank is also reportedly considering the sale of its South African business, indicating a strategic shift in its market focus ([FinTech Futures](https://www.fintechfutures.com/2024/08/hsbc-reportedly-considering-sale-of-its-south-african-business/)).
21
+
22
+ ## Conclusion
23
+ HSBC is actively adapting to the evolving financial landscape by investing in technology, expanding its wealth management services, and restructuring its operations. The bank's focus on digital innovation and strategic market adjustments positions it well for future growth, despite the challenges it faces in the current economic environment. As HSBC continues to implement its strategies, stakeholders will be keenly watching its performance in the upcoming quarters.
24
+
25
+ ### Citations
26
+ - [PDF Interim Results 2024 - HSBC Group corporate website](https://www.hsbc.com/-/files/hsbc/investors/hsbc-results/2024/interim/pdfs/hsbc-holdings-plc/240731-interim-report-2024.pdf): "Operating expenses of $8.1bn rose by $0.3bn or 3%, due to higher technology costs."
27
+ - [HSBC launches embedded finance venture - Finextra](https://www.finextra.com/newsarticle/44827/hsbc-launches-embedded-finance-venture): "HSBC has launched a new venture called SemFi, in partnership with Tradeshift, aimed at providing embedded finance solutions to business clients."
28
+ - [HSBC looks to double UK wealth business as banks target 'mass affluent' - Finance News: Latest Financial News, Finance News today in Bangladesh](https://today.thefinancialexpress.com.bd/trade-market/hsbc-looks-to-double-uk-wealth-business-as-banks-target-mass-affluent-1724516994): "HSBC aims to double the assets under management in its British wealth business to 100 billion pounds ($131 billion) in the next five years."
29
+ - [HSBC group COO John Hinshaw steps down after five years - FinTech Futures](https://www.fintechfutures.com/2024/10/hsbc-group-coo-john-hinshaw-steps-down-after-five-years/): "Suzy White, a seasoned HSBC veteran... has been appointed interim GCOO while the 'formal recruitment process is carried out'."
30
+ - [HSBC reportedly considering sale of its South African business - FinTech Futures](https://www.fintechfutures.com/2024/08/hsbc-reportedly-considering-sale-of-its-south-african-business/): "HSBC reportedly considering sale of its South African business."
reports/HSBC Quarterly Report 2024-10-19.pdf ADDED
Binary file (6.8 kB). View file
 
utils_customer_research.py CHANGED
@@ -247,7 +247,7 @@ def should_continue(state: ResearchState) -> Literal["tools", "curate"]:
247
  return "curate"
248
 
249
  async def select_and_process(state: ResearchState):
250
-
251
  prompt = f"""You are an expert researcher specializing in analyzing portfolio companies.\n
252
  Your current task is to review a list of documents and select the most relevant URLs related to recent developments for the following company: {state['company']}.\n
253
  Be aware that some documents may refer to other companies with similar or identical names, potentially leading to conflicting information.\n
 
247
  return "curate"
248
 
249
  async def select_and_process(state: ResearchState):
250
+ msg = "Curating Documents ...\n"
251
  prompt = f"""You are an expert researcher specializing in analyzing portfolio companies.\n
252
  Your current task is to review a list of documents and select the most relevant URLs related to recent developments for the following company: {state['company']}.\n
253
  Be aware that some documents may refer to other companies with similar or identical names, potentially leading to conflicting information.\n