Spaces:
Sleeping
Sleeping
Mudassir939
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -4,12 +4,9 @@ from flask import Flask, jsonify, request, send_file, send_from_directory
|
|
4 |
from langchain_core.messages import HumanMessage
|
5 |
from langchain_google_genai import ChatGoogleGenerativeAI
|
6 |
import assemblyai as aai
|
7 |
-
#import mimetypes
|
8 |
from dotenv import load_dotenv
|
9 |
|
10 |
-
#
|
11 |
-
#mimetypes.add_type('text/css', '.css')
|
12 |
-
|
13 |
load_dotenv()
|
14 |
|
15 |
# Initialize the Flask app
|
@@ -18,8 +15,7 @@ app = Flask(__name__)
|
|
18 |
# Get API keys from environment variables
|
19 |
ASSEMBLYAI_API_KEY = os.getenv("ASSEMBLYAI_API_KEY")
|
20 |
GOOGLE_API_KEY = os.getenv("GOOGLE_API_KEY")
|
21 |
-
|
22 |
-
print(f"Google API Key: {GOOGLE_API_KEY}")
|
23 |
# Set AssemblyAI API key
|
24 |
aai.settings.api_key = ASSEMBLYAI_API_KEY
|
25 |
|
@@ -44,7 +40,7 @@ Consider the following options and select the one that best matches the content
|
|
44 |
Remember:
|
45 |
- Option 1 should only be selected if there was a live conversation with the intended contact.
|
46 |
- Option 4 should be selected if the call was not connected (e.g., it was a voicemail or no live interaction occurred).
|
47 |
-
- Option 4 it is
|
48 |
"""
|
49 |
|
50 |
# Home route to serve the index.html file from the root directory
|
|
|
4 |
from langchain_core.messages import HumanMessage
|
5 |
from langchain_google_genai import ChatGoogleGenerativeAI
|
6 |
import assemblyai as aai
|
|
|
7 |
from dotenv import load_dotenv
|
8 |
|
9 |
+
# Load environment variables from the .env file
|
|
|
|
|
10 |
load_dotenv()
|
11 |
|
12 |
# Initialize the Flask app
|
|
|
15 |
# Get API keys from environment variables
|
16 |
ASSEMBLYAI_API_KEY = os.getenv("ASSEMBLYAI_API_KEY")
|
17 |
GOOGLE_API_KEY = os.getenv("GOOGLE_API_KEY")
|
18 |
+
|
|
|
19 |
# Set AssemblyAI API key
|
20 |
aai.settings.api_key = ASSEMBLYAI_API_KEY
|
21 |
|
|
|
40 |
Remember:
|
41 |
- Option 1 should only be selected if there was a live conversation with the intended contact.
|
42 |
- Option 4 should be selected if the call was not connected (e.g., it was a voicemail or no live interaction occurred).
|
43 |
+
- Option 4 if it is voicemail, make it option 4
|
44 |
"""
|
45 |
|
46 |
# Home route to serve the index.html file from the root directory
|