Spaces:
Sleeping
Sleeping
Commit ·
d0796dd
1
Parent(s): d92d5ad
commit app
Browse files
app.py
CHANGED
|
@@ -26,7 +26,8 @@ def extract_pdf_text(pdf_path):
|
|
| 26 |
# Preload your PDF content (or load dynamically if preferred)
|
| 27 |
PDF_PATH = "resume.pdf" # <-- Path to your PDF
|
| 28 |
pdf_content = extract_pdf_text(PDF_PATH)
|
| 29 |
-
|
|
|
|
| 30 |
@app.route('/')
|
| 31 |
def home():
|
| 32 |
return "Flask API is running!"
|
|
@@ -37,7 +38,7 @@ def connect_rtc():
|
|
| 37 |
|
| 38 |
# Build the OpenAI API request URL
|
| 39 |
content=f''
|
| 40 |
-
url = f"{OPENAI_API_URL}?model=gpt-4o-realtime-preview-2024-12-17&instructions={
|
| 41 |
|
| 42 |
headers = {
|
| 43 |
"Authorization": f"Bearer {OPENAI_API_KEY}",
|
|
|
|
| 26 |
# Preload your PDF content (or load dynamically if preferred)
|
| 27 |
PDF_PATH = "resume.pdf" # <-- Path to your PDF
|
| 28 |
pdf_content = extract_pdf_text(PDF_PATH)
|
| 29 |
+
full_text="you are Soumyajit's AI assisstant, you greet by saying- how can I help you about Soumyajit, answer by wrapping the answers about soumyajit, and keep it as short as possible, "
|
| 30 |
+
full_text+=pdf_content
|
| 31 |
@app.route('/')
|
| 32 |
def home():
|
| 33 |
return "Flask API is running!"
|
|
|
|
| 38 |
|
| 39 |
# Build the OpenAI API request URL
|
| 40 |
content=f''
|
| 41 |
+
url = f"{OPENAI_API_URL}?model=gpt-4o-realtime-preview-2024-12-17&instructions={full_text}&voice=ash"
|
| 42 |
|
| 43 |
headers = {
|
| 44 |
"Authorization": f"Bearer {OPENAI_API_KEY}",
|