Spaces:
Sleeping
Sleeping
TTsamurai
commited on
Commit
·
7e5fad8
1
Parent(s):
edf52d9
update the demo
Browse files- _static/html/general_instruction.html +1 -1
- _static/html/instruction_page.html +28 -31
- app.py +76 -368
- user_feedback_debug/interaction_0167eb5e-8636-4712-bab2-44e44b3bf320_first.json +4 -0
- user_feedback_debug/interaction_25621010-2a46-4d19-bacf-f74c6dbbc9a5_first.json +16 -0
- user_feedback_debug/interaction_32f1379c-0f8c-49a6-99e3-6cbc0ab6222f_first.json +2 -0
- user_feedback_debug/interaction_c7a2e8d7-861a-40e7-b102-63731a8f8ebe_first.json +4 -0
- user_feedback_debug/summarization_25621010-2a46-4d19-bacf-f74c6dbbc9a5_first.json +1 -0
- user_feedback_debug/summarization_c7a2e8d7-861a-40e7-b102-63731a8f8ebe_first.json +1 -0
_static/html/general_instruction.html
CHANGED
@@ -20,7 +20,7 @@
|
|
20 |
<!-- <p>If you don’t have a strong preference about certain characteristics of the stock, <span style="background-color: yellow;">you may simply state, “I don’t have a preference on this dimension.”</span></p> -->
|
21 |
<p>To interact with the financial advisor, first push the <strong>Start Conversation</strong> button. Then, type your message in the <strong>User Input</strong> textbox and press the <strong>Send This Message to Advisor</strong> button. If the response from the financial advisor is cut off due to word limitations, press the <strong>Show More of the Advisor’s Answer</strong> button to have the advisor continue the conversation. If you already have enough information to make a decision, you don’t need to press the <strong>Show More of the Advisor’s Answer</strong> button.</p>
|
22 |
|
23 |
-
<p>You will go through four rounds of financial decisions. Each round consists of a “Discussion (Discuss)” and an “Evaluation (Eval)” phase. Please move through the following sequence: 1-1: Discuss → 1-2: Eval → 2-1: Discuss → 2-2: Eval → … → 4-2: Eval.</p>
|
24 |
|
25 |
</div>
|
26 |
</p>
|
|
|
20 |
<!-- <p>If you don’t have a strong preference about certain characteristics of the stock, <span style="background-color: yellow;">you may simply state, “I don’t have a preference on this dimension.”</span></p> -->
|
21 |
<p>To interact with the financial advisor, first push the <strong>Start Conversation</strong> button. Then, type your message in the <strong>User Input</strong> textbox and press the <strong>Send This Message to Advisor</strong> button. If the response from the financial advisor is cut off due to word limitations, press the <strong>Show More of the Advisor’s Answer</strong> button to have the advisor continue the conversation. If you already have enough information to make a decision, you don’t need to press the <strong>Show More of the Advisor’s Answer</strong> button.</p>
|
22 |
|
23 |
+
<!-- <p>You will go through four rounds of financial decisions. Each round consists of a “Discussion (Discuss)” and an “Evaluation (Eval)” phase. Please move through the following sequence: 1-1: Discuss → 1-2: Eval → 2-1: Discuss → 2-2: Eval → … → 4-2: Eval.</p> -->
|
24 |
|
25 |
</div>
|
26 |
</p>
|
_static/html/instruction_page.html
CHANGED
@@ -1,55 +1,52 @@
|
|
1 |
-
<div style="font-family: Arial, sans-serif; line-height: 1.6; max-width: 800px; margin: auto; padding: 20px; background-color: #f9f9f9; border-radius: 10px;"
|
2 |
-
<h2 style="color: #2c3e50; text-align: center;">Welcome to the
|
3 |
-
<p style="
|
4 |
|
5 |
-
<
|
6 |
-
|
7 |
-
|
|
|
|
|
|
|
|
|
|
|
8 |
|
9 |
<div style="background-color: #eaf7f7; padding: 15px; border-left: 5px solid #17a2b8; margin-bottom: 20px;">
|
10 |
-
<strong>Step
|
11 |
<p>
|
12 |
-
During this stage, financial advisors will ask you a series of questions to gather insights into your investment preferences and needs.
|
|
|
|
|
13 |
</p>
|
14 |
</div>
|
15 |
|
16 |
<div style="background-color: #f2f5ff; padding: 15px; border-left: 5px solid #6c63ff; margin-bottom: 20px;">
|
17 |
-
<strong>Step
|
18 |
<p>
|
19 |
-
You will go through four rounds of financial
|
|
|
20 |
</p>
|
21 |
<div style="margin-left: 20px;">
|
22 |
-
<h4 style="color: #6c63ff;">Discussion Phase (e.g., 1
|
23 |
<p style="color: #34495e;">
|
24 |
-
You will receive general instructions and information about
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
<h4 style="color: #6c63ff;">Evaluation Phase (e.g., 1-2: Eval)</h4>
|
29 |
-
<p style=" color: #34495e;">
|
30 |
-
Once you feel informed, switch to the Evaluation tab and complete your evaluation for the stock.
|
31 |
</p>
|
32 |
|
33 |
-
<h4 style="color: #6c63ff;">Next Round (e.g., 2
|
34 |
-
<p style="
|
35 |
-
After
|
36 |
</p>
|
37 |
</div>
|
38 |
</div>
|
39 |
|
40 |
-
<div style="background-color: #fff8e1; padding: 15px; border-left: 5px solid #ffc107; margin-bottom: 20px;">
|
41 |
-
<strong>Step 3: Final Evaluation</strong>
|
42 |
-
<p style="color: #34495e;">
|
43 |
-
Based on your conversations with your financial advisor, you will first rank the individual stocks according to your desire to invest in each one, then evaluate the advisor by answering the questions.
|
44 |
-
<strong>Assign a unique rank to each stock</strong> (1 being the most preferred, 4 being the least preferred), and <strong>answer all the questions</strong> (1 being strongly disagree, 7 being strongly agree).
|
45 |
-
</p>
|
46 |
-
</div>
|
47 |
<!-- Cautionary Guidelines -->
|
48 |
<div style="background-color: #fdecea; padding: 15px; border-left: 5px solid #e74c3c; margin-top: 20px;">
|
49 |
<h4 style="color: #e74c3c;">Cautionary Guidelines</h4>
|
50 |
<ul style="color: #34495e;">
|
51 |
-
<li>Do not <strong>refresh</strong> or <strong>reload</strong> the page
|
52 |
-
<li>Please move through the following sequence: <strong>Experiment Instruction</strong> → <strong>Preference Elicitation Stage</strong> → <strong>Financial Decision Stage</strong> → <strong>Final Evaluation</strong>.</li>
|
53 |
</ul>
|
54 |
</div>
|
55 |
-
|
|
|
1 |
+
<div style="font-family: Arial, sans-serif; line-height: 1.6; max-width: 800px; margin: auto; padding: 20px; background-color: #f9f9f9; border-radius: 10px;">
|
2 |
+
<h2 style="color: #2c3e50; text-align: center;">Welcome to the FinPersona Demonstration!</h2>
|
3 |
+
<p style="color: #34495e; text-align: center;">Please read the instructions carefully before beginning.</p>
|
4 |
|
5 |
+
<div style="background-color: #fff7e6; padding: 15px; border-left: 5px solid #ff9800; margin-bottom: 20px;">
|
6 |
+
<strong>Step 1: Personality Injection</strong>
|
7 |
+
<p>
|
8 |
+
In this initial step, you will choose the personality style for your financial advisor.
|
9 |
+
Select either the <strong>Optimist (Friendly, Daring, Confident)</strong> or the
|
10 |
+
<strong>Pragmatist (Disciplined, Cautious, Practical)</strong> option. This choice will set the tone and approach of your advisor for the entire demonstration.
|
11 |
+
</p>
|
12 |
+
</div>
|
13 |
|
14 |
<div style="background-color: #eaf7f7; padding: 15px; border-left: 5px solid #17a2b8; margin-bottom: 20px;">
|
15 |
+
<strong>Step 2: User Preference Elicitation</strong>
|
16 |
<p>
|
17 |
+
During this stage, the financial advisors will ask you a series of questions to gather insights into your investment preferences and needs.
|
18 |
+
The information you provide will help guide the discussions and decisions in the subsequent stages.
|
19 |
+
<strong>Review the assigned user narrative thoroughly and role-play as the investor described.</strong>
|
20 |
</p>
|
21 |
</div>
|
22 |
|
23 |
<div style="background-color: #f2f5ff; padding: 15px; border-left: 5px solid #6c63ff; margin-bottom: 20px;">
|
24 |
+
<strong>Step 3: Personalized Stock Assessment</strong>
|
25 |
<p>
|
26 |
+
You will go through four rounds of financial discussions.
|
27 |
+
Please move through the following sequence: 1: Discuss → 2: Discuss → … → 4: Discuss.
|
28 |
</p>
|
29 |
<div style="margin-left: 20px;">
|
30 |
+
<h4 style="color: #6c63ff;">Discussion Phase (e.g., 1: Discuss)</h4>
|
31 |
<p style="color: #34495e;">
|
32 |
+
You will receive general instructions and information about a candidate stock, which has been <strong>randomly selected for this exploration</strong>.
|
33 |
+
After reviewing the instructions, engage with the financial advisor to make your decisions.
|
34 |
+
<strong>Once you feel that you have gathered enough information, proceed to the evaluation phase.</strong>
|
35 |
+
Note that the candidate stock is <strong>not a recommendation</strong> from the advisor.
|
|
|
|
|
|
|
36 |
</p>
|
37 |
|
38 |
+
<h4 style="color: #6c63ff;">Next Round (e.g., 2: Discuss)</h4>
|
39 |
+
<p style="color: #34495e;">
|
40 |
+
After evaluating one stock, move to the next tab and repeat the process until all four stocks have been assessed.
|
41 |
</p>
|
42 |
</div>
|
43 |
</div>
|
44 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
45 |
<!-- Cautionary Guidelines -->
|
46 |
<div style="background-color: #fdecea; padding: 15px; border-left: 5px solid #e74c3c; margin-top: 20px;">
|
47 |
<h4 style="color: #e74c3c;">Cautionary Guidelines</h4>
|
48 |
<ul style="color: #34495e;">
|
49 |
+
<li>Do not <strong>refresh</strong> or <strong>reload</strong> the page, as this will result in <strong>loss of data</strong> and require you to restart the demonstration.</li>
|
|
|
50 |
</ul>
|
51 |
</div>
|
52 |
+
</div>
|
app.py
CHANGED
@@ -14,14 +14,10 @@ ROOT_FILE = os.path.join(os.path.dirname(os.path.abspath(__file__)), "./")
|
|
14 |
sys.path.append(ROOT_FILE)
|
15 |
from components.induce_personality import construct_big_five_words
|
16 |
from components.chat_conversation import (
|
17 |
-
# format_message_history,
|
18 |
format_user_message,
|
19 |
format_context,
|
20 |
gradio_to_huggingface_message,
|
21 |
huggingface_to_gradio_message,
|
22 |
-
# get_system_instruction,
|
23 |
-
prepare_tokenizer,
|
24 |
-
# format_rag_context,
|
25 |
conversation_window,
|
26 |
generate_response_local_api,
|
27 |
generate_response_together_api,
|
@@ -31,9 +27,6 @@ from components.constant import (
|
|
31 |
CONV_WINDOW,
|
32 |
API_URL,
|
33 |
)
|
34 |
-
from components.induce_personality import (
|
35 |
-
build_personality_prompt,
|
36 |
-
)
|
37 |
|
38 |
LOG_DIR = os.path.join(ROOT_FILE, "log/api/")
|
39 |
if os.path.exists(LOG_DIR) is False:
|
@@ -321,7 +314,7 @@ def create_demo():
|
|
321 |
|
322 |
def tab_creation_exploration_stage(order, comp, context):
|
323 |
english_order = ["1", "2", "3", "4", "5"]
|
324 |
-
with gr.Tab(f"{english_order[order]}
|
325 |
general_instruction = gr.HTML(label="General Instruction")
|
326 |
with gr.Row():
|
327 |
with gr.Column():
|
@@ -339,33 +332,6 @@ def create_demo():
|
|
339 |
continue_button = gr.Button(value="Show More of the Advisor’s Answer", interactive=False)
|
340 |
with gr.Row():
|
341 |
clear = gr.ClearButton([msg, chatbot])
|
342 |
-
with gr.Tab(f"{english_order[order]}-2:Eval"):
|
343 |
-
with gr.Row():
|
344 |
-
gr.HTML(value=EVALUATION_INSTRUCTION)
|
345 |
-
with gr.Row():
|
346 |
-
likelihood = gr.Radio(
|
347 |
-
[1, 2, 3, 4, 5, 6, 7],
|
348 |
-
label="I am likely to purchase the stock (1 = Strongly Disagree, 7 = Strongly Agree)",
|
349 |
-
show_label=True,
|
350 |
-
)
|
351 |
-
reason = gr.Textbox(
|
352 |
-
scale=1,
|
353 |
-
label="Reason for Your Choice (Explain Your Reasoning & Highlight Useful Parts of Conversation)",
|
354 |
-
lines=5,
|
355 |
-
)
|
356 |
-
with gr.Row():
|
357 |
-
confidence = gr.Radio(
|
358 |
-
[1, 2, 3, 4, 5, 6, 7],
|
359 |
-
label="I am confident in my decision (1 = Strongly Disagree, 7 = Strongly Agree)",
|
360 |
-
show_label=True,
|
361 |
-
)
|
362 |
-
familiarity = gr.Radio(
|
363 |
-
[1, 2, 3, 4, 5, 6, 7],
|
364 |
-
label="What was your level of familiarity with the candidate stock before the interaction? (1 = Not Familiar, 7 = Very Familiar)",
|
365 |
-
)
|
366 |
-
with gr.Row():
|
367 |
-
textbox = gr.HTML()
|
368 |
-
evaluation_send_button = gr.Button(value="Send: Evaluation")
|
369 |
return {
|
370 |
"comp": comp,
|
371 |
"system_instruction_context": context,
|
@@ -374,14 +340,8 @@ def create_demo():
|
|
374 |
"continue_button": continue_button,
|
375 |
"chatbot": chatbot,
|
376 |
"msg": msg,
|
377 |
-
"reason": reason,
|
378 |
-
"likelihood": likelihood,
|
379 |
-
"confidence": confidence,
|
380 |
-
"familiarity": familiarity,
|
381 |
-
"evaluation_send_button": evaluation_send_button,
|
382 |
"general_instruction": general_instruction,
|
383 |
"round_instruction": round_instruction,
|
384 |
-
"textbox": textbox,
|
385 |
}
|
386 |
|
387 |
def tab_creation_preference_stage():
|
@@ -409,55 +369,56 @@ def create_demo():
|
|
409 |
"user_narrative": user_narrative,
|
410 |
}
|
411 |
|
412 |
-
def
|
413 |
-
|
414 |
-
|
415 |
-
|
416 |
-
|
417 |
-
|
418 |
-
|
419 |
-
|
420 |
-
|
421 |
-
|
422 |
-
|
423 |
-
|
424 |
-
|
425 |
-
)
|
426 |
-
with gr.Row():
|
427 |
-
perceived_personalization = likert_evaluation("The advisor understands my needs")
|
428 |
-
emotional_trust = likert_evaluation("I feel content about relying on this advisor for my decisions")
|
429 |
-
with gr.Row():
|
430 |
-
trust_in_competence = likert_evaluation("The advisor has good knowledge of the stock")
|
431 |
-
intention_to_use = likert_evaluation(
|
432 |
-
"I am willing to use this advisor as an aid to help with my decision about which stock to purchase"
|
433 |
-
)
|
434 |
|
435 |
-
with
|
436 |
-
usefulness = likert_evaluation("The advisor gave me good suggestions")
|
437 |
-
overall_satisfaction = likert_evaluation("Overall, I am satisfied with the advisor")
|
438 |
-
with gr.Row():
|
439 |
-
providing_information = likert_evaluation("The advisor provides the financial knowledge needed")
|
440 |
-
with gr.Row():
|
441 |
-
textbox = gr.HTML()
|
442 |
-
submit_ranking = gr.Button(value="Submit Final Evaluation")
|
443 |
return {
|
444 |
-
"
|
445 |
-
"
|
446 |
-
"
|
447 |
-
"fourth": ranking_fourth_comp,
|
448 |
-
"evaluators": {
|
449 |
-
"perceived_personalization": perceived_personalization,
|
450 |
-
"emotional_trust": emotional_trust,
|
451 |
-
"trust_in_competence": trust_in_competence,
|
452 |
-
"intention_to_use": intention_to_use,
|
453 |
-
"usefulness": usefulness,
|
454 |
-
"overall_satisfaction": overall_satisfaction,
|
455 |
-
"providing_information": providing_information,
|
456 |
-
},
|
457 |
-
"submit_ranking": submit_ranking,
|
458 |
-
"text_box": textbox,
|
459 |
}
|
460 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
461 |
def click_control_exploration_stage(
|
462 |
tabs, user_id, tab_session, user_preference_elicitation_session, system_description_without_context
|
463 |
):
|
@@ -469,12 +430,6 @@ def create_demo():
|
|
469 |
continue_button,
|
470 |
chatbot,
|
471 |
msg,
|
472 |
-
reason,
|
473 |
-
likelihood,
|
474 |
-
confidence,
|
475 |
-
familiarity,
|
476 |
-
evaluation_send_button,
|
477 |
-
textbox,
|
478 |
) = (
|
479 |
tabs["comp"],
|
480 |
tabs["system_instruction_context"],
|
@@ -483,12 +438,6 @@ def create_demo():
|
|
483 |
tabs["continue_button"],
|
484 |
tabs["chatbot"],
|
485 |
tabs["msg"],
|
486 |
-
tabs["reason"],
|
487 |
-
tabs["likelihood"],
|
488 |
-
tabs["confidence"],
|
489 |
-
tabs["familiarity"],
|
490 |
-
tabs["evaluation_send_button"],
|
491 |
-
tabs["textbox"],
|
492 |
)
|
493 |
system_instruction = ""
|
494 |
start_conversation.click(
|
@@ -559,33 +508,6 @@ def create_demo():
|
|
559 |
],
|
560 |
[tab_session, chatbot],
|
561 |
)
|
562 |
-
evaluation_send_button.click(
|
563 |
-
lambda user_id, comp, tab_session, reason, likelihood, confidence, familiarity, evaluation_send_button, textbox: respond_evaluation(
|
564 |
-
user_id,
|
565 |
-
tab_session,
|
566 |
-
{
|
567 |
-
"reason": reason,
|
568 |
-
"likelihood": likelihood,
|
569 |
-
"confidence": confidence,
|
570 |
-
"familiarity": familiarity,
|
571 |
-
},
|
572 |
-
comp,
|
573 |
-
evaluation_send_button,
|
574 |
-
textbox,
|
575 |
-
),
|
576 |
-
[
|
577 |
-
user_id,
|
578 |
-
comp,
|
579 |
-
tab_session,
|
580 |
-
reason,
|
581 |
-
likelihood,
|
582 |
-
confidence,
|
583 |
-
familiarity,
|
584 |
-
evaluation_send_button,
|
585 |
-
textbox,
|
586 |
-
],
|
587 |
-
[tab_session, reason, likelihood, confidence, familiarity, evaluation_send_button, textbox],
|
588 |
-
)
|
589 |
|
590 |
def click_control_preference_stage(
|
591 |
tabs, user_id, user_preference_elicitation_session, system_description_user_elicitation
|
@@ -645,81 +567,6 @@ def create_demo():
|
|
645 |
[user_preference_elicitation_session, elicitation_chatbot],
|
646 |
)
|
647 |
|
648 |
-
def click_control_final_evaluation(tabs, user_id, first_comp, second_comp, third_comp, fourth_comp, evaluators):
|
649 |
-
(
|
650 |
-
ranking_first_comp,
|
651 |
-
ranking_second_comp,
|
652 |
-
ranking_third_comp,
|
653 |
-
ranking_fourth_comp,
|
654 |
-
) = (
|
655 |
-
tabs["first"],
|
656 |
-
tabs["second"],
|
657 |
-
tabs["third"],
|
658 |
-
tabs["fourth"],
|
659 |
-
)
|
660 |
-
(
|
661 |
-
perceived_personalization,
|
662 |
-
emotional_trust,
|
663 |
-
trust_in_competence,
|
664 |
-
intention_to_use,
|
665 |
-
usefulness,
|
666 |
-
overall_satisfaction,
|
667 |
-
providing_information,
|
668 |
-
) = (
|
669 |
-
evaluators["perceived_personalization"],
|
670 |
-
evaluators["emotional_trust"],
|
671 |
-
evaluators["trust_in_competence"],
|
672 |
-
evaluators["intention_to_use"],
|
673 |
-
evaluators["usefulness"],
|
674 |
-
evaluators["overall_satisfaction"],
|
675 |
-
evaluators["providing_information"],
|
676 |
-
)
|
677 |
-
result_textbox = tabs["text_box"]
|
678 |
-
submit_ranking = tabs["submit_ranking"]
|
679 |
-
submit_ranking.click(
|
680 |
-
lambda user_id, first_comp, ranking_first_comp, second_comp, ranking_second_comp, third_comp, ranking_third_comp, fourth_comp, ranking_fourth_comp, perceived_personalization, emotional_trust, trust_in_competence, intention_to_use, usefulness, overall_satisfaction, providing_information, submit_ranking: respond_final_ranking(
|
681 |
-
user_id,
|
682 |
-
first_comp,
|
683 |
-
ranking_first_comp,
|
684 |
-
second_comp,
|
685 |
-
ranking_second_comp,
|
686 |
-
third_comp,
|
687 |
-
ranking_third_comp,
|
688 |
-
fourth_comp,
|
689 |
-
ranking_fourth_comp,
|
690 |
-
perceived_personalization,
|
691 |
-
emotional_trust,
|
692 |
-
trust_in_competence,
|
693 |
-
intention_to_use,
|
694 |
-
usefulness,
|
695 |
-
overall_satisfaction,
|
696 |
-
providing_information,
|
697 |
-
submit_ranking,
|
698 |
-
),
|
699 |
-
# Input components (names and rankings)
|
700 |
-
[
|
701 |
-
user_id,
|
702 |
-
first_comp,
|
703 |
-
ranking_first_comp,
|
704 |
-
second_comp,
|
705 |
-
ranking_second_comp,
|
706 |
-
third_comp,
|
707 |
-
ranking_third_comp,
|
708 |
-
fourth_comp,
|
709 |
-
ranking_fourth_comp,
|
710 |
-
perceived_personalization,
|
711 |
-
emotional_trust,
|
712 |
-
trust_in_competence,
|
713 |
-
intention_to_use,
|
714 |
-
usefulness,
|
715 |
-
overall_satisfaction,
|
716 |
-
providing_information,
|
717 |
-
submit_ranking,
|
718 |
-
],
|
719 |
-
# Output component(s) where you want the result to appear, e.g., result_textbox
|
720 |
-
[result_textbox, submit_ranking],
|
721 |
-
)
|
722 |
-
|
723 |
def respond(
|
724 |
user_id,
|
725 |
tab_data,
|
@@ -869,9 +716,6 @@ def create_demo():
|
|
869 |
{"type": tab_name, "role": "assistant", "content": outputs_text},
|
870 |
feedback_file_interaction,
|
871 |
)
|
872 |
-
# log_action(user_id, tab_name, "User Message", first_message)
|
873 |
-
# log_action(user_id, tab_name, "Response", outputs_text)
|
874 |
-
# Store the updated history for this tab
|
875 |
tab_data["history"] = history
|
876 |
if user_elicitation:
|
877 |
save_feedback(
|
@@ -974,133 +818,6 @@ def create_demo():
|
|
974 |
tab_data["history"] = history
|
975 |
return tab_data, history
|
976 |
|
977 |
-
def respond_evaluation(user_id, tab_data, evals, tab_name, evaluation_send_button, textbox):
|
978 |
-
|
979 |
-
# dropdown, readon_button, multi-evaluator
|
980 |
-
if evals["likelihood"] is None or evals["confidence"] is None or evals["familiarity"] is None:
|
981 |
-
return (
|
982 |
-
tab_data,
|
983 |
-
evals["reason"],
|
984 |
-
evals["likelihood"],
|
985 |
-
evals["confidence"],
|
986 |
-
evals["familiarity"],
|
987 |
-
evaluation_send_button,
|
988 |
-
"""<div style="background-color: #f8d7da; color: #721c24; padding: 15px; border: 1px solid #f5c6cb; border-radius: 5px; margin-bottom: 20px;">
|
989 |
-
<strong>Please make sure that you answer all the questions.</strong>
|
990 |
-
</div>""",
|
991 |
-
)
|
992 |
-
else:
|
993 |
-
save_feedback(
|
994 |
-
user_id,
|
995 |
-
uuid_this_session,
|
996 |
-
"round_evaluation",
|
997 |
-
{**evals, "company": tab_name},
|
998 |
-
feedback_file_round_evaluation,
|
999 |
-
)
|
1000 |
-
# log_action(user_id, tab_name, "Round Evaluation", "Following")
|
1001 |
-
# for key, value in evals.items():
|
1002 |
-
# log_action(user_id, tab_name, key, value)
|
1003 |
-
# Store the reason for this tab
|
1004 |
-
tab_data["multi_evaluator"] = evals
|
1005 |
-
evaluation_send_button = gr.Button(value="Evaluation receirved", interactive=False)
|
1006 |
-
return (
|
1007 |
-
tab_data,
|
1008 |
-
evals["reason"],
|
1009 |
-
evals["likelihood"],
|
1010 |
-
evals["confidence"],
|
1011 |
-
evals["familiarity"],
|
1012 |
-
evaluation_send_button,
|
1013 |
-
"""<div style="background-color: #d4edda; color: #155724; padding: 15px; border: 1px solid #c3e6cb; border-radius: 5px; margin-bottom: 20px;">
|
1014 |
-
<strong>Thank you for submitting your evaluation. You may proceed to the next tab.</strong>
|
1015 |
-
</div>""",
|
1016 |
-
)
|
1017 |
-
|
1018 |
-
def respond_final_ranking(
|
1019 |
-
user_id,
|
1020 |
-
first_comp,
|
1021 |
-
ranking_first_comp,
|
1022 |
-
second_comp,
|
1023 |
-
ranking_second_comp,
|
1024 |
-
third_comp,
|
1025 |
-
ranking_third_comp,
|
1026 |
-
fourth_comp,
|
1027 |
-
ranking_fourth_comp,
|
1028 |
-
perceived_personalization,
|
1029 |
-
emotional_trust,
|
1030 |
-
trust_in_competence,
|
1031 |
-
intention_to_use,
|
1032 |
-
usefulness,
|
1033 |
-
overall_satisfaction,
|
1034 |
-
providing_information,
|
1035 |
-
submit_ranking,
|
1036 |
-
):
|
1037 |
-
# make sure that they are not the same
|
1038 |
-
ranking_list = [
|
1039 |
-
ranking_first_comp,
|
1040 |
-
ranking_second_comp,
|
1041 |
-
ranking_third_comp,
|
1042 |
-
ranking_fourth_comp,
|
1043 |
-
]
|
1044 |
-
if len(set(ranking_list)) != len(ranking_list):
|
1045 |
-
return (
|
1046 |
-
"""<div style="background-color: #f8d7da; color: #721c24; padding: 15px; border: 1px solid #f5c6cb; border-radius: 5px; margin-bottom: 20px;">
|
1047 |
-
<strong>Please make sure that you are not ranking the same stock multiple times.</strong>
|
1048 |
-
</div>""",
|
1049 |
-
submit_ranking,
|
1050 |
-
)
|
1051 |
-
if any(
|
1052 |
-
var is None
|
1053 |
-
for var in [
|
1054 |
-
perceived_personalization,
|
1055 |
-
emotional_trust,
|
1056 |
-
trust_in_competence,
|
1057 |
-
intention_to_use,
|
1058 |
-
usefulness,
|
1059 |
-
overall_satisfaction,
|
1060 |
-
providing_information,
|
1061 |
-
]
|
1062 |
-
):
|
1063 |
-
return (
|
1064 |
-
"""<div style="background-color: #f8d7da; color: #721c24; padding: 15px; border: 1px solid #f5c6cb; border-radius: 5px; margin-bottom: 20px;">
|
1065 |
-
<strong>Please make sure that you answer all the statements.</strong>
|
1066 |
-
</div>""",
|
1067 |
-
submit_ranking,
|
1068 |
-
)
|
1069 |
-
else:
|
1070 |
-
save_feedback(
|
1071 |
-
user_id,
|
1072 |
-
uuid_this_session,
|
1073 |
-
"final_ranking",
|
1074 |
-
{
|
1075 |
-
"comp_order": [first_comp, second_comp, third_comp, fourth_comp],
|
1076 |
-
"ranking": ranking_list,
|
1077 |
-
},
|
1078 |
-
feedback_file_final_ranking,
|
1079 |
-
)
|
1080 |
-
|
1081 |
-
save_feedback(
|
1082 |
-
user_id,
|
1083 |
-
uuid_this_session,
|
1084 |
-
"final_ranking_survey",
|
1085 |
-
{
|
1086 |
-
"perceived_personalization": perceived_personalization,
|
1087 |
-
"emotional_trust": emotional_trust,
|
1088 |
-
"trust_in_competence": trust_in_competence,
|
1089 |
-
"intention_to_use": intention_to_use,
|
1090 |
-
"usefulness": usefulness,
|
1091 |
-
"overall_satisfaction": overall_satisfaction,
|
1092 |
-
"providing_information": providing_information,
|
1093 |
-
},
|
1094 |
-
feedback_file_final_survey,
|
1095 |
-
)
|
1096 |
-
submit_ranking = gr.Button(value="Final evaluaiotn received", interactive=False)
|
1097 |
-
return (
|
1098 |
-
"""<div style="background-color: #d4edda; color: #155724; padding: 15px; border: 1px solid #c3e6cb; border-radius: 5px; margin-bottom: 20px;">
|
1099 |
-
<strong>Thank you for participating in the experiment. This concludes the session. You may now close the tab.</strong>
|
1100 |
-
</div>""",
|
1101 |
-
submit_ranking,
|
1102 |
-
)
|
1103 |
-
|
1104 |
def get_context(index, raw_context_list, stock_context_list):
|
1105 |
comp = raw_context_list[index]["short_name"]
|
1106 |
context = stock_context_list[index]
|
@@ -1109,7 +826,7 @@ def create_demo():
|
|
1109 |
|
1110 |
def set_user_id(request: gr.Request):
|
1111 |
# DEBUG
|
1112 |
-
user_id = "
|
1113 |
# user_id = request.username
|
1114 |
user_in_narrative_id = user_id.split("_")[-1]
|
1115 |
narrative_id = user_id.split("_")[-2]
|
@@ -1169,12 +886,6 @@ def create_demo():
|
|
1169 |
fourth_comp, fourth_context, fourth_general_instruction, fourth_round_instruction = get_context(
|
1170 |
3, raw_context_list, stock_context_list
|
1171 |
)
|
1172 |
-
# Final Evaluation
|
1173 |
-
ranking_first_comp = gr.Dropdown(choices=[1, 2, 3, 4], label=first_comp)
|
1174 |
-
ranking_second_comp = gr.Dropdown(choices=[1, 2, 3, 4], label=second_comp)
|
1175 |
-
ranking_third_comp = gr.Dropdown(choices=[1, 2, 3, 4], label=third_comp)
|
1176 |
-
ranking_fourth_comp = gr.Dropdown(choices=[1, 2, 3, 4], label=fourth_comp)
|
1177 |
-
|
1178 |
return (
|
1179 |
user_id,
|
1180 |
user_in_narrative_id,
|
@@ -1201,10 +912,6 @@ def create_demo():
|
|
1201 |
fourth_context,
|
1202 |
fourth_general_instruction,
|
1203 |
fourth_round_instruction,
|
1204 |
-
ranking_first_comp,
|
1205 |
-
ranking_second_comp,
|
1206 |
-
ranking_third_comp,
|
1207 |
-
ranking_fourth_comp,
|
1208 |
)
|
1209 |
|
1210 |
with gr.Blocks(title="RAG Chatbot Q&A", theme="Soft") as demo:
|
@@ -1245,11 +952,16 @@ def create_demo():
|
|
1245 |
second_comp_session = gr.State(value={"history": [], "selection": "", "reason": ""})
|
1246 |
third_comp_session = gr.State(value={"history": [], "selection": "", "reason": ""})
|
1247 |
fourth_comp_session = gr.State(value={"history": [], "selection": "", "reason": ""})
|
1248 |
-
#
|
1249 |
-
with gr.Tab("
|
1250 |
-
gr.HTML(value=INSTRUCTION_PAGE, label="
|
1251 |
# User Preference Elicitation Tab
|
1252 |
-
with gr.Tab("
|
|
|
|
|
|
|
|
|
|
|
1253 |
user_preference_elicitation_tab = tab_creation_preference_stage()
|
1254 |
user_narrative = user_preference_elicitation_tab["user_narrative"]
|
1255 |
click_control_preference_stage(
|
@@ -1258,7 +970,7 @@ def create_demo():
|
|
1258 |
user_preference_elicitation_session,
|
1259 |
system_description_user_elicitation,
|
1260 |
)
|
1261 |
-
with gr.Tab("
|
1262 |
# Experiment Tag
|
1263 |
first_tab = tab_creation_exploration_stage(0, first_comp, first_context)
|
1264 |
first_general_instruction, first_round_instruction = (
|
@@ -1308,24 +1020,24 @@ def create_demo():
|
|
1308 |
user_preference_elicitation_session,
|
1309 |
system_description_without_context,
|
1310 |
)
|
1311 |
-
with gr.Tab("Final Evaluation Stage") as final_evaluation:
|
1312 |
-
|
1313 |
-
|
1314 |
-
|
1315 |
-
|
1316 |
-
|
1317 |
-
|
1318 |
-
|
1319 |
-
|
1320 |
-
|
1321 |
-
|
1322 |
-
|
1323 |
-
|
1324 |
-
|
1325 |
-
|
1326 |
-
|
1327 |
-
|
1328 |
-
|
1329 |
|
1330 |
demo.load(
|
1331 |
set_initial_values,
|
@@ -1356,10 +1068,6 @@ def create_demo():
|
|
1356 |
fourth_context,
|
1357 |
fourth_general_instruction,
|
1358 |
fourth_round_instruction,
|
1359 |
-
ranking_first_comp,
|
1360 |
-
ranking_second_comp,
|
1361 |
-
ranking_third_comp,
|
1362 |
-
ranking_fourth_comp,
|
1363 |
],
|
1364 |
)
|
1365 |
return demo
|
|
|
14 |
sys.path.append(ROOT_FILE)
|
15 |
from components.induce_personality import construct_big_five_words
|
16 |
from components.chat_conversation import (
|
|
|
17 |
format_user_message,
|
18 |
format_context,
|
19 |
gradio_to_huggingface_message,
|
20 |
huggingface_to_gradio_message,
|
|
|
|
|
|
|
21 |
conversation_window,
|
22 |
generate_response_local_api,
|
23 |
generate_response_together_api,
|
|
|
27 |
CONV_WINDOW,
|
28 |
API_URL,
|
29 |
)
|
|
|
|
|
|
|
30 |
|
31 |
LOG_DIR = os.path.join(ROOT_FILE, "log/api/")
|
32 |
if os.path.exists(LOG_DIR) is False:
|
|
|
314 |
|
315 |
def tab_creation_exploration_stage(order, comp, context):
|
316 |
english_order = ["1", "2", "3", "4", "5"]
|
317 |
+
with gr.Tab(f"{english_order[order]}:Discuss"):
|
318 |
general_instruction = gr.HTML(label="General Instruction")
|
319 |
with gr.Row():
|
320 |
with gr.Column():
|
|
|
332 |
continue_button = gr.Button(value="Show More of the Advisor’s Answer", interactive=False)
|
333 |
with gr.Row():
|
334 |
clear = gr.ClearButton([msg, chatbot])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
335 |
return {
|
336 |
"comp": comp,
|
337 |
"system_instruction_context": context,
|
|
|
340 |
"continue_button": continue_button,
|
341 |
"chatbot": chatbot,
|
342 |
"msg": msg,
|
|
|
|
|
|
|
|
|
|
|
343 |
"general_instruction": general_instruction,
|
344 |
"round_instruction": round_instruction,
|
|
|
345 |
}
|
346 |
|
347 |
def tab_creation_preference_stage():
|
|
|
369 |
"user_narrative": user_narrative,
|
370 |
}
|
371 |
|
372 |
+
def tab_personality_injection():
|
373 |
+
gr.Markdown("## Choose Your Advisor Personality")
|
374 |
+
# A radio button to choose between Optimist and Pragmatis
|
375 |
+
personality_choice = gr.Radio(
|
376 |
+
choices=["Optimist (Friendly, Daring, Confident)", "Pragmatist (Disciplined, Cautious, Practical)"],
|
377 |
+
value="Optimist",
|
378 |
+
label="Select a Personality",
|
379 |
+
interactive=True,
|
380 |
+
)
|
381 |
+
# An HTML element to display personality details/description
|
382 |
+
personality_description = gr.HTML(value="", label="Personality Details")
|
383 |
+
# A button that, when clicked, confirms the selection
|
384 |
+
personality_submit = gr.Button("Apply Personality")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
385 |
|
386 |
+
# Return a dict with the UI components for later use
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
387 |
return {
|
388 |
+
"personality_choice": personality_choice,
|
389 |
+
"personality_description": personality_description,
|
390 |
+
"personality_submit": personality_submit,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
391 |
}
|
392 |
|
393 |
+
def click_control_personality_injection_stage(
|
394 |
+
tabs, system_description_without_context, system_description_user_elicitation
|
395 |
+
):
|
396 |
+
def respond_personality(personality_choice):
|
397 |
+
if personality_choice == "Optimist (Friendly, Daring, Confident)":
|
398 |
+
new_sys_desc_no_ctx = SYSTEM_INSTRUCTION_PERSONALITY.format(personality=PERSONALITY_EXT)
|
399 |
+
new_sys_desc_user_elicitation = SYSTEM_INSTRUCTION_PREFERENCE_ELICITATION_PERSONALITY.format(
|
400 |
+
personality=PERSONALITY_EXT
|
401 |
+
)
|
402 |
+
message = "Optimist advisor personality is successfully applied."
|
403 |
+
else:
|
404 |
+
new_sys_desc_no_ctx = SYSTEM_INSTRUCTION_PERSONALITY.format(personality=PERSONALITY_INT)
|
405 |
+
new_sys_desc_user_elicitation = SYSTEM_INSTRUCTION_PREFERENCE_ELICITATION_PERSONALITY.format(
|
406 |
+
personality=PERSONALITY_INT
|
407 |
+
)
|
408 |
+
message = "Pragmatist personality is successfully applied."
|
409 |
+
return new_sys_desc_no_ctx, new_sys_desc_user_elicitation, message
|
410 |
+
|
411 |
+
# Only pass the personality_choice as input
|
412 |
+
tabs["personality_submit"].click(
|
413 |
+
fn=respond_personality,
|
414 |
+
inputs=[tabs["personality_choice"]],
|
415 |
+
outputs=[
|
416 |
+
system_description_without_context,
|
417 |
+
system_description_user_elicitation,
|
418 |
+
tabs["personality_description"],
|
419 |
+
],
|
420 |
+
)
|
421 |
+
|
422 |
def click_control_exploration_stage(
|
423 |
tabs, user_id, tab_session, user_preference_elicitation_session, system_description_without_context
|
424 |
):
|
|
|
430 |
continue_button,
|
431 |
chatbot,
|
432 |
msg,
|
|
|
|
|
|
|
|
|
|
|
|
|
433 |
) = (
|
434 |
tabs["comp"],
|
435 |
tabs["system_instruction_context"],
|
|
|
438 |
tabs["continue_button"],
|
439 |
tabs["chatbot"],
|
440 |
tabs["msg"],
|
|
|
|
|
|
|
|
|
|
|
|
|
441 |
)
|
442 |
system_instruction = ""
|
443 |
start_conversation.click(
|
|
|
508 |
],
|
509 |
[tab_session, chatbot],
|
510 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
511 |
|
512 |
def click_control_preference_stage(
|
513 |
tabs, user_id, user_preference_elicitation_session, system_description_user_elicitation
|
|
|
567 |
[user_preference_elicitation_session, elicitation_chatbot],
|
568 |
)
|
569 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
570 |
def respond(
|
571 |
user_id,
|
572 |
tab_data,
|
|
|
716 |
{"type": tab_name, "role": "assistant", "content": outputs_text},
|
717 |
feedback_file_interaction,
|
718 |
)
|
|
|
|
|
|
|
719 |
tab_data["history"] = history
|
720 |
if user_elicitation:
|
721 |
save_feedback(
|
|
|
818 |
tab_data["history"] = history
|
819 |
return tab_data, history
|
820 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
821 |
def get_context(index, raw_context_list, stock_context_list):
|
822 |
comp = raw_context_list[index]["short_name"]
|
823 |
context = stock_context_list[index]
|
|
|
826 |
|
827 |
def set_user_id(request: gr.Request):
|
828 |
# DEBUG
|
829 |
+
user_id = "user_2_0_0"
|
830 |
# user_id = request.username
|
831 |
user_in_narrative_id = user_id.split("_")[-1]
|
832 |
narrative_id = user_id.split("_")[-2]
|
|
|
886 |
fourth_comp, fourth_context, fourth_general_instruction, fourth_round_instruction = get_context(
|
887 |
3, raw_context_list, stock_context_list
|
888 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
889 |
return (
|
890 |
user_id,
|
891 |
user_in_narrative_id,
|
|
|
912 |
fourth_context,
|
913 |
fourth_general_instruction,
|
914 |
fourth_round_instruction,
|
|
|
|
|
|
|
|
|
915 |
)
|
916 |
|
917 |
with gr.Blocks(title="RAG Chatbot Q&A", theme="Soft") as demo:
|
|
|
952 |
second_comp_session = gr.State(value={"history": [], "selection": "", "reason": ""})
|
953 |
third_comp_session = gr.State(value={"history": [], "selection": "", "reason": ""})
|
954 |
fourth_comp_session = gr.State(value={"history": [], "selection": "", "reason": ""})
|
955 |
+
# Demonstration Instruction
|
956 |
+
with gr.Tab("Demonstration Instruction") as instruction_tab:
|
957 |
+
gr.HTML(value=INSTRUCTION_PAGE, label="Demonstration Instruction")
|
958 |
# User Preference Elicitation Tab
|
959 |
+
with gr.Tab("Personality Injection") as personality_injection_tab:
|
960 |
+
personality_injection_tab = tab_personality_injection()
|
961 |
+
click_control_personality_injection_stage(
|
962 |
+
personality_injection_tab, system_description_without_context, system_description_user_elicitation
|
963 |
+
)
|
964 |
+
with gr.Tab("User Preference Elicitataion") as preference_elicitation_tab:
|
965 |
user_preference_elicitation_tab = tab_creation_preference_stage()
|
966 |
user_narrative = user_preference_elicitation_tab["user_narrative"]
|
967 |
click_control_preference_stage(
|
|
|
970 |
user_preference_elicitation_session,
|
971 |
system_description_user_elicitation,
|
972 |
)
|
973 |
+
with gr.Tab("Personalized Stock Assessment") as financial_decision:
|
974 |
# Experiment Tag
|
975 |
first_tab = tab_creation_exploration_stage(0, first_comp, first_context)
|
976 |
first_general_instruction, first_round_instruction = (
|
|
|
1020 |
user_preference_elicitation_session,
|
1021 |
system_description_without_context,
|
1022 |
)
|
1023 |
+
# with gr.Tab("Final Evaluation Stage") as final_evaluation:
|
1024 |
+
# final_evaluation_tab = tab_final_evaluation()
|
1025 |
+
# (
|
1026 |
+
# ranking_first_comp,
|
1027 |
+
# ranking_second_comp,
|
1028 |
+
# ranking_third_comp,
|
1029 |
+
# ranking_fourth_comp,
|
1030 |
+
# evaluators,
|
1031 |
+
# ) = (
|
1032 |
+
# final_evaluation_tab["first"],
|
1033 |
+
# final_evaluation_tab["second"],
|
1034 |
+
# final_evaluation_tab["third"],
|
1035 |
+
# final_evaluation_tab["fourth"],
|
1036 |
+
# final_evaluation_tab["evaluators"],
|
1037 |
+
# )
|
1038 |
+
# click_control_final_evaluation(
|
1039 |
+
# final_evaluation_tab, user_id, first_comp, second_comp, third_comp, fourth_comp, evaluators
|
1040 |
+
# )
|
1041 |
|
1042 |
demo.load(
|
1043 |
set_initial_values,
|
|
|
1068 |
fourth_context,
|
1069 |
fourth_general_instruction,
|
1070 |
fourth_round_instruction,
|
|
|
|
|
|
|
|
|
1071 |
],
|
1072 |
)
|
1073 |
return demo
|
user_feedback_debug/interaction_0167eb5e-8636-4712-bab2-44e44b3bf320_first.json
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{"user_id": "user_2_0_0", "uuid": "0167eb5e-8636-4712-bab2-44e44b3bf320", "timestamp": "2025-03-24 14:09:36", "type": "interaction", "value": {"type": "user_elicitation", "role": "user", "content": "Hey"}}
|
2 |
+
{"user_id": "user_2_0_0", "uuid": "0167eb5e-8636-4712-bab2-44e44b3bf320", "timestamp": "2025-03-24 14:09:36", "type": "Interaction", "value": {"type": "user_elicitation", "role": "assistant", "content": "It's great to finally sit down and talk about your investment goals. I'm excited to help you make informed decisions about your portfolio. Let's get started - what industries are you most interested in investing in? Are you drawn to technology, healthcare, finance, or something else?"}}
|
3 |
+
{"user_id": "user_2_0_0", "uuid": "0167eb5e-8636-4712-bab2-44e44b3bf320", "timestamp": "2025-03-24 14:09:49", "type": "interaction", "value": {"type": "user_elicitation", "role": "user", "content": "Hey"}}
|
4 |
+
{"user_id": "user_2_0_0", "uuid": "0167eb5e-8636-4712-bab2-44e44b3bf320", "timestamp": "2025-03-24 14:09:49", "type": "Interaction", "value": {"type": "user_elicitation", "role": "assistant", "content": "I'm glad you're here. Before we begin, I want to clarify that this session is about understanding your investment preferences, not specific stocks. We'll discuss industries, stock types, and market trends. Let's start with industries. Which sectors interest you the most? Technology, healthcare, finance, or something else?"}}
|
user_feedback_debug/interaction_25621010-2a46-4d19-bacf-f74c6dbbc9a5_first.json
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{"user_id": "user_2_0_0", "uuid": "25621010-2a46-4d19-bacf-f74c6dbbc9a5", "timestamp": "2025-03-24 14:05:40", "type": "interaction", "value": {"type": "user_elicitation", "role": "user", "content": "Hey"}}
|
2 |
+
{"user_id": "user_2_0_0", "uuid": "25621010-2a46-4d19-bacf-f74c6dbbc9a5", "timestamp": "2025-03-24 14:05:40", "type": "Interaction", "value": {"type": "user_elicitation", "role": "assistant", "content": "I'm glad you're interested in discussing your investment options. To get started, I'd like to understand your preferred industry for investment. Are you interested in technology, healthcare, finance, consumer goods, or something else?"}}
|
3 |
+
{"user_id": "user_2_0_0", "uuid": "25621010-2a46-4d19-bacf-f74c6dbbc9a5", "timestamp": "2025-03-24 14:05:57", "type": "interaction", "value": {"type": "user_elicitation", "role": "user", "content": "Hey"}}
|
4 |
+
{"user_id": "user_2_0_0", "uuid": "25621010-2a46-4d19-bacf-f74c6dbbc9a5", "timestamp": "2025-03-24 14:05:57", "type": "Interaction", "value": {"type": "user_elicitation", "role": "assistant", "content": "It's great to finally sit down and chat about your investment goals. I'm excited to help you make informed decisions about your money. Let's get started! To begin with, what type of industry or sector are you most interested in investing in? Are you drawn to technology, healthcare, finance, or something else?"}}
|
5 |
+
{"user_id": "user_2_0_0", "uuid": "25621010-2a46-4d19-bacf-f74c6dbbc9a5", "timestamp": "2025-03-24 14:06:12", "type": "interaction", "value": {"type": "Exxon Mobil Corporation", "role": "user", "content": "Hey"}}
|
6 |
+
{"user_id": "user_2_0_0", "uuid": "25621010-2a46-4d19-bacf-f74c6dbbc9a5", "timestamp": "2025-03-24 14:06:12", "type": "interaction", "value": {"type": "Exxon Mobil Corporation", "role": "assistant", "content": "I've been reviewing the information on Exxon Mobil Corporation, and I have to say, it's a large and established player in the energy industry. Given your interest in technology, healthcare, and finance, I'm not sure if this stock aligns perfectly with your profile. However, Exxon Mobil does have a strong track record of dividend payments and has been increasing its dividend for 41 consecutive years. \n\nThe company's earnings and cash flow from operations have been strong, driven by its operational performance and structural earnings improvements. The acquisition of Pioneer Natural Resources is also expected to strengthen Exxon Mobil's position in the Permian Basin and drive synergies and growth.\n\nWhat would you like to know more about regarding Exxon Mobil Corporation?"}}
|
7 |
+
{"user_id": "user_2_0_0", "uuid": "25621010-2a46-4d19-bacf-f74c6dbbc9a5", "timestamp": "2025-03-24 14:06:35", "type": "interaction", "value": {"type": "Eli Lilly and Company", "role": "user", "content": "Hey"}}
|
8 |
+
{"user_id": "user_2_0_0", "uuid": "25621010-2a46-4d19-bacf-f74c6dbbc9a5", "timestamp": "2025-03-24 14:06:35", "type": "interaction", "value": {"type": "Eli Lilly and Company", "role": "assistant", "content": "I'm so glad you're here. I've been looking forward to our conversation about Eli Lilly and Company. This is a well-established player in the healthcare industry, and I think it's worth exploring further. Eli Lilly has a long history of developing innovative treatments for various diseases, including diabetes, cancer, and mental health conditions. Their portfolio includes some of the most popular medications in the market, such as Humalog and Jardiance.\n\nGiven your interest in the healthcare industry, I think Eli Lilly could be a great fit for you. However, I'd love to know more about your investment goals and risk tolerance. What would you like to know more about Eli Lilly and Company?"}}
|
9 |
+
{"user_id": "user_2_0_0", "uuid": "25621010-2a46-4d19-bacf-f74c6dbbc9a5", "timestamp": "2025-03-24 14:07:48", "type": "interaction", "value": {"type": "user_elicitation", "role": "user", "content": "Hey"}}
|
10 |
+
{"user_id": "user_2_0_0", "uuid": "25621010-2a46-4d19-bacf-f74c6dbbc9a5", "timestamp": "2025-03-24 14:07:48", "type": "Interaction", "value": {"type": "user_elicitation", "role": "assistant", "content": "It's great to finally sit down and chat about your investment goals. I'm excited to help you find the right fit for your portfolio. Let's get started \u2013 what industry or sector are you most interested in investing in? Are you drawn to technology, healthcare, finance, or something else?"}}
|
11 |
+
{"user_id": "user_2_0_0", "uuid": "25621010-2a46-4d19-bacf-f74c6dbbc9a5", "timestamp": "2025-03-24 14:08:05", "type": "Interaction", "value": {"type": "user_elicitation", "role": "user", "content": "are you optimistic or pragmatic? "}}
|
12 |
+
{"user_id": "user_2_0_0", "uuid": "25621010-2a46-4d19-bacf-f74c6dbbc9a5", "timestamp": "2025-03-24 14:08:05", "type": "Interaction", "value": {"type": "user_elicitation", "role": "assistant", "content": "I like to think I'm a mix of both. As a financial advisor, I believe in being realistic about the market, but also in being open to opportunities that can help my clients grow their wealth. Now, let's get back to your investment preferences \u2013 what industry or sector are you leaning towards?"}}
|
13 |
+
{"user_id": "user_2_0_0", "uuid": "25621010-2a46-4d19-bacf-f74c6dbbc9a5", "timestamp": "2025-03-24 14:08:29", "type": "interaction", "value": {"type": "user_elicitation", "role": "user", "content": "Hey"}}
|
14 |
+
{"user_id": "user_2_0_0", "uuid": "25621010-2a46-4d19-bacf-f74c6dbbc9a5", "timestamp": "2025-03-24 14:08:29", "type": "Interaction", "value": {"type": "user_elicitation", "role": "assistant", "content": "I'm glad you're interested in discussing your investment options. To get started, I'd like to understand your preferred industry for investment. Are you interested in technology, healthcare, finance, consumer goods, or something else?"}}
|
15 |
+
{"user_id": "user_2_0_0", "uuid": "25621010-2a46-4d19-bacf-f74c6dbbc9a5", "timestamp": "2025-03-24 14:08:31", "type": "Interaction", "value": {"type": "user_elicitation", "role": "user", "content": "Are you pragmatic or optimistic? "}}
|
16 |
+
{"user_id": "user_2_0_0", "uuid": "25621010-2a46-4d19-bacf-f74c6dbbc9a5", "timestamp": "2025-03-24 14:08:31", "type": "Interaction", "value": {"type": "user_elicitation", "role": "assistant", "content": "I'm a practical advisor, focused on making informed decisions based on data and historical trends. This conversation is about understanding your investment preferences, not about my personal outlook. Let's focus on your industry preferences. Which one of the options I mentioned earlier resonates with you?"}}
|
user_feedback_debug/interaction_32f1379c-0f8c-49a6-99e3-6cbc0ab6222f_first.json
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
{"user_id": "user_0_0_0", "uuid": "32f1379c-0f8c-49a6-99e3-6cbc0ab6222f", "timestamp": "2025-03-24 11:02:58", "type": "interaction", "value": {"type": "user_elicitation", "role": "user", "content": "Hey"}}
|
2 |
+
{"user_id": "user_0_0_0", "uuid": "32f1379c-0f8c-49a6-99e3-6cbc0ab6222f", "timestamp": "2025-03-24 11:02:58", "type": "Interaction", "value": {"type": "user_elicitation", "role": "assistant", "content": "Welcome to our financial planning session. I'm excited to help you achieve your investment goals. To get started, let's talk about your preferred industry for investment. Are you interested in technology, healthcare, finance, consumer goods, energy, or something else?"}}
|
user_feedback_debug/interaction_c7a2e8d7-861a-40e7-b102-63731a8f8ebe_first.json
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{"user_id": "user_0_0_0", "uuid": "c7a2e8d7-861a-40e7-b102-63731a8f8ebe", "timestamp": "2025-03-24 12:59:44", "type": "interaction", "value": {"type": "user_elicitation", "role": "user", "content": "Hey"}}
|
2 |
+
{"user_id": "user_0_0_0", "uuid": "c7a2e8d7-861a-40e7-b102-63731a8f8ebe", "timestamp": "2025-03-24 12:59:44", "type": "Interaction", "value": {"type": "user_elicitation", "role": "assistant", "content": "Welcome to our financial planning session. I'm excited to help you achieve your investment goals. To get started, let's talk about your preferred industry for investment. Are you interested in technology, healthcare, finance, consumer goods, energy, or something else?"}}
|
3 |
+
{"user_id": "user_0_0_0", "uuid": "c7a2e8d7-861a-40e7-b102-63731a8f8ebe", "timestamp": "2025-03-24 12:59:51", "type": "interaction", "value": {"type": "Exxon Mobil Corporation", "role": "user", "content": "Hey"}}
|
4 |
+
{"user_id": "user_0_0_0", "uuid": "c7a2e8d7-861a-40e7-b102-63731a8f8ebe", "timestamp": "2025-03-24 12:59:51", "type": "interaction", "value": {"type": "Exxon Mobil Corporation", "role": "assistant", "content": "I'm glad you're interested in exploring investment opportunities. Today, we're going to discuss Exxon Mobil Corporation, a company that fits within your preferred industries, including energy. Exxon Mobil is a multinational oil and gas corporation that has been in operation for over 150 years. They engage in the exploration and production of crude oil and natural gas, as well as the manufacturing and marketing of various petroleum products.\n\nGiven your interest in energy and dividend stocks, Exxon Mobil's strong earnings and cash flow from operations, as well as its commitment to returning value to shareholders through dividend increases and share repurchases, make it an attractive option. However, it's essential to consider the company's beta, which indicates a relatively lower risk profile compared to the overall market.\n\nWhat would you like to know more about Exxon Mobil Corporation? Would you like to discuss its financial performance, its business segments, or something else?"}}
|
user_feedback_debug/summarization_25621010-2a46-4d19-bacf-f74c6dbbc9a5_first.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"user_id": "user_2_0_0", "uuid": "25621010-2a46-4d19-bacf-f74c6dbbc9a5", "timestamp": "2025-03-24 14:06:12", "type": "preference_elicitation_summarization", "value": {"summarization": "Based on our previous conversation, here's a summary of your investment preferences:\n\n1. **Preferred Industries:** Technology, healthcare, and finance are the industries you're most interested in investing in.\n2. **Value vs. Growth Stocks:** We haven't discussed your preference for value vs. growth stocks, so we'll need to explore this further.\n3. **Dividend vs. Non-Dividend Stocks:** Your preference for dividend vs. non-dividend stocks hasn't been discussed, so we'll need to explore this further.\n4. **Cyclical vs. Non-Cyclical Stocks:** We haven't discussed your preference for cyclical vs. non-cyclical stocks, so we'll need to explore this further."}}
|
user_feedback_debug/summarization_c7a2e8d7-861a-40e7-b102-63731a8f8ebe_first.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"user_id": "user_0_0_0", "uuid": "c7a2e8d7-861a-40e7-b102-63731a8f8ebe", "timestamp": "2025-03-24 12:59:49", "type": "preference_elicitation_summarization", "value": {"summarization": "Based on our previous conversation, here's a summary of your investment preferences:\n\n1. **Preferred Industries:** You have expressed interest in technology, healthcare, finance, consumer goods, and energy. However, we didn't discuss other potential industries.\n\n2. **Value vs. Growth Stocks:** We haven't discussed your preference between value and growth stocks. This aspect has not been discussed.\n\n3. **Dividend vs. Non-Dividend Stocks:** You have expressed a preference for dividend stocks, indicating a desire for regular income from your investments.\n\n4. **Cyclical vs. Non-Cyclical Stocks:** We haven't discussed your preference between cyclical and non-cyclical stocks. This aspect has not been discussed."}}
|