Merge pull request #1542 from pipecat-ai/small_webrtc_prebuilt_ui
Using the small-webrtc-prebuilt-ui
This commit is contained in:
@@ -35,9 +35,19 @@ cd server
|
|||||||
python server.py
|
python server.py
|
||||||
```
|
```
|
||||||
|
|
||||||
### 2️⃣ Connect Using the Client App
|
### 2️⃣ Test 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
|
## ⚠️ Important Note
|
||||||
Ensure the bot server is running before using any client implementations.
|
Ensure the bot server is running before using any client implementations.
|
||||||
|
|||||||
@@ -3,4 +3,5 @@ fastapi[all]
|
|||||||
uvicorn
|
uvicorn
|
||||||
aiortc
|
aiortc
|
||||||
opencv-python
|
opencv-python
|
||||||
pipecat-ai[google,silero]
|
pipecat-ai[google,silero,webrtc]
|
||||||
|
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