Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -29,18 +29,23 @@ app.config['UPLOAD_FOLDER'] = UPLOAD_FOLDER
|
|
29 |
|
30 |
# Refined Instructions for Gemini
|
31 |
GEMINI_INSTRUCTIONS = """
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
|
|
|
|
|
|
|
|
|
|
44 |
"""
|
45 |
|
46 |
# Home route to serve the index.html file from the root directory
|
@@ -81,19 +86,17 @@ def generate_api():
|
|
81 |
|
82 |
result_text = ''.join(buffer).lower()
|
83 |
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
else:
|
96 |
-
selected_option = "Could not determine the correct option."
|
97 |
|
98 |
# Return the transcription and selected option
|
99 |
return jsonify({
|
|
|
29 |
|
30 |
# Refined Instructions for Gemini
|
31 |
GEMINI_INSTRUCTIONS = """
|
32 |
+
**Step 1: Identify the Agent**
|
33 |
+
- The agent is the representative from the company who interacts with the customer. They typically provide information, answer questions, or ask about the customer's car or services.
|
34 |
+
- Clues that can help identify the agent:
|
35 |
+
- They often have structured and formal responses.
|
36 |
+
- They provide company information such as service hours, contact details, or specific procedures.
|
37 |
+
- They ask questions related to the customer's inquiry, especially about the car (e.g., make, model, condition).
|
38 |
+
- Their language is more focused on offering help or gathering information rather than seeking help.
|
39 |
+
|
40 |
+
**Step 2: Determine the Correct Option**
|
41 |
+
**Option 1 (Yes)**:
|
42 |
+
Agent offered two dates and times
|
43 |
+
Example: Agent: “I have Wednesday 3:00 or Thursday at 10:00, if either of those times are good for you.”
|
44 |
+
Agent offered multiple days and narrowed down to specific times
|
45 |
+
Example: Agent: “Can you do Monday or Tuesday?” // Caller: “Tuesday is better for me.” // Agent: “What's better? I have 10:00 AM or 2:00 PM.”
|
46 |
+
Example: Agent: “Can you do Friday afternoon or Saturday morning?” // Caller: “Friday afternoon might work.” // Agent: “How does 3:00 PM sound?”
|
47 |
+
**Option 2 (No)**:
|
48 |
+
Agent did not offer two dates and times
|
49 |
"""
|
50 |
|
51 |
# Home route to serve the index.html file from the root directory
|
|
|
86 |
|
87 |
result_text = ''.join(buffer).lower()
|
88 |
|
89 |
+
const options = {
|
90 |
+
'option 1': 1,
|
91 |
+
'option 2': 2,
|
92 |
+
};
|
93 |
+
|
94 |
+
for (let option in options) {
|
95 |
+
if (resultText.includes(option)) {
|
96 |
+
selectedOption = options[option];
|
97 |
+
break; // Exit the loop once the option is found
|
98 |
+
}
|
99 |
+
}
|
|
|
|
|
100 |
|
101 |
# Return the transcription and selected option
|
102 |
return jsonify({
|