Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -40,56 +40,46 @@ class AIShoppingAnalyzer:
|
|
| 40 |
|
| 41 |
def create_assistant(self) -> AssistantAgent:
|
| 42 |
"""Initialize the shopping assistant agent"""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 43 |
return AssistantAgent(
|
| 44 |
name="assistant_agent",
|
| 45 |
description="E-commerce shopping advisor and website analyzer",
|
| 46 |
-
system_message=
|
| 47 |
-
"You are an expert shopping assistant and e-commerce analyst. Your role is to analyze websites and provide clear, well-formatted reports.\n\n"
|
| 48 |
-
"Structure your analysis reports as follows:\n\n"
|
| 49 |
-
"π E-COMMERCE ANALYSIS REPORT\n"
|
| 50 |
-
"============================\n"
|
| 51 |
-
"Site: [website URL]\n"
|
| 52 |
-
"Date: [current date]\n\n"
|
| 53 |
-
"π FINDABILITY SCORE: [β
β
β
β
β]\n"
|
| 54 |
-
"-----------------------------\n"
|
| 55 |
-
"β’ Category Organization:\n"
|
| 56 |
-
" - Key findings about site structure\n"
|
| 57 |
-
" - Navigation paths\n"
|
| 58 |
-
" - Filter effectiveness\n\n"
|
| 59 |
-
"π INFORMATION QUALITY: [β
β
β
β
β]\n"
|
| 60 |
-
"------------------------------\n"
|
| 61 |
-
"β’ Product Details:\n"
|
| 62 |
-
" - Completeness of information\n"
|
| 63 |
-
" - Image quality\n"
|
| 64 |
-
" - Technical specifications\n"
|
| 65 |
-
"β’ Structured Data:\n"
|
| 66 |
-
" - Schema markup implementation\n"
|
| 67 |
-
" - Rich snippets presence\n\n"
|
| 68 |
-
"π NAVIGATION & SEARCH: [β
β
β
β
β]\n"
|
| 69 |
-
"------------------------------\n"
|
| 70 |
-
"β’ Search Functionality:\n"
|
| 71 |
-
" - Auto-complete features\n"
|
| 72 |
-
" - Filter options\n"
|
| 73 |
-
" - Results relevance\n"
|
| 74 |
-
"β’ User Experience:\n"
|
| 75 |
-
" - Menu structure\n"
|
| 76 |
-
" - Mobile responsiveness\n\n"
|
| 77 |
-
"π° PRICING TRANSPARENCY: [β
β
β
β
β]\n"
|
| 78 |
-
"------------------------------\n"
|
| 79 |
-
"β’ Price Display:\n"
|
| 80 |
-
" - Visibility\n"
|
| 81 |
-
" - Special offers\n"
|
| 82 |
-
" - Comparison features\n\n"
|
| 83 |
-
"π OVERALL ASSESSMENT\n"
|
| 84 |
-
"-------------------\n"
|
| 85 |
-
"[Summary paragraph with key strengths and areas for improvement]\n\n"
|
| 86 |
-
"π§ TECHNICAL INSIGHTS\n"
|
| 87 |
-
"-------------------\n"
|
| 88 |
-
"[Details about structured data, meta tags, and technical implementation]\n\n"
|
| 89 |
-
"Use star ratings (β
β
β
β
β) to indicate performance in each category.\n"
|
| 90 |
-
"Format text using markdown for better readability.\n"
|
| 91 |
-
"Keep analyses concise but comprehensive."
|
| 92 |
-
),
|
| 93 |
model_client=self.model_client
|
| 94 |
)
|
| 95 |
|
|
|
|
| 40 |
|
| 41 |
def create_assistant(self) -> AssistantAgent:
|
| 42 |
"""Initialize the shopping assistant agent"""
|
| 43 |
+
system_message = (
|
| 44 |
+
"You are an expert shopping assistant and e-commerce analyst. "
|
| 45 |
+
"Analyze websites and provide reports in this format:\n\n"
|
| 46 |
+
"π E-COMMERCE ANALYSIS REPORT\n"
|
| 47 |
+
"============================\n"
|
| 48 |
+
"Site: {url}\n"
|
| 49 |
+
"Date: {date}\n\n"
|
| 50 |
+
"π FINDABILITY SCORE: [β
β
β
β
β]\n"
|
| 51 |
+
"-----------------------------\n"
|
| 52 |
+
"β’ Category Organization\n"
|
| 53 |
+
"β’ Navigation Structure\n"
|
| 54 |
+
"β’ Filter Systems\n\n"
|
| 55 |
+
"π INFORMATION QUALITY: [β
β
β
β
β]\n"
|
| 56 |
+
"------------------------------\n"
|
| 57 |
+
"β’ Product Details\n"
|
| 58 |
+
"β’ Image Quality\n"
|
| 59 |
+
"β’ Technical Specs\n"
|
| 60 |
+
"β’ Structured Data\n\n"
|
| 61 |
+
"π NAVIGATION & SEARCH: [β
β
β
β
β]\n"
|
| 62 |
+
"------------------------------\n"
|
| 63 |
+
"β’ Search Features\n"
|
| 64 |
+
"β’ User Experience\n"
|
| 65 |
+
"β’ Mobile Design\n\n"
|
| 66 |
+
"π° PRICING TRANSPARENCY: [β
β
β
β
β]\n"
|
| 67 |
+
"------------------------------\n"
|
| 68 |
+
"β’ Price Display\n"
|
| 69 |
+
"β’ Special Offers\n"
|
| 70 |
+
"β’ Comparison Tools\n\n"
|
| 71 |
+
"π OVERALL ASSESSMENT\n"
|
| 72 |
+
"-------------------\n"
|
| 73 |
+
"[Summary]\n\n"
|
| 74 |
+
"π§ TECHNICAL INSIGHTS\n"
|
| 75 |
+
"-------------------\n"
|
| 76 |
+
"[Technical Details]\n"
|
| 77 |
+
)
|
| 78 |
+
|
| 79 |
return AssistantAgent(
|
| 80 |
name="assistant_agent",
|
| 81 |
description="E-commerce shopping advisor and website analyzer",
|
| 82 |
+
system_message=system_message,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 83 |
model_client=self.model_client
|
| 84 |
)
|
| 85 |
|