Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -17,6 +17,8 @@ nest_asyncio.apply()
|
|
17 |
class AIShoppingAnalyzer:
|
18 |
def __init__(self, api_key: str):
|
19 |
self.api_key = api_key
|
|
|
|
|
20 |
self.model_client = OpenAIChatCompletionClient(model="gpt-4o")
|
21 |
self.termination = MaxMessageTermination(max_messages=20) | TextMentionTermination("TERMINATE")
|
22 |
|
@@ -28,7 +30,10 @@ class AIShoppingAnalyzer:
|
|
28 |
1. Searches multiple retailers for product options
|
29 |
2. Compares prices and reviews
|
30 |
3. Checks product specifications and availability
|
31 |
-
4. Analyzes website structure and findability
|
|
|
|
|
|
|
32 |
model_client=self.model_client,
|
33 |
headless=True
|
34 |
)
|
@@ -44,6 +49,16 @@ class AIShoppingAnalyzer:
|
|
44 |
3. Analyze website usability and product findability
|
45 |
4. Evaluate product presentation and information quality
|
46 |
5. Assess the overall e-commerce experience
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
47 |
|
48 |
When working with the websurfer_agent:
|
49 |
- Guide their research effectively
|
|
|
17 |
class AIShoppingAnalyzer:
|
18 |
def __init__(self, api_key: str):
|
19 |
self.api_key = api_key
|
20 |
+
# Set the API key in environment
|
21 |
+
os.environ["OPENAI_API_KEY"] = api_key
|
22 |
self.model_client = OpenAIChatCompletionClient(model="gpt-4o")
|
23 |
self.termination = MaxMessageTermination(max_messages=20) | TextMentionTermination("TERMINATE")
|
24 |
|
|
|
30 |
1. Searches multiple retailers for product options
|
31 |
2. Compares prices and reviews
|
32 |
3. Checks product specifications and availability
|
33 |
+
4. Analyzes website structure and findability
|
34 |
+
5. Detects and analyzes structured data (Schema.org, JSON-LD, Microdata)
|
35 |
+
6. Evaluates product markup and rich snippets
|
36 |
+
7. Checks for proper semantic HTML and data organization""",
|
37 |
model_client=self.model_client,
|
38 |
headless=True
|
39 |
)
|
|
|
49 |
3. Analyze website usability and product findability
|
50 |
4. Evaluate product presentation and information quality
|
51 |
5. Assess the overall e-commerce experience
|
52 |
+
6. Analyze structured data implementation:
|
53 |
+
- Check for Schema.org markup
|
54 |
+
- Validate JSON-LD implementation
|
55 |
+
- Evaluate microdata usage
|
56 |
+
- Assess rich snippet potential
|
57 |
+
7. Report on data structure quality:
|
58 |
+
- Product markup completeness
|
59 |
+
- Price and availability markup
|
60 |
+
- Review and rating markup
|
61 |
+
- Inventory status markup
|
62 |
|
63 |
When working with the websurfer_agent:
|
64 |
- Guide their research effectively
|