File size: 2,003 Bytes
27d491b
bab4aa8
 
 
 
27d491b
 
 
 
 
bab4aa8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
---
title: AIShoppingAssistance Server
emoji: πŸ”₯
colorFrom: indigo
colorTo: green
sdk: docker
pinned: false
---

Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference

## Current Directory Structure for the Server
```
hf_server/
β”œβ”€β”€ app/
β”‚   β”œβ”€β”€ __init__.py              # Python package marker
β”‚   β”œβ”€β”€ main.py                  # Main entrypoint (FastAPI, Middlewares, Routers, and lifespans)
β”‚   β”œβ”€β”€ config.py                # Server & model configuration constants
β”‚   β”œβ”€β”€ models/                  # Pydantic schemas / request-response models
β”‚   β”‚   β”œβ”€β”€ __init__.py
β”‚   β”‚   └── recipe.py            # Pydantic model for recipes
β”‚   β”œβ”€β”€ services/                # Heavy logic & external database clients
β”‚   β”‚   β”œβ”€β”€ __init__.py
β”‚   β”‚   β”œβ”€β”€ http_client.py       # Global HTTPX AsyncClient lifecycle
β”‚   β”‚   β”œβ”€β”€ detector.py          # CLIP/ONNX model and embedding generation
β”‚   β”‚   β”œβ”€β”€ chroma.py            # ChromaDB Searcher
β”‚   β”‚   └── supabase.py          # Supabase Querier
β”‚   β”œβ”€β”€ routes/                  # API endpoints
β”‚   β”‚   β”œβ”€β”€ __init__.py
β”‚   β”‚   β”œβ”€β”€ health.py            # health and root paths
β”‚   β”‚   β”œβ”€β”€ detection.py         # product detection, embeddings, and gallery
β”‚   β”‚   └── recipe.py            # recipe generation and cart agent
β”‚   └── agents/                  # AI agents & parser logic
β”‚       β”œβ”€β”€ __init__.py
β”‚       β”œβ”€β”€ shopping_assistant_agent.py # Main conversational agentic loop
β”‚       β”œβ”€β”€ recipe_agent.py      # Recipe agent orchestrator
β”‚       └── tools/               # Agent tools
β”‚           β”œβ”€β”€ __init__.py
β”‚           └── quantity_parser_tool.py # Quantity measurement parser
β”œβ”€β”€ requirements.txt
β”œβ”€β”€ Dockerfile                  # Updated entrypoint cmd
└── run_local.sh
```