mroccuper commited on
Commit
6171624
·
verified ·
1 Parent(s): 1c4e7c2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -3
app.py CHANGED
@@ -56,7 +56,9 @@ Respond ONLY with a JSON object in this format:
56
  "suggested_keywords": "5 additional keywords separated by commas"
57
  }}
58
 
59
- REMINDER: Make sure to count the characters carefully. Title should be EXACTLY 60 characters. Bullet point 1 must be between 240-256 characters and Bullet point 2 must be between 240-256 characters."""
 
 
60
 
61
  return combined_prompt
62
 
@@ -145,8 +147,9 @@ def generate_amazon_listing(api_key, quote, niche, target, keywords):
145
  return f"Error: Generated title doesn't match the requested theme: '{quote}', '{niche}', or '{target}'. Please try again."
146
 
147
  # Validate bullet point lengths
148
- bullet1 = result.get("bullet_point_1", "")
149
- bullet2 = result.get("bullet_point_2", "")
 
150
 
151
  #if len(bullet1) < 240 or len(bullet1) > 256:
152
  #return f"Error: Bullet point 1 length ({len(bullet1)}) is not between 240-256 characters. Please try again."
 
56
  "suggested_keywords": "5 additional keywords separated by commas"
57
  }}
58
 
59
+ REMINDER: Make sure to count the characters carefully. Title should be EXACTLY 60 characters. Bullet point 1 must be between 240-256 characters and Bullet point 2 must be between 240-256 characters.
60
+ STRICT ENFORCEMENT: Bullet point 1 and 2 MUST be between 240 and 256 characters. Could be less, not more. If it's 257+, the result is invalid. Carefully count and ensure compliance.
61
+ """
62
 
63
  return combined_prompt
64
 
 
147
  return f"Error: Generated title doesn't match the requested theme: '{quote}', '{niche}', or '{target}'. Please try again."
148
 
149
  # Validate bullet point lengths
150
+ bullet1 = result.get("bullet_point_1", "")[:256]
151
+ bullet2 = result.get("bullet_point_2", "")[:256]
152
+
153
 
154
  #if len(bullet1) < 240 or len(bullet1) > 256:
155
  #return f"Error: Bullet point 1 length ({len(bullet1)}) is not between 240-256 characters. Please try again."