File size: 4,528 Bytes
be535f1
dacc583
 
be535f1
 
 
 
 
 
 
 
 
dacc583
be535f1
 
 
 
 
 
dacc583
 
 
 
be535f1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
class SessionState:
    do_evaluation = False
    do_voice = False
    status = "active"
    scenario = None
    qa_mode = "single"
    questions = []
    start_time = None
    end_time = None
    duration_minutes = None
    attitude = "Happy"
    mood_score = 5
    num_questions = 1
    current_question_index = 0
    previous_answer = None
    question = ""
    ground_truth = ""
    rep_answer = ""
    responses = []
    queries = []
    llm_responses = []
    command = ""
    scores = []
    class Company:
        def __init__(self, name, description, product, product_summary, product_description):
            self.name = name
            self.description = description
            self.product = product
            self.product_summary = product_summary
            self.product_description = product_description

    class Customer:
        def __init__(self, name, contact_name, contact_role):
            self.name = name
            self.contact_name = contact_name
            self.contact_role = contact_role
            self.background = None


    class Opportunity:
        def __init__(self, id, name, stage, description, value, close_date, activity, next_steps):
            self.id = id
            self.name = name
            self.stage = stage
            self.description = description
            self.value = value
            self.close_date = close_date
            self.activity = activity
            self.next_steps = next_steps
            
    def __init__(self):
        self.company = None
        self.customer = None
        self.opportunity = None
        self.scenario = None

    def add_company_info(self, name, description, product, product_summary, product_description):
        self.company = self.Company(name, description, product, product_summary, product_description)

    def add_customer_info(self, name, contact_name, contact_role):
        self.customer = self.Customer(name, contact_name, contact_role)

    def add_opportunity_info(self, id, name, stage, description, value, close_date, activity, next_steps):
        self.opportunity = self.Opportunity(id, name, stage, description, value, close_date, activity, next_steps) 

    def add_scenario_info(self, scenario_data):
        self.scenario = scenario_data
        self.add_opportunity_info(
            id=scenario_data['Opportunity ID'],
            name=scenario_data['Opportunity Name'],
            stage=scenario_data['Opportunity Stage'],
            description=scenario_data['Opportunity Description'],
            value=scenario_data['Opportunity Value'],
            close_date=scenario_data['Close Date'],
            activity=scenario_data['Activity'],
            next_steps=scenario_data['Next Steps']  
        )
        self.add_customer_info(
            name=scenario_data['Customer Name'],
            contact_name=scenario_data['Customer Contact'],
            contact_role=scenario_data['Customer Contact Role']
        )

    def get_opening(self):
        output_lines = [
            "**New Scenario**",
            f"**Customer:** {self.customer.name if self.customer else 'Unknown'}",
            f"**Opportunity:** {self.opportunity.name if self.opportunity else 'Unknown'}",
            f"**Value:** {self.opportunity.value if self.opportunity and hasattr(self.opportunity, 'value') else 'Unknown'}",
            f"**Stage:** {self.opportunity.stage if self.opportunity else 'N/A'}",
            f"**Target Close Date:** {self.opportunity.close_date if self.opportunity and hasattr(self.opportunity, 'close_date') else 'Unknown'}",
            f"**Opportunity Description:** {self.opportunity.description if self.opportunity else 'Unknown'}",
            f"**Meeting with:** {self.customer.contact_name} ({self.customer.contact_role})",
            f"**Activity:** {self.opportunity.activity if self.opportunity and hasattr(self.opportunity, 'activity') else 'Unknown'}",
            f"**Current Meeting:** {self.opportunity.next_steps if self.opportunity and hasattr(self.opportunity, 'next_steps') else 'Unknown'}"
        ]
        output = "\n".join(output_lines)
        return output
    
    def __str__(self):
        company_info = f"{self.company.name} - " if self.company else ""
        customer_info = f"for {self.customer.name}" if self.customer else ""
        opportunity_info = f"{self.opportunity.name} ({self.opportunity.stage})" if self.opportunity else "No opportunity set"
        return f"{company_info}Scenario: {opportunity_info} {customer_info}".strip()