Using the small-webrtc-prebuilt-ui
This commit is contained in:
@@ -4,3 +4,4 @@ uvicorn
|
|||||||
aiortc
|
aiortc
|
||||||
opencv-python
|
opencv-python
|
||||||
pipecat-ai[google,silero]
|
pipecat-ai[google,silero]
|
||||||
|
pipecat-ai-small-webrtc-prebuilt
|
||||||
@@ -8,6 +8,8 @@ import uvicorn
|
|||||||
from bot import run_bot
|
from bot import run_bot
|
||||||
from dotenv import load_dotenv
|
from dotenv import load_dotenv
|
||||||
from fastapi import BackgroundTasks, FastAPI
|
from fastapi import BackgroundTasks, FastAPI
|
||||||
|
from fastapi.responses import RedirectResponse
|
||||||
|
from pipecat_ai_small_webrtc_prebuilt.frontend import SmallWebRTCPrebuiltUI
|
||||||
|
|
||||||
from pipecat.transports.network.webrtc_connection import SmallWebRTCConnection
|
from pipecat.transports.network.webrtc_connection import SmallWebRTCConnection
|
||||||
|
|
||||||
@@ -23,6 +25,14 @@ pcs_map: Dict[str, SmallWebRTCConnection] = {}
|
|||||||
|
|
||||||
ice_servers = ["stun:stun.l.google.com:19302"]
|
ice_servers = ["stun:stun.l.google.com:19302"]
|
||||||
|
|
||||||
|
# Mount the frontend at /
|
||||||
|
app.mount("/prebuilt", SmallWebRTCPrebuiltUI)
|
||||||
|
|
||||||
|
|
||||||
|
@app.get("/", include_in_schema=False)
|
||||||
|
async def root_redirect():
|
||||||
|
return RedirectResponse(url="/prebuilt/")
|
||||||
|
|
||||||
|
|
||||||
@app.post("/api/offer")
|
@app.post("/api/offer")
|
||||||
async def offer(request: dict, background_tasks: BackgroundTasks):
|
async def offer(request: dict, background_tasks: BackgroundTasks):
|
||||||
|
|||||||
Reference in New Issue
Block a user