fix(zopk): Use GeminiService instead of raw genai for AI roadmap analysis
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
The analyze_roadmap_with_ai() was using google.generativeai directly which bypasses API key configuration. Switch to GeminiService which has the key pre-configured via init_gemini_service(). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
99dd628d4a
commit
3fb1a23546
@ -2726,7 +2726,7 @@ def analyze_roadmap_with_ai(db_session) -> Dict:
|
||||
'gaps': [...]
|
||||
}
|
||||
"""
|
||||
import google.generativeai as genai
|
||||
from gemini_service import GeminiService
|
||||
import json
|
||||
from database import ZOPKMilestone
|
||||
|
||||
@ -2795,10 +2795,17 @@ Zasady:
|
||||
- Jeśli nie ma sugestii w danej kategorii, zwróć pustą listę
|
||||
- Tytuły pisz po polsku"""
|
||||
|
||||
model = genai.GenerativeModel("gemini-3-flash-preview")
|
||||
response = model.generate_content(prompt)
|
||||
gemini = GeminiService()
|
||||
response_text = gemini.generate_text(
|
||||
prompt=prompt,
|
||||
temperature=0.2,
|
||||
feature='zopk_roadmap_analysis'
|
||||
)
|
||||
|
||||
response_text = response.text.strip()
|
||||
if not response_text:
|
||||
return {'success': False, 'error': 'Brak odpowiedzi od AI'}
|
||||
|
||||
response_text = response_text.strip()
|
||||
# Strip markdown code blocks if present
|
||||
if response_text.startswith('```'):
|
||||
response_text = response_text.split('```')[1]
|
||||
|
||||
Loading…
Reference in New Issue
Block a user