demo mount to fastapi

This commit is contained in:
Xin Wang
2026-05-22 10:23:17 +08:00
parent 0d82acc0d2
commit 2c7f0f440b
10 changed files with 86 additions and 22 deletions

View File

@@ -25,7 +25,7 @@ uv venv .venv
source .venv/bin/activate
uv pip install -r requirements.txt
export OPENAI_API_KEY=...
uv run uvicorn engine.main:app --reload --host 0.0.0.0 --port 8001
uv run uvicorn engine.main:app --reload --host 0.0.0.0 --port 8000
```
Or pass keys directly in `config.json`.
@@ -34,12 +34,21 @@ Or pass keys directly in `config.json`.
uv run python -m engine.main --config ./config.json
```
Browser demo (served from the same process when `server.serve_webpage` is
true in `config.json`):
```text
http://localhost:8000/demo/
```
See `examples/webpage/README.md` for details.
## Protocols
Pipecat-native endpoint:
```text
ws://localhost:8001/ws
ws://localhost:8000/ws
```
The websocket payloads are Pipecat protobuf frames. A client should use Pipecat's websocket client/serializer stack or generate frames compatible with `pipecat.frames.protobufs.frames_pb2`.
@@ -54,7 +63,7 @@ Important defaults:
Product endpoint:
```text
ws://localhost:8001/ws-product
ws://localhost:8000/ws-product
```
This endpoint uses a stable JSON/base64 protocol named `va.ws.v1`. It is meant for browser, mobile, or other product applications that should not depend on Pipecat's internal protobuf frame schema.