refactor: rebrand project to HartOMat
This commit is contained in:
1 parent
fa7093307a
commit
b795f0e6d6
95 files changed
+608
-497
No files matched your search
@@ -8,12 +8,12 @@ from pathlib import Path
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
VALIDATION_PROMPT = """You are a quality control expert for Schaeffler bearing product catalog images.
|
||||
VALIDATION_PROMPT = """You are a quality control expert for HartOMat bearing product catalog images.
|
||||
|
||||
Analyze this thumbnail of a bearing/mechanical component and evaluate:
|
||||
1. Is the component orientation correct for a standard product catalog? (typically isometric view, 30° elevation, 45° rotation)
|
||||
2. Are the key features visible? (rolling elements, rings, cage if present)
|
||||
3. Does it match standard Schaeffler catalog angle conventions?
|
||||
3. Does it match standard HartOMat catalog angle conventions?
|
||||
|
||||
Respond in JSON with exactly these fields:
|
||||
{
|
||||
|
||||
@@ -18,7 +18,7 @@ logger = logging.getLogger(__name__)
|
||||
|
||||
# ── System prompt ────────────────────────────────────────────────────────────
|
||||
|
||||
SYSTEM_PROMPT = """You are the Schaeffler Automat AI assistant. You help users manage their automated render pipeline for Schaeffler product images.
|
||||
SYSTEM_PROMPT = """You are the HartOMat AI assistant. You help users manage their automated render pipeline for HartOMat product images.
|
||||
|
||||
You can:
|
||||
- List and search orders and products
|
||||
@@ -39,8 +39,8 @@ RULES:
|
||||
7. Respond in the same language the user writes in.
|
||||
8. Be concise — short answers are better than long ones.
|
||||
9. When the user says "beliebig", "any", "random", "irgendein" — just pick one yourself, don't ask back.
|
||||
10. Material system: Materials have SCHAEFFLER library names (e.g. SCHAEFFLER_020101_Durotect-Blue). Common names like "Durotect", "Stahl", "Bronze" are aliases that map to these library names. When the user asks for a material by a common name, use list_materials to find the correct SCHAEFFLER name, then use that for material_override.
|
||||
11. When setting material_override, always use the full SCHAEFFLER library name (e.g. SCHAEFFLER_020101_Durotect-Blue), never the alias.
|
||||
10. Material system: Materials have HARTOMAT library names (e.g. HARTOMAT_020101_Durotect-Blue). Common names like "Durotect", "Stahl", "Bronze" are aliases that map to these library names. When the user asks for a material by a common name, use list_materials to find the correct HARTOMAT name, then use that for material_override.
|
||||
11. When setting material_override, always use the full HARTOMAT library name (e.g. HARTOMAT_020101_Durotect-Blue), never the alias.
|
||||
12. When mentioning a product, ALWAYS link to it: [ProductName](/products/UUID). When mentioning an order, link to it: [OrderNumber](/orders/UUID). This makes the response navigable.
|
||||
13. Materials exist at TWO levels: (a) product_material — materials assigned to the product's CAD parts (from STEP/Excel import, e.g. "Durotect_M", "Stahl"), and (b) material_override — a single material applied to ALL parts at render time. When user asks for a product "with Durotect material", search product_material FIRST (products that naturally have Durotect parts). Only use material_override filter if they specifically say "override" or "alle Teile in".
|
||||
14. NEVER say "no renders found" when renders DO exist. If no exact match, show the closest match and explain what's different."""
|
||||
@@ -120,7 +120,7 @@ TOOLS = [
|
||||
},
|
||||
"material_override": {
|
||||
"type": "string",
|
||||
"description": "Optional SCHAEFFLER library material name to apply to all lines.",
|
||||
"description": "Optional HARTOMAT library material name to apply to all lines.",
|
||||
"default": "",
|
||||
},
|
||||
},
|
||||
@@ -176,7 +176,7 @@ TOOLS = [
|
||||
},
|
||||
"material_name": {
|
||||
"type": "string",
|
||||
"description": "SCHAEFFLER library material name, or empty string to clear.",
|
||||
"description": "HARTOMAT library material name, or empty string to clear.",
|
||||
},
|
||||
},
|
||||
"required": ["order_id", "material_name"],
|
||||
@@ -250,7 +250,7 @@ TOOLS = [
|
||||
"type": "function",
|
||||
"function": {
|
||||
"name": "list_materials",
|
||||
"description": "List available SCHAEFFLER library materials with their aliases. Use this to find the correct material name for material_override. Materials have names like SCHAEFFLER_010101_Steel-Bare. Aliases map common names (Stahl, Bronze, Durotect, etc.) to these library materials. When user asks for a material by a common name, search aliases to find the correct SCHAEFFLER library material name.",
|
||||
"description": "List available HARTOMAT library materials with their aliases. Use this to find the correct material name for material_override. Materials have names like HARTOMAT_010101_Steel-Bare. Aliases map common names (Stahl, Bronze, Durotect, etc.) to these library materials. When user asks for a material by a common name, search aliases to find the correct HARTOMAT library material name.",
|
||||
"parameters": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
@@ -671,13 +671,13 @@ async def _tool_check_materials(db: AsyncSession, tenant_id: str, user_id: str =
|
||||
async def _tool_list_materials(db: AsyncSession, tenant_id: str, query: str = "") -> str:
|
||||
"""List library materials with their aliases."""
|
||||
sql = """
|
||||
SELECT m.id, m.name, m.schaeffler_code, m.description,
|
||||
SELECT m.id, m.name, m.hartomat_code, m.description,
|
||||
COALESCE(
|
||||
(SELECT json_agg(ma.alias) FROM material_aliases ma WHERE ma.material_id = m.id),
|
||||
'[]'::json
|
||||
) AS aliases
|
||||
FROM materials m
|
||||
WHERE m.schaeffler_code IS NOT NULL
|
||||
WHERE m.hartomat_code IS NOT NULL
|
||||
"""
|
||||
params: dict = {}
|
||||
if query:
|
||||
@@ -698,7 +698,7 @@ async def _tool_list_materials(db: AsyncSession, tenant_id: str, query: str = ""
|
||||
aliases = r["aliases"] if isinstance(r["aliases"], list) else []
|
||||
materials.append({
|
||||
"name": r["name"],
|
||||
"schaeffler_code": r["schaeffler_code"],
|
||||
"hartomat_code": r["hartomat_code"],
|
||||
"description": r["description"],
|
||||
"aliases": aliases[:10], # cap to avoid token bloat
|
||||
})
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
"""
|
||||
Excel parser for Schaeffler CAD order lists.
|
||||
Excel parser for HartOMat CAD order lists.
|
||||
|
||||
Supports two formats:
|
||||
|
||||
@@ -294,7 +294,7 @@ def _parse_material_mapping(wb) -> list[dict]:
|
||||
|
||||
def parse_excel(file_path: str | Path) -> ParsedExcel:
|
||||
"""
|
||||
Parse a Schaeffler order list Excel file.
|
||||
Parse a HartOMat order list Excel file.
|
||||
|
||||
Returns a ParsedExcel with all data rows extracted.
|
||||
Header-driven: finds "Ebene1" in any column within first 5 rows,
|
||||
|
||||
@@ -25,9 +25,9 @@ def build_part_colors(
|
||||
"""
|
||||
Build {part_name: material_name} for Blender rendering.
|
||||
|
||||
Returns a mapping of part name → Schaeffler material name (e.g. SCHAEFFLER_010101_Steel-Bare).
|
||||
Returns a mapping of part name → HartOMat material name (e.g. HARTOMAT_010101_Steel-Bare).
|
||||
Parts with no material assignment are omitted; Blender will use the fallback material
|
||||
(SCHAEFFLER_059999_FailedMaterial) for unrecognised parts.
|
||||
(HARTOMAT_059999_FailedMaterial) for unrecognised parts.
|
||||
|
||||
Args:
|
||||
cad_parsed_objects: List of part names from cad_file.parsed_objects["objects"].
|
||||
|
||||
Reference in new issue
Block a user