Spaces:
Running
Running
| title: BF Realtime V2 | |
| emoji: ποΈ | |
| colorFrom: red | |
| colorTo: gray | |
| sdk: docker | |
| app_port: 7860 | |
| pinned: false | |
| # BF-Realtime V2 | |
| Trek Bisiklet sesli satis asistani. OpenAI gpt-realtime-2 + Trek katalog index + BizimHesap stok servisi. | |
| ## Modul yapisi | |
| | Dosya | Sorumluluk | | |
| |-------|-----------| | |
| | `app.py` | FastAPI routing + startup tasks | | |
| | `realtime_relay.py` | OpenAI Realtime WebSocket relay + event handling | | |
| | `product_index.py` | Trek katalog XML parse + thread-safe hash index | | |
| | `product_matcher.py` | Local fuzzy match + gpt-5-nano fallback | | |
| | `stock_service.py` | BizimHesap + Trek PHP stok cache (lock'lu) | | |
| | `tools.py` | `get_warehouse_stock` tool implementasyonu | | |
| | `prompts.py` | Sistem prompt iceriΔi | | |
| | `config.py` | Tum sabitler (URL, timeout, TTL) | | |
| ## Ekran | |
| `static/index.html` β Cift monitor UI (sol: avatar, sag: urun vitrini galeri). | |
| ## Endpoint'ler | |
| - `GET /` β Ana sayfa | |
| - `GET /health` β Saglik kontrolu | |
| - `WS /ws` β Realtime WebSocket | |
| - `GET /warehouse-xml` β Diger client'lar icin stok XML proxy | |
| - `GET /bh/{products,warehouses,inventory/{wid}}` β BizimHesap raw cache | |
| - `GET /debug-find?q=...` β Urun matcher debug | |
| - `GET /debug-search?q=...` β Tool debug | |
| ## Env | |
| `OPENAI_API_KEY` β Realtime + nano fallback icin. | |