rairo commited on
Commit
2713cdf
·
verified ·
1 Parent(s): 81121a5

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +8 -3
main.py CHANGED
@@ -98,9 +98,14 @@ class ShoppingAssistant:
98
  def _process_text(self, text: str, mobile: str) -> dict:
99
  """Process text input using Gemini"""
100
  response = text_model.generate_content(
101
- f"""Analyze this shopping request: {text}
102
- Identify products needed, quantities, and special requirements.
103
- Respond with JSON format: {{products: [{{name: '', quantity: 1}}]}}"""
 
 
 
 
 
104
  )
105
  analysis = json.loads(response.text)
106
  return self._match_products(analysis.get('products', []), mobile)
 
98
  def _process_text(self, text: str, mobile: str) -> dict:
99
  """Process text input using Gemini"""
100
  response = text_model.generate_content(
101
+ f"""As a retail shopping assistant, analyze this request and extract shopping context,
102
+ specific products needed, pick only one item per product extracted
103
+ unless the user specifies the amount or number of items for a particular product.
104
+ If the user specifies budget make sure your suggest is within that budget.
105
+
106
+ If a user suggest a scenario planning a dinner, planning a party, I want to clean my car etc, be analytic and creative
107
+ and suggest appropriate product
108
+ Request: {text}"""
109
  )
110
  analysis = json.loads(response.text)
111
  return self._match_products(analysis.get('products', []), mobile)