Skip to content

AI Hub pricing contract (Flutter ↔ Hermes ↔ suggest-price) ​

Mobile AI Center sends structured payloads only β€” never free-text location, type, or condition.

Quick Estimate routing ​

  1. Primary: POST ${HERMES_URL}/chat with use_case: suggest_price and context (see below).
  2. Fallback: Supabase edge fn suggest-price with the same semantic payload when Hermes returns 5xx/network or non-JSON output.

Context shapes ​

CRM property (default) ​

json
{ "property_id": "<uuid>" }

Server loads properties row and joins comparable_sales, real_estate_transactions, market_parameters.

Structured fallback (property not in CRM) ​

English machine keys only:

json
{
  "governorate": "hawalli",
  "area_key": "salmiya",
  "al_wada": "built",
  "property_category": "residential_private",
  "al_hala": "good",
  "size_sqm": 400,
  "block": "5"
}

Edge-fn fallback additionally maps area_key β†’ Arabic area label and property_category β†’ Arabic property_type for comparable filters.

Content tab ​

POST ${HERMES_URL}/chat with:

json
{
  "use_case": "property_desc",
  "context": {
    "property_id": "<uuid>",
    "content_type": "property_description | market_report | valuation_summary",
    "locale": "ar | en",
    "instruction": "..."
  }
}

Circuit-breaker falls back to ai-assistant edge fn (same use_case + context).

Response (pricing) ​

JSON matching SuggestPriceEstimate in lib/data/models/suggest_price.dart:

  • estimated_price_per_sqm, min_price_per_sqm, max_price_per_sqm
  • total_estimated_value, confidence, reasoning, market_trend
  • comparable_count, data_sources, ai_powered

Server work (aldilaijanre) ​

Ensure suggest-price and Hermes suggest_price accept property_id and structured canonical maps; fetch comparables server-side. See HERMES_AI_GATEWAY.md.

Aldilaijan & Khobara Real Estate Platform