Spaces:
Sleeping
Sleeping
File size: 980 Bytes
ac1f51b |
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 |
# app/sim_api_bridge.py
from __future__ import annotations
from typing import List, Dict, Any
from app.sim_api import place_order
from app.catalog import load_catalog
def get_hours() -> Dict[str, Any]:
c = load_catalog()
return {"hours": c.get("hours"), "address": c.get("address"), "phone": c.get("phone")}
def menu_lookup(filters: List[str]) -> List[Dict[str, Any]]:
# naive filter: return all items and let the LLM filter in text for now
c = load_catalog()
return c.get("items", [])
def create_reservation(name: str, phone: str | None, party_size: int, datetime_str: str) -> Dict[str, Any]:
# Simulate success
return {
"ok": True,
"reservation_id": "sim-" + str(abs(hash((name, phone, party_size, datetime_str))))[:8],
"name": name,
"party_size": party_size,
"when": datetime_str,
"phone": phone,
}
def create_order(items: List[Dict[str, Any]]) -> Dict[str, Any]:
return place_order(items) |