Spaces:
Sleeping
Sleeping
Update app.py
Browse filesInstructions Updated
app.py
CHANGED
@@ -29,51 +29,62 @@ app.config['UPLOAD_FOLDER'] = UPLOAD_FOLDER
|
|
29 |
|
30 |
# Refined Instructions for Gemini
|
31 |
GEMINI_INSTRUCTIONS = """
|
32 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
33 |
|
34 |
-
Option 1 (New patient/client/customer who has not previously been to this office):
|
35 |
-
|
36 |
-
- Select this option if the caller is a potential new client calling the office to schedule an appointment or evaluation.
|
37 |
-
- Example: Caller says, "Hi, I would like to set an appointment."// Receptionist or agent: "Sure! Have you been seen in our office before?" // Caller: "No, this will be my first time.
|
38 |
-
- Example: Caller says, "Hello! I am looking for a new dentist. You were recommended to me by a friend."
|
39 |
-
- Example: Caller says, "I'm new to the area and I'm looking to get an appointment."
|
40 |
-
- Select this option if neither the caller nor the agent explicitly identifies whether the caller is new or returning, but the agent collects the patient’s information as if creating a new file (e.g., Name, Number, DOB, Address, Insurance). In this case, we will only select option 1 if the agent is talking proper information like name number DOB insurance and treating the caller as a new patient.
|
41 |
-
|
42 |
-
- Select this option when the caller asks if the office accepts their insurance, and there is no indication they’ve visited the office before. Caller will mostly use the sentences like "Do you guys take (than name of his/her insurance company)?". Another sentence they use mostly to ask this question is, "Do you guys accept (than name of his/her insurance company)?".
|
43 |
-
- Select this option if the caller asks for the location of the practice and does not clearly identify themselves as an existing patient.
|
44 |
-
|
45 |
-
- If the call contains both a new appointment opportunity for a new client and a mention of an upcoming appointment for an existing client, choose Option 1.
|
46 |
-
- Sometimes the caller will be an existing patient but he/she will be scheduling an appointmnet for a new patient or pet so we will consider it as a New Patient as the appointment is being set up for a new Patient.
|
47 |
-
- Example: Caller says, "I have been to the clinic before and I want to set up an appointment for my new pet". Agent, "confirms caller name from the system and sets an appointment". In this example, as the caller is already in the system and has been to the clinic before but the caller is attempting the set up an appointment for her new pet who has never been to the clinic before so this will be considered as a New Patient and we will select Option 1.
|
48 |
-
- Even if the caller's information is in the system but the caller informs that he/she has never been to the dealership or some other clinic has shared her information to this clinic, he/she will be considered as a New Patient.
|
49 |
-
- Select this option if the caller is calling on behalf of a potential new patient or client.
|
50 |
-
- Example: Caller says, "Hi, I'm calling on behalf of a potential patient..."
|
51 |
-
- Select this optoin if the caller says she is a patient at another loation and she wants to set up an appointment with this location. In this case, the agent will be able to pull customer's information using the other location portal but such reviews will go to option 1 until or unless the caller or agent does not clearly specifies that the patient has been to this location too.
|
52 |
-
- Additional examples to select Option 1:
|
53 |
-
- Caller says, "I just bought a new dog" (implying a new pet needing care).
|
54 |
-
- Caller mentions that someone referred them to the clinic.
|
55 |
-
- Caller says, she use to be a patient at another place and she wants to transfer her care to this clinic. We will select Option 1 untill or unless there is no other indication if the patient is current or existing.
|
56 |
-
- The agent confirms that the customer has never been to the clinic in the past.
|
57 |
-
- During the review, if the agent tells the caller that they will consider the caller as a new patient, we will select Option 1 no matter if the caller has been to the clinic or not because the agent has informed that they will consider the caller as a new patient.
|
58 |
-
- If the caller mentions that she just signed up online for an account, means he/she is a new patient.
|
59 |
-
Option 2 (Current patient/client/customer who has been to the office previously):
|
60 |
-
|
61 |
-
- Select this option if the caller has been to the office before.
|
62 |
-
- Example: Caller says, "I was in the office yesterday to get fillings, but one fell out, and I need to come back."
|
63 |
-
|
64 |
-
- Select this option if the agent asks for the caller's name/information and then confirms the patient’s information as if it’s already on file.
|
65 |
-
- Example: Caller says, "Hi, I was just there for a check-up."
|
66 |
-
Note:
|
67 |
-
- If the caller provide only Name and there is no indication that the caller has been their before Select Unknown option.
|
68 |
-
- If a caller says, he/she has spoken with the clinic before but their is no indication that she has actually been to the clinic we will NOT select it as an existing patient but we will mark it as Select Unknown option.
|
69 |
-
Option 3 (Could Not Determine):
|
70 |
-
- Only select Option 3 (Could Not Determine) if the review falls in the following examples.
|
71 |
-
- Example: Caller says, "I was wondering do you guys have an availability for dog grooming today?". Agent, "Unfortunatly, we are fully booked today". Caller, "Okay, thank you".
|
72 |
-
- Example: Caller asks, "How much do you charge for full day boarding?". Agent: "Provides the charges information and call end".
|
73 |
-
Note: Only select Option 3 (Could Not Determine) if the review falls in the above two examples or similer to them and both have no other clue if the patient or pet is a new patient or an existing one. Sometimes, in such examples, we will have a clue if a patient or pet is a new or an existing, we will choose New or an existing whatever the clue we get. Any other review, which does not fall in the above two examples and there is no confirmation if the patient is a New or an Exisiting, Select Unknown Option.
|
74 |
-
Option 4 (Unfamiliar or Unknown):
|
75 |
-
- Select this option if the review is confusing and there is no indication if the patient is a new or an existing and two given examples in the Option 3 (Could Not Determine) are not fulfilling or if the conversation is too ambiguous to determine whether the caller is a new or current patient/client/customer.
|
76 |
-
- Select this option if we have no indication if the caller is a new or an existing patient or the call does not fall into the mentioned examples in the Option 3 too.
|
77 |
"""
|
78 |
|
79 |
# Home route to serve the index.html file from the root directory
|
|
|
29 |
|
30 |
# Refined Instructions for Gemini
|
31 |
GEMINI_INSTRUCTIONS = """
|
32 |
+
The purpose of this classification is to determine whether a caller has agreed to visit the dealership at a specific time or within a certain time range.
|
33 |
+
|
34 |
+
### Option 1: (Yes, at a specific time or range of time within 1 hour):
|
35 |
+
A call falls into this category if the caller explicitly agrees to visit the dealership at a specific time or within a one-hour range.
|
36 |
+
|
37 |
+
#### Criteria:
|
38 |
+
- Caller explicitly mentions a specific time (e.g., "I'll be there at 4:00").
|
39 |
+
- Caller gives an estimated arrival time within a one-hour range (e.g., "I'll be there in 30 minutes").
|
40 |
+
- Caller provides a loose time range, but the agent confirms a firm time (e.g., Caller: "Between 6:00 and 8:00," Agent: "I'll put you down for 7:00").
|
41 |
+
- Caller is already on the dealership lot (walk-in).
|
42 |
+
|
43 |
+
#### Examples (Accepted for this Option):
|
44 |
+
- "I'm going to come in and take a look at 4:00."
|
45 |
+
- "I'll stop by around 3:00 on Saturday."
|
46 |
+
- "I'll try to go test drive it at noon."
|
47 |
+
- "I'm on my way right now, and I'll be there in just a few minutes."
|
48 |
+
- "I'll come down in 30 minutes if it's still on the lot."
|
49 |
+
- "I'll be there in about 45-60 minutes."
|
50 |
+
|
51 |
+
#### Not Considered Specific (Excluded from this Option):
|
52 |
+
- "I'll come after 4:00" (since the arrival time is unknown, it could be anytime after 4 PM).
|
53 |
+
- "I'll be at the dealership till 4 PM" (caller could arrive anytime before 4 PM).
|
54 |
+
- "I'll be there between 7:00 and 9:00" (exceeds a one-hour range).
|
55 |
+
|
56 |
+
---
|
57 |
+
|
58 |
+
### Option 2: (Yes, at a loose time or range of time exceeding 1 hour):
|
59 |
+
A call falls into this Option if the caller expresses an intention to visit but does not provide a specific or one-hour time range.
|
60 |
+
|
61 |
+
#### Criteria:
|
62 |
+
- Caller agrees to visit but gives a broad time frame (longer than one hour).
|
63 |
+
- Caller uses vague terms such as "sometime today" or "this evening."
|
64 |
+
- Caller mentions visiting based on a conditional factor (e.g., "If I get off work early, I'll stop in").
|
65 |
+
|
66 |
+
#### Examples (Accepted for this category):
|
67 |
+
- "I'll stop by sometime today."
|
68 |
+
- "My wife will go there Saturday."
|
69 |
+
- "I might be there to test drive it this evening."
|
70 |
+
- "I get off work at 5:00, and I'll come by after that."
|
71 |
+
- "I'll be there tonight between 7:00 and 9:00."
|
72 |
+
- "Maybe I'll come take a look at it later."
|
73 |
+
- "If I get off work early, I'll stop in."
|
74 |
+
|
75 |
+
---
|
76 |
+
### Option 3:
|
77 |
+
if call didnot fall in option 1 or option2 then select option 3
|
78 |
+
|
79 |
+
### Classification Logic Summary:
|
80 |
+
1. If the caller specifies an exact time or an estimated arrival time within one hour → **optiony 1 (Specific time or within 1 hour).**
|
81 |
+
2. If the caller provides a time range longer than one hour or speaks vaguely about their visit → **Option 2 (Loose time or exceeding 1 hour).**
|
82 |
+
|
83 |
+
Based on this classification, return the appropriate option from:
|
84 |
+
- **Option 1**: Specific time or within 1 hour.
|
85 |
+
- **Option 2**: Loose time or exceeding 1 hour.
|
86 |
+
|
87 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
88 |
"""
|
89 |
|
90 |
# Home route to serve the index.html file from the root directory
|