Toan2004-ai commited on
Commit
782a1fe
·
1 Parent(s): 51d9cf8

add readme config

Browse files
Files changed (1) hide show
  1. engine.py +5 -4
engine.py CHANGED
@@ -177,7 +177,8 @@ def final_process_eme_technical_guided(input_text):
177
  for item in contract_incentives:
178
  if not isinstance(item, dict): continue
179
 
180
- desc = item.get("displayName", "")
 
181
  if "Points" in desc or "Qantas" in desc:
182
  points_match = re.search(r'(\d{1,3}(?:,\d{3})*)', desc)
183
  points = int(points_match.group(1).replace(',', '')) if points_match else None
@@ -197,7 +198,7 @@ def final_process_eme_technical_guided(input_text):
197
  final_incentives.append({
198
  "incentive_type": payer_type,
199
  "raw_category": raw_category,
200
- "display_name": desc,
201
  "points_value": points,
202
  "amount_aud": None,
203
  "value_display": None,
@@ -215,7 +216,7 @@ def final_process_eme_technical_guided(input_text):
215
  final_incentives.append({
216
  "incentive_type": payer_type,
217
  "raw_category": raw_category,
218
- "display_name": desc,
219
  "amount_aud": amount,
220
  "value_display": f"${amount}" if amount else None,
221
  "is_recurring": False if "Once Off" in desc else True,
@@ -233,7 +234,7 @@ def final_process_eme_technical_guided(input_text):
233
  final_incentives.append({
234
  "incentive_type": incentive_type,
235
  "raw_category": raw_category,
236
- "display_name": s_fit.get("displayName") or "Current FIT policy",
237
  "amount_aud": unit_price,
238
  "tax_inclusive": True,
239
  "value_display": f"${unit_price}/kWh",
 
177
  for item in contract_incentives:
178
  if not isinstance(item, dict): continue
179
 
180
+ display_name = item.get("displayName", "")
181
+ desc = item.get("description")
182
  if "Points" in desc or "Qantas" in desc:
183
  points_match = re.search(r'(\d{1,3}(?:,\d{3})*)', desc)
184
  points = int(points_match.group(1).replace(',', '')) if points_match else None
 
198
  final_incentives.append({
199
  "incentive_type": payer_type,
200
  "raw_category": raw_category,
201
+ "display_name": display_name,
202
  "points_value": points,
203
  "amount_aud": None,
204
  "value_display": None,
 
216
  final_incentives.append({
217
  "incentive_type": payer_type,
218
  "raw_category": raw_category,
219
+ "display_name": display_name,
220
  "amount_aud": amount,
221
  "value_display": f"${amount}" if amount else None,
222
  "is_recurring": False if "Once Off" in desc else True,
 
234
  final_incentives.append({
235
  "incentive_type": incentive_type,
236
  "raw_category": raw_category,
237
+ "display_name": display_name,
238
  "amount_aud": unit_price,
239
  "tax_inclusive": True,
240
  "value_display": f"${unit_price}/kWh",