feat: Add registered users to NordaGPT chatbot context (Option C)
Some checks are pending
NordaBiz Tests / Unit & Integration Tests (push) Waiting to run
NordaBiz Tests / E2E Tests (Playwright) (push) Blocked by required conditions
NordaBiz Tests / Smoke Tests (Production) (push) Blocked by required conditions
NordaBiz Tests / Send Failure Notification (push) Blocked by required conditions
Some checks are pending
NordaBiz Tests / Unit & Integration Tests (push) Waiting to run
NordaBiz Tests / E2E Tests (Playwright) (push) Blocked by required conditions
NordaBiz Tests / Smoke Tests (Production) (push) Blocked by required conditions
NordaBiz Tests / Send Failure Notification (push) Blocked by required conditions
Extends chatbot to include verified portal users alongside KRS/CEIDG data, so NordaGPT can answer questions about company representatives who registered on the portal but aren't listed in official registries. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
fbbbf6803c
commit
400d01c912
@ -565,6 +565,28 @@ class NordaBizChatEngine:
|
||||
|
||||
context['company_people'] = people_by_company
|
||||
|
||||
# Add registered portal users grouped by company (Option C)
|
||||
registered_users = db.query(User).filter(
|
||||
User.is_active == True,
|
||||
User.is_verified == True,
|
||||
User.company_id.isnot(None)
|
||||
).options(joinedload(User.company)).all()
|
||||
|
||||
users_by_company = {}
|
||||
for u in registered_users:
|
||||
company_name = u.company.name if u.company else 'Nieznana'
|
||||
company_profile = f"https://nordabiznes.pl/company/{u.company.slug}" if u.company and u.company.slug else None
|
||||
if company_name not in users_by_company:
|
||||
users_by_company[company_name] = {'profile': company_profile, 'users': []}
|
||||
users_by_company[company_name]['users'].append({
|
||||
'name': u.name,
|
||||
'email': u.email,
|
||||
'role': u.company_role if u.company_role != 'NONE' else '',
|
||||
'member': u.is_norda_member
|
||||
})
|
||||
|
||||
context['registered_users'] = users_by_company
|
||||
|
||||
# Add social media summary per company (platforms and followers)
|
||||
social_media = db.query(CompanySocialMedia).filter(
|
||||
CompanySocialMedia.is_valid == True
|
||||
@ -1075,8 +1097,9 @@ Inne linki które MUSISZ dołączać gdy dostępne:
|
||||
• B2B: [tytuł ogłoszenia](/ogloszenia/ID)
|
||||
• AKTUALNOŚCI: [tytuł](/news/ID)
|
||||
|
||||
- Jeśli pytanie o osobę (np. "kto to Roszman") - szukaj w ZARZĄD I WSPÓLNICY lub w polu "history"
|
||||
- Jeśli pytanie o osobę (np. "kto to Roszman") - szukaj w ZARZĄD I WSPÓLNICY, ZAREJESTROWANI PRZEDSTAWICIELE FIRM lub w polu "history"
|
||||
- Jeśli pytanie "kto jest prezesem firmy X" - szukaj w ZARZĄD I WSPÓLNICY
|
||||
- Jeśli pytanie "kto pracuje w firmie X" lub "kto reprezentuje firmę X" - szukaj w ZARZĄD I WSPÓLNICY i ZAREJESTROWANI PRZEDSTAWICIELE FIRM
|
||||
- Jeśli pytanie "kto poleca firmę X" - szukaj w rekomendacjach
|
||||
- Jeśli pytanie "co słychać" - sprawdź aktualności i wydarzenia
|
||||
- Jeśli pytanie "kiedy następne spotkanie" - sprawdź kalendarz
|
||||
@ -1295,6 +1318,12 @@ W dyskusji [Artur Wiertel](link) pytał o moderację. Pełna treść: [moje uwag
|
||||
system_prompt += json.dumps(context['company_people'], ensure_ascii=False, indent=None)
|
||||
system_prompt += "\n"
|
||||
|
||||
# Add registered portal users (Option C)
|
||||
if context.get('registered_users'):
|
||||
system_prompt += "\n\n👤 ZAREJESTROWANI PRZEDSTAWICIELE FIRM:\n"
|
||||
system_prompt += json.dumps(context['registered_users'], ensure_ascii=False, indent=None)
|
||||
system_prompt += "\n"
|
||||
|
||||
# Add social media per company (Etap 3)
|
||||
if context.get('company_social_media'):
|
||||
system_prompt += "\n\n📱 SOCIAL MEDIA:\n"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user