cyberandy commited on
Commit
a0f291e
·
verified ·
1 Parent(s): 43ac1f6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +47 -42
app.py CHANGED
@@ -39,7 +39,7 @@ class AIShoppingAnalyzer:
39
  description=description,
40
  model_client=self.model_client,
41
  headless=True,
42
- browser_kwargs={
43
  "args": [
44
  "--disable-dev-shm-usage",
45
  "--no-sandbox",
@@ -311,48 +311,53 @@ def create_gradio_interface() -> gr.Blocks:
311
  </div>
312
  """)
313
 
314
- with gr.Group():
315
- api_key = gr.Textbox(
316
- label="OpenAI API Key",
317
- placeholder="sk-...",
318
- type="password",
319
- container=True
320
- )
321
-
322
- website_url = gr.Textbox(
323
- label="Website URL",
324
- placeholder="https://your-store.com",
325
- container=True
326
- )
327
-
328
- product_category = gr.Textbox(
329
- label="Product Category",
330
- placeholder="e.g., Electronics, Clothing, etc.",
331
- container=True
332
- )
333
-
334
- specific_product = gr.Textbox(
335
- label="Specific Product (Optional)",
336
- placeholder="e.g., Blue Widget Model X",
337
- container=True
338
- )
 
 
 
 
 
 
 
 
339
 
340
- analyze_button = gr.Button(
341
- "Analyze Site",
342
- variant="primary"
343
- )
344
-
345
- analysis_output = gr.Markdown(
346
- label="Analysis Results",
347
- value="Results will appear here...",
348
- elem_classes="analysis-output"
349
- )
350
-
351
- analyze_button.click(
352
- fn=run_analysis,
353
- inputs=[api_key, website_url, product_category, specific_product],
354
- outputs=analysis_output
355
- )
356
 
357
  return demo
358
 
 
39
  description=description,
40
  model_client=self.model_client,
41
  headless=True,
42
+ playwright_launch_kwargs={
43
  "args": [
44
  "--disable-dev-shm-usage",
45
  "--no-sandbox",
 
311
  </div>
312
  """)
313
 
314
+ with gr.Row():
315
+ # Left column for inputs
316
+ with gr.Column(scale=1):
317
+ api_key = gr.Textbox(
318
+ label="OpenAI API Key",
319
+ placeholder="sk-...",
320
+ type="password",
321
+ container=True
322
+ )
323
+
324
+ website_url = gr.Textbox(
325
+ label="Website URL",
326
+ placeholder="https://your-store.com",
327
+ container=True
328
+ )
329
+
330
+ product_category = gr.Textbox(
331
+ label="Product Category",
332
+ placeholder="e.g., Electronics, Clothing, etc.",
333
+ container=True
334
+ )
335
+
336
+ specific_product = gr.Textbox(
337
+ label="Specific Product (Optional)",
338
+ placeholder="e.g., Blue Widget Model X",
339
+ container=True
340
+ )
341
+
342
+ analyze_button = gr.Button(
343
+ "Analyze Site",
344
+ size="lg",
345
+ variant="primary"
346
+ )
347
 
348
+ # Right column for output
349
+ with gr.Column(scale=1):
350
+ analysis_output = gr.Markdown(
351
+ value="Results will appear here...",
352
+ label="Analysis Results",
353
+ elem_classes="analysis-output"
354
+ )
355
+
356
+ analyze_button.click(
357
+ fn=run_analysis,
358
+ inputs=[api_key, website_url, product_category, specific_product],
359
+ outputs=analysis_output
360
+ )
 
 
 
361
 
362
  return demo
363