Spaces:
Sleeping
Sleeping
more conversational, using objections
Browse files- __pycache__/app_main.cpython-311.pyc +0 -0
- __pycache__/classes.cpython-311.pyc +0 -0
- __pycache__/utils_actions.cpython-311.pyc +0 -0
- __pycache__/utils_callbacks.cpython-311.pyc +0 -0
- __pycache__/utils_chain_parameters.cpython-311.pyc +0 -0
- __pycache__/utils_customer_research.cpython-311.pyc +0 -0
- __pycache__/utils_data.cpython-311.pyc +0 -0
- __pycache__/utils_evaluate.cpython-311.pyc +0 -0
- __pycache__/utils_objections.cpython-311.pyc +0 -0
- __pycache__/utils_output.cpython-311.pyc +0 -0
- __pycache__/utils_pdf.cpython-311.pyc +0 -0
- __pycache__/utils_pose_objections.cpython-311.pyc +0 -0
- __pycache__/utils_prep.cpython-311.pyc +0 -0
- __pycache__/utils_prompt.cpython-311.pyc +0 -0
- __pycache__/utils_simulation.cpython-311.pyc +0 -0
- __pycache__/utils_voice.cpython-311.pyc +0 -0
- classes.py +1 -1
- data/HSBC_background.txt +47 -0
- utils_callbacks.py +12 -6
- utils_chain_parameters.py +1 -2
- utils_prompt.py +1 -1
__pycache__/app_main.cpython-311.pyc
CHANGED
Binary files a/__pycache__/app_main.cpython-311.pyc and b/__pycache__/app_main.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_actions.cpython-311.pyc
CHANGED
Binary files a/__pycache__/utils_actions.cpython-311.pyc and b/__pycache__/utils_actions.cpython-311.pyc differ
|
|
__pycache__/utils_callbacks.cpython-311.pyc
CHANGED
Binary files a/__pycache__/utils_callbacks.cpython-311.pyc and b/__pycache__/utils_callbacks.cpython-311.pyc differ
|
|
__pycache__/utils_chain_parameters.cpython-311.pyc
CHANGED
Binary files a/__pycache__/utils_chain_parameters.cpython-311.pyc and b/__pycache__/utils_chain_parameters.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_data.cpython-311.pyc
CHANGED
Binary files a/__pycache__/utils_data.cpython-311.pyc and b/__pycache__/utils_data.cpython-311.pyc differ
|
|
__pycache__/utils_evaluate.cpython-311.pyc
CHANGED
Binary files a/__pycache__/utils_evaluate.cpython-311.pyc and b/__pycache__/utils_evaluate.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
|
|
__pycache__/utils_output.cpython-311.pyc
CHANGED
Binary files a/__pycache__/utils_output.cpython-311.pyc and b/__pycache__/utils_output.cpython-311.pyc differ
|
|
__pycache__/utils_pdf.cpython-311.pyc
CHANGED
Binary files a/__pycache__/utils_pdf.cpython-311.pyc and b/__pycache__/utils_pdf.cpython-311.pyc differ
|
|
__pycache__/utils_pose_objections.cpython-311.pyc
CHANGED
Binary files a/__pycache__/utils_pose_objections.cpython-311.pyc and b/__pycache__/utils_pose_objections.cpython-311.pyc differ
|
|
__pycache__/utils_prep.cpython-311.pyc
CHANGED
Binary files a/__pycache__/utils_prep.cpython-311.pyc and b/__pycache__/utils_prep.cpython-311.pyc differ
|
|
__pycache__/utils_prompt.cpython-311.pyc
CHANGED
Binary files a/__pycache__/utils_prompt.cpython-311.pyc and b/__pycache__/utils_prompt.cpython-311.pyc differ
|
|
__pycache__/utils_simulation.cpython-311.pyc
CHANGED
Binary files a/__pycache__/utils_simulation.cpython-311.pyc and b/__pycache__/utils_simulation.cpython-311.pyc differ
|
|
__pycache__/utils_voice.cpython-311.pyc
CHANGED
Binary files a/__pycache__/utils_voice.cpython-311.pyc and b/__pycache__/utils_voice.cpython-311.pyc differ
|
|
classes.py
CHANGED
@@ -3,7 +3,7 @@ class SessionState:
|
|
3 |
do_evaluation = False
|
4 |
do_opportunity_analysis = False
|
5 |
do_customer_research = False
|
6 |
-
do_objections =
|
7 |
add_objections_to_analysis = False
|
8 |
ask_objections = True
|
9 |
do_ragas_evaluation = False
|
|
|
3 |
do_evaluation = False
|
4 |
do_opportunity_analysis = False
|
5 |
do_customer_research = False
|
6 |
+
do_objections = False
|
7 |
add_objections_to_analysis = False
|
8 |
ask_objections = True
|
9 |
do_ragas_evaluation = False
|
data/HSBC_background.txt
ADDED
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
HSBC Holdings Plc (HSBC) is a provider of banking and financial solutions. Its
|
2 |
+
subsidiaries offer retail, business, and commercial banking; private banking, and wealth
|
3 |
+
management services. The group’s portfolio of offerings comprises personal and
|
4 |
+
commercial loans, deposit services, mortgages, card products, insurance solutions,
|
5 |
+
global asset management, working capital and term loans, payment services,
|
6 |
+
international trade facilitation, merger and acquisition advisory, transaction banking,
|
7 |
+
capital markets, and risk management, investment management, and trusts and estate
|
8 |
+
planning, among others. The group has a presence in Europe, Asia, the Middle East,
|
9 |
+
North Africa, North America, and Latin America. HSBC is headquartered in London, the
|
10 |
+
UK.
|
11 |
+
|
12 |
+
From the Group Chairman
|
13 |
+
Technology and sustainability are two of the trends transforming banking and the world around us. The opportunities from generative
|
14 |
+
AI are among the most transformative within my working life. We are actively exploring a number of use cases, while also working to
|
15 |
+
manage the associated risks.
|
16 |
+
From Group Chief Executive
|
17 |
+
Driving cost savings enables us to invest in technology, which is the fourth opportunity. The digitisation of our business continues to
|
18 |
+
improve customer experience and increase efficiency. Using AI to help price complex structural options in our Foreign Exchange
|
19 |
+
business has cut execution times down from hours to minutes. We have also identified hundreds of opportunities to leverage
|
20 |
+
generative AI, and will focus our efforts on use cases with tangible benefits for the Group and our customers.
|
21 |
+
Innovation also creates new avenues for growth. We recently launched Zing, which is our open market mobile platform focused on
|
22 |
+
cross-border payments, initially available in the UK. It offers similar capabilities as Global Money does to our international Wealth
|
23 |
+
and Personal Banking customers, but is targeted at non-HSBC customers and allows us to drive growth beyond our traditional
|
24 |
+
customer footprint.
|
25 |
+
From the Strategic Report 2023
|
26 |
+
HSBC Technology Priority
|
27 |
+
Digitize
|
28 |
+
Improve customer experience and efficiency while investing in innovation
|
29 |
+
In 2023, we made progress on our goal to become a digital-first bank, and our customers have been increasingly adopting our digital
|
30 |
+
services. In CMB, 83% of customers were digitally active, an increase of 5 percentage points since 2022. Our net promoter score for
|
31 |
+
onboarding wholesale international clients in the last quarter of 2023 improved by 12 points when compared with the first three
|
32 |
+
months
|
33 |
+
of the year. At 54%, more than half of WPB customers were mobile active, an increase of 6 percentage points from 2022.
|
34 |
+
Furthermore, a total of 75% of WPB’s international customer accounts were opened digitally in 2023, an increase of 30 percentage
|
35 |
+
points from 2022.
|
36 |
+
We are also focused on building future-ready business models by investing in open-market propositions. In 2023, we announced a
|
37 |
+
partnership with Tradeshift to launch a new embedded finance solution in the first half
|
38 |
+
|
39 |
+
of 2024, which will provide payment and financial services embedded into trade, e-commerce and marketplace experiences. In
|
40 |
+
January 2024, in the UK we launched Zing, a mobile platform enabling cross-border payments available to non-HSBC consumers.
|
41 |
+
We are also investing in innovative technologies for the future. In 2024, we plan to both concentrate our efforts and increase our
|
42 |
+
investment in artificial intelligence (‘Al’).
|
43 |
+
At present, we employ Al in areas such as fraud detection and transaction monitoring. We also launched Al Markets, a digital service
|
44 |
+
that utilises natural language processing to enrich the way investors interact with global markets. Additionally, we are in the process
|
45 |
+
of piloting numerous generative Al use
|
46 |
+
cases in areas like developer augmentation, creative content generation and knowledge management, and have identified
|
47 |
+
hundreds more potential opportunities.
|
utils_callbacks.py
CHANGED
@@ -44,12 +44,18 @@ async def callback_run_scenario(action):
|
|
44 |
session_state = cl.user_session.get("session_state", None)
|
45 |
session_state.add_scenario_info(selected_opportunity)
|
46 |
get_customer_background(session_state, selected_opportunity['Customer Name'])
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
53 |
for q in session_state.questions:
|
54 |
print(q)
|
55 |
opening_message = session_state.get_opening()
|
|
|
44 |
session_state = cl.user_session.get("session_state", None)
|
45 |
session_state.add_scenario_info(selected_opportunity)
|
46 |
get_customer_background(session_state, selected_opportunity['Customer Name'])
|
47 |
+
if session_state.ask_objections:
|
48 |
+
print("creating objections")
|
49 |
+
session_state.objections = await create_objections(session_state)
|
50 |
+
questions = []
|
51 |
+
for obj in session_state.objections:
|
52 |
+
print(obj)
|
53 |
+
q = {"stage": session_state.opportunity.stage, "question": obj[3:], "ground_truth": ""}
|
54 |
+
questions.append(q)
|
55 |
+
session_state.questions = questions
|
56 |
+
else:
|
57 |
+
print("questions created")
|
58 |
+
session_state.questions = get_questions(session_state.opportunity.stage, session_state.num_questions)
|
59 |
for q in session_state.questions:
|
60 |
print(q)
|
61 |
opening_message = session_state.get_opening()
|
utils_chain_parameters.py
CHANGED
@@ -5,6 +5,7 @@ def prepare_chain_parameters(session_state, message, history):
|
|
5 |
next_question = ""
|
6 |
ground_truth = ""
|
7 |
command = ""
|
|
|
8 |
if session_state.current_question_index == 0:
|
9 |
previous_question = ""
|
10 |
rep_answer = ""
|
@@ -18,8 +19,6 @@ def prepare_chain_parameters(session_state, message, history):
|
|
18 |
ground_truth = session_state.questions[session_state.current_question_index - 1]["ground_truth"]
|
19 |
command = """Thank the customer, offer a comment on the answer and overall performance.
|
20 |
Conclude the conversation with a summary and give a farewell.
|
21 |
-
If the answers were good, give a positive farewell and offer a follow up meeting.
|
22 |
-
If the answers were poor, give a poor farewell.
|
23 |
You can add additional comments as needed.
|
24 |
"""
|
25 |
else:
|
|
|
5 |
next_question = ""
|
6 |
ground_truth = ""
|
7 |
command = ""
|
8 |
+
print(f"Index: {session_state.current_question_index}")
|
9 |
if session_state.current_question_index == 0:
|
10 |
previous_question = ""
|
11 |
rep_answer = ""
|
|
|
19 |
ground_truth = session_state.questions[session_state.current_question_index - 1]["ground_truth"]
|
20 |
command = """Thank the customer, offer a comment on the answer and overall performance.
|
21 |
Conclude the conversation with a summary and give a farewell.
|
|
|
|
|
22 |
You can add additional comments as needed.
|
23 |
"""
|
24 |
else:
|
utils_prompt.py
CHANGED
@@ -96,9 +96,9 @@ def get_system_template_openai_short():
|
|
96 |
system_template = """
|
97 |
You are playing a role in a conversation with a sales representative.
|
98 |
Your name is in the 'Name:' section.
|
99 |
-
If the sales rep gets your name wrong, you can correct them, politely
|
100 |
They can use your first name, full name or address you with a title and last name.
|
101 |
Your name does not need to match exactly what they say.
|
|
|
102 |
Your compnay information is in the 'Company:' section.
|
103 |
The sales rep's details is in the 'Sales rep:' section.
|
104 |
You do not need to use the sales rep's name in your response except in the greeting.
|
|
|
96 |
system_template = """
|
97 |
You are playing a role in a conversation with a sales representative.
|
98 |
Your name is in the 'Name:' section.
|
|
|
99 |
They can use your first name, full name or address you with a title and last name.
|
100 |
Your name does not need to match exactly what they say.
|
101 |
+
Be chatty and conversational and friendly.
|
102 |
Your compnay information is in the 'Company:' section.
|
103 |
The sales rep's details is in the 'Sales rep:' section.
|
104 |
You do not need to use the sales rep's name in your response except in the greeting.
|