Spaces:
Runtime error
Runtime error
Managed ChatKit starter
Vite + React UI that talks to a FastAPI session backend for creating ChatKit workflow sessions.
Quick start
npm install # installs root deps (concurrently)
npm run dev # runs FastAPI on :8000 and Vite on :3000
What happens:
npm run devruns the backend viabackend/scripts/run.sh(FastAPI + uvicorn) and the frontend vianpm --prefix frontend run dev.- The backend exposes
/api/create-session, exchanging your workflow id andOPENAI_API_KEYfor a ChatKit client secret. The Vite dev server proxies/api/*to127.0.0.1:8000.
Required environment
OPENAI_API_KEYVITE_CHATKIT_WORKFLOW_ID- (optional)
CHATKIT_API_BASEorVITE_CHATKIT_API_BASE(defaults tohttps://api.openai.com) - (optional)
VITE_API_URL(override the dev proxy target for/api)
Set the env vars in your shell (or process manager) before running. Use a
workflow id from Agent Builder (starts with wf_...) and an API key from the
same project and organization.
Customize
- UI:
frontend/src/components/ChatKitPanel.tsx - Session logic:
backend/app/main.py