Spaces:
Running
Running
File size: 1,282 Bytes
e41d723 0b52cfc aea14e1 0b52cfc e41d723 aea14e1 e41d723 0b52cfc aea14e1 0b52cfc aea14e1 0b52cfc aea14e1 0b52cfc aea14e1 0b52cfc aea14e1 0b52cfc | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 | ---
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.
|