feat: Enhanced website extraction - no limits, more categories
- Removed limits on services (was 10) and keywords (was 8) - Added new extraction categories: - products: physical/digital products - brands: partners, certifications (VMware, Veeam, etc.) - specializations: specific competencies - target_customers: customer types (SMB, enterprise, etc.) - regions: geographic coverage - Merged all data into services_extracted and main_keywords - Increased content limit to 20000 chars for AI Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
83a33f49ff
commit
9b8d68348e
@ -190,26 +190,40 @@ class WebsiteContentUpdater:
|
||||
if not self.gemini_service:
|
||||
return {'services': [], 'keywords': [], 'summary': None, 'error': 'Gemini not available'}
|
||||
|
||||
prompt = f"""Przeanalizuj treść strony internetowej firmy "{company_name}" i wyodrębnij informacje.
|
||||
prompt = f"""Przeanalizuj DOKŁADNIE treść strony internetowej firmy "{company_name}" i wyodrębnij WSZYSTKIE informacje.
|
||||
|
||||
TREŚĆ STRONY:
|
||||
{website_text[:15000]}
|
||||
{website_text[:20000]}
|
||||
|
||||
ZADANIE:
|
||||
Zwróć odpowiedź w formacie JSON (tylko JSON, bez markdown):
|
||||
{{
|
||||
"services": ["usługa 1", "usługa 2", ...],
|
||||
"products": ["produkt 1", "produkt 2", ...],
|
||||
"keywords": ["słowo kluczowe 1", "słowo kluczowe 2", ...],
|
||||
"summary": "Krótkie podsumowanie działalności firmy (max 200 znaków)"
|
||||
"brands": ["marka/partner 1", "marka/partner 2", ...],
|
||||
"specializations": ["specjalizacja 1", "specjalizacja 2", ...],
|
||||
"target_customers": ["klient docelowy 1", "klient docelowy 2", ...],
|
||||
"regions": ["region 1", "region 2", ...],
|
||||
"summary": "Szczegółowe podsumowanie działalności firmy (2-3 zdania)"
|
||||
}}
|
||||
|
||||
ZASADY:
|
||||
1. services: Lista konkretnych usług/produktów oferowanych przez firmę (max 10 pozycji)
|
||||
2. keywords: Słowa kluczowe opisujące branżę i specjalizację (max 8 pozycji)
|
||||
3. summary: Jedno zdanie opisujące czym zajmuje się firma
|
||||
4. Używaj języka polskiego
|
||||
5. Nie wymyślaj - bazuj tylko na treści strony
|
||||
6. Jeśli nie możesz wyodrębnić informacji, zwróć puste listy
|
||||
ZASADY - WYODRĘBNIJ WSZYSTKO, BEZ LIMITÓW:
|
||||
1. services: WSZYSTKIE usługi oferowane przez firmę (bez limitu ilości)
|
||||
2. products: WSZYSTKIE produkty/rozwiązania (fizyczne lub cyfrowe)
|
||||
3. keywords: WSZYSTKIE słowa kluczowe opisujące branżę, technologie, specjalizację
|
||||
4. brands: Partnerzy, certyfikaty, marki z którymi firma współpracuje (np. VMware, Microsoft, Veeam)
|
||||
5. specializations: Konkretne specjalizacje i kompetencje (np. "backup danych", "monitoring 24/7")
|
||||
6. target_customers: Typy klientów (np. "MŚP", "korporacje", "sektor publiczny")
|
||||
7. regions: Obszar działania geograficzny (miasta, regiony)
|
||||
8. summary: Pełne podsumowanie czym zajmuje się firma
|
||||
|
||||
WAŻNE:
|
||||
- Wyodrębnij WSZYSTKIE informacje bez ograniczeń ilościowych
|
||||
- Używaj języka polskiego
|
||||
- Bazuj TYLKO na treści strony - nie wymyślaj
|
||||
- Każda kategoria może mieć 0-50 elementów
|
||||
- Im więcej szczegółów, tym lepiej
|
||||
|
||||
ODPOWIEDŹ (tylko JSON):"""
|
||||
|
||||
@ -232,10 +246,34 @@ ODPOWIEDŹ (tylko JSON):"""
|
||||
|
||||
data = json.loads(json_text)
|
||||
|
||||
# Combine all extracted data into comprehensive lists (no limits)
|
||||
all_services = data.get('services', [])
|
||||
all_products = data.get('products', [])
|
||||
all_keywords = data.get('keywords', [])
|
||||
all_brands = data.get('brands', [])
|
||||
all_specializations = data.get('specializations', [])
|
||||
all_target_customers = data.get('target_customers', [])
|
||||
all_regions = data.get('regions', [])
|
||||
|
||||
# Merge services + products + specializations into services_extracted
|
||||
merged_services = list(dict.fromkeys(all_services + all_products + all_specializations))
|
||||
|
||||
# Merge keywords + brands + target_customers + regions into main_keywords
|
||||
merged_keywords = list(dict.fromkeys(all_keywords + all_brands + all_target_customers + all_regions))
|
||||
|
||||
return {
|
||||
'services': data.get('services', [])[:10],
|
||||
'keywords': data.get('keywords', [])[:8],
|
||||
'summary': data.get('summary', '')[:500] if data.get('summary') else None,
|
||||
'services': merged_services, # No limit
|
||||
'keywords': merged_keywords, # No limit
|
||||
'summary': data.get('summary', '')[:1000] if data.get('summary') else None,
|
||||
'raw_data': {
|
||||
'services': all_services,
|
||||
'products': all_products,
|
||||
'keywords': all_keywords,
|
||||
'brands': all_brands,
|
||||
'specializations': all_specializations,
|
||||
'target_customers': all_target_customers,
|
||||
'regions': all_regions,
|
||||
},
|
||||
'error': None
|
||||
}
|
||||
|
||||
@ -288,12 +326,23 @@ ODPOWIEDŹ (tylko JSON):"""
|
||||
services = extracted.get('services', [])
|
||||
keywords = extracted.get('keywords', [])
|
||||
summary = extracted.get('summary')
|
||||
raw_data = extracted.get('raw_data', {})
|
||||
|
||||
logger.info(f"[{company.id}] {company.name}: Wyodrębniono {len(services)} usług, {len(keywords)} słów kluczowych")
|
||||
logger.info(f"[{company.id}] {company.name}: Wyodrębniono {len(services)} usług/produktów, {len(keywords)} słów kluczowych")
|
||||
|
||||
if raw_data:
|
||||
logger.debug(f" - Usługi: {len(raw_data.get('services', []))}")
|
||||
logger.debug(f" - Produkty: {len(raw_data.get('products', []))}")
|
||||
logger.debug(f" - Specjalizacje: {len(raw_data.get('specializations', []))}")
|
||||
logger.debug(f" - Marki/Partnerzy: {len(raw_data.get('brands', []))}")
|
||||
logger.debug(f" - Klienci docelowi: {len(raw_data.get('target_customers', []))}")
|
||||
logger.debug(f" - Regiony: {len(raw_data.get('regions', []))}")
|
||||
|
||||
if self.dry_run:
|
||||
logger.info(f"[DRY-RUN] Usługi: {services}")
|
||||
logger.info(f"[DRY-RUN] Słowa kluczowe: {keywords}")
|
||||
logger.info(f"[DRY-RUN] Usługi/Produkty ({len(services)}): {services}")
|
||||
logger.info(f"[DRY-RUN] Słowa kluczowe ({len(keywords)}): {keywords}")
|
||||
if summary:
|
||||
logger.info(f"[DRY-RUN] Podsumowanie: {summary}")
|
||||
self.stats['updated'] += 1
|
||||
return True
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user