BF-Realtime / README.md
SamiKoen
Mirror V2 content into V1 (snapshot for continued development)
0b52cfc
---
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.