This commit is contained in:
Daniel Bedeleanu
2026-04-14 22:54:19 +03:00
parent 1ea5e90bc4
commit 6c57b1b0c2
69 changed files with 1020 additions and 554 deletions

37
config/ai_prompt.md Normal file
View File

@@ -0,0 +1,37 @@
# Technical Inventory Multi-Label Extraction Protocol
Your goal is to extract precise hardware specifications for ALL relevant inventory items found in the image.
## Intelligence Rules:
1. **Filtering Strategy**:
- **INCLUDE**: Standalone physical hardware, modules, cables, servers, and storage units.
- **EXCLUDE**: Generic mounting hardware (screws, nails, rails, brackets), paper licenses/documentation, or empty packaging, UNLESS they are the primary and only subject of the image.
- In cases like image labels listing multiple SKUs (e.g., 5m cable and 7m cable), TREAT EACH LINE AS A SEPARATE ITEM.
2. **Field Definitions**:
- **Item**: Primary identity (Manufacturer + Core Class). Max 3 words (e.g., "Cisco SFP Module").
- **Type**: Asset classification (e.g., "SFP", "patch cords", "NVMe").
- **Description**: Technical summary emphasizing speed/capacity. Max 5 words.
- **Category**: Broad ecosystem (e.g., "Network", "Storage").
- **Connector**: Physical interface (e.g., "LC/UPC", "RJ45").
- **Size**: Capacity or Length (e.g., "1.6TB", "5m").
- **Color**: Physical distinguish color.
- **PartNr**: Absolute technical identifier (P/N, SKU). Omit Serial Numbers.
- **OCR**: Concise technical string for local heuristic matching. **EXCLUDE ALL SERIAL NUMBERS.**
## Output Format:
Return ONLY a valid JSON object with the key "items" containing an array of objects.
Example:
{
"items": [
{
"Item": "SFP Module",
"Type": "SFP",
"Description": "64G Gen7 Fibre Channel",
"Category": "Network",
"Connector": "LC",
"PartNr": "SFP-64G-G7",
"OCR": "SFP 64G GEN7 FC"
}
]
}

View File

@@ -1,25 +0,0 @@
# ============================================================
# TFM aInventory — Backend Environment Variables
# Copy this file to .env and fill in real values.
# NEVER commit the real .env file to Git!
# ============================================================
# --- AI API Keys ---
# Google Gemini API Key (Required for AI label OCR onboarding)
# You can also set this in the root 'inventory.env' for Docker convenience.
GEMINI_API_KEY=your_gemini_api_key_here
# --- Security ---
# JWT secret key — generate a strong random value for production:
# python3 -c "import secrets; print(secrets.token_urlsafe(64))"
JWT_SECRET_KEY=change-me-generate-a-secure-random-value
# --- CORS & External Access ---
# The system automatically allows localhost and the local LAN IP.
# Use EXTRA_ALLOWED_ORIGINS for Tailscale, VPNs, or FQDNs.
# Example: EXTRA_ALLOWED_ORIGINS=100.78.182.27,inventory.my-domain.com
EXTRA_ALLOWED_ORIGINS=
# --- Data Paths (usually managed by startup scripts) ---
# DATA_DIR=/app/data
# LOGS_DIR=/app/logs