aki-008
commited on
Commit
·
e0ba152
1
Parent(s):
1ff632a
minor fix
Browse files
Backend/app/api/v1/endpoints/interview.py
CHANGED
|
@@ -1,11 +1,13 @@
|
|
| 1 |
import os
|
|
|
|
| 2 |
import uvicorn
|
| 3 |
-
from fastapi import APIRouter, HTTPException, Request
|
| 4 |
from fastapi.middleware.cors import CORSMiddleware
|
| 5 |
from pydantic import BaseModel, Field
|
| 6 |
from app.config import settings
|
| 7 |
from vapi import Vapi
|
| 8 |
from dotenv import load_dotenv
|
|
|
|
| 9 |
|
| 10 |
load_dotenv()
|
| 11 |
|
|
@@ -37,7 +39,8 @@ class ConfigRequest(BaseModel):
|
|
| 37 |
# --- ENDPOINTS ---
|
| 38 |
|
| 39 |
@router.post("/api/get-vapi-config")
|
| 40 |
-
async def get_vapi_config(data: ConfigRequest
|
|
|
|
| 41 |
"""
|
| 42 |
Endpoint called by the Frontend to get the dynamically generated Assistant configuration.
|
| 43 |
"""
|
|
@@ -149,7 +152,8 @@ async def get_vapi_config(data: ConfigRequest):
|
|
| 149 |
|
| 150 |
|
| 151 |
@router.post("/api/webhook")
|
| 152 |
-
async def vapi_webhook_receiver(request: Request
|
|
|
|
| 153 |
"""
|
| 154 |
Endpoint that receives asynchronous events from Vapi's servers.
|
| 155 |
Saves transcripts to a local file.
|
|
|
|
| 1 |
import os
|
| 2 |
+
from app.models import User
|
| 3 |
import uvicorn
|
| 4 |
+
from fastapi import APIRouter, HTTPException, Request, Depends
|
| 5 |
from fastapi.middleware.cors import CORSMiddleware
|
| 6 |
from pydantic import BaseModel, Field
|
| 7 |
from app.config import settings
|
| 8 |
from vapi import Vapi
|
| 9 |
from dotenv import load_dotenv
|
| 10 |
+
from app.api.deps import get_db, get_current_user, get_chroma_collection
|
| 11 |
|
| 12 |
load_dotenv()
|
| 13 |
|
|
|
|
| 39 |
# --- ENDPOINTS ---
|
| 40 |
|
| 41 |
@router.post("/api/get-vapi-config")
|
| 42 |
+
async def get_vapi_config(data: ConfigRequest,
|
| 43 |
+
current_user: User = Depends(get_current_user)):
|
| 44 |
"""
|
| 45 |
Endpoint called by the Frontend to get the dynamically generated Assistant configuration.
|
| 46 |
"""
|
|
|
|
| 152 |
|
| 153 |
|
| 154 |
@router.post("/api/webhook")
|
| 155 |
+
async def vapi_webhook_receiver(request: Request,
|
| 156 |
+
current_user: User = Depends(get_current_user)):
|
| 157 |
"""
|
| 158 |
Endpoint that receives asynchronous events from Vapi's servers.
|
| 159 |
Saves transcripts to a local file.
|
Backend/requirements.txt
CHANGED
|
@@ -24,4 +24,5 @@ groq
|
|
| 24 |
websockets
|
| 25 |
pyaudio
|
| 26 |
SpeechRecognition
|
| 27 |
-
vapi-python
|
|
|
|
|
|
| 24 |
websockets
|
| 25 |
pyaudio
|
| 26 |
SpeechRecognition
|
| 27 |
+
vapi-python
|
| 28 |
+
vapi_server_sdk
|