Merge pull request #1542 from pipecat-ai/small_webrtc_prebuilt_ui

Using the small-webrtc-prebuilt-ui
This commit is contained in:
Filipi da Silva Fuchter
2025-04-10 07:39:26 -03:00
committed by GitHub
3 changed files with 24 additions and 3 deletions

View File

@@ -35,9 +35,19 @@ cd server
python server.py
```
### 2Connect Using the Client App
### 2Test with SmallWebRTC Prebuilt UI
For client-side setup, refer to the [JavaScript Guide](client/typescript/README.md).
You can quickly test your bot using the `SmallWebRTCPrebuiltUI`:
- Open your browser and navigate to:
👉 http://localhost:7860
- (Or use your custom port, if configured)
### 3⃣ Connect Using a Custom Client App
For client-side setup, refer to the:
- [Typescript Guide](client/typescript/README.md).
- [iOS Guide](client/ios/README.md).
## ⚠️ Important Note
Ensure the bot server is running before using any client implementations.

View File

@@ -3,4 +3,5 @@ fastapi[all]
uvicorn
aiortc
opencv-python
pipecat-ai[google,silero]
pipecat-ai[google,silero,webrtc]
pipecat-ai-small-webrtc-prebuilt

View File

@@ -8,6 +8,8 @@ import uvicorn
from bot import run_bot
from dotenv import load_dotenv
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
@@ -23,6 +25,14 @@ pcs_map: Dict[str, SmallWebRTCConnection] = {}
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")
async def offer(request: dict, background_tasks: BackgroundTasks):