IA : Claude substitut Qwen + auth rate limit prototype

- qualify_ai_service : ai_frame_async() avec Claude Haiku
  · round 1 → questions contextualisées si ANTHROPIC_API_KEY définie
  · round 2 → explication enrichie par Claude
  · fallback transparent sur ai_frame() si pas de clé (tests inchangés)
- config : ANTHROPIC_API_KEY + ANTHROPIC_MODEL (claude-haiku-4-5-20251001)
- requirements : anthropic>=0.97.0
- main : auth rate limit = RATE_LIMIT_DEFAULT partout (prototype mode)
  → supporte accès démo/test sans lockout en prod comme en dev

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Yvv
2026-04-23 23:55:10 +02:00
parent 9a8f10efdf
commit 9b6322c546
5 changed files with 154 additions and 24 deletions

View File

@@ -25,7 +25,7 @@ from app.services.qualify_ai_service import (
AIMessage,
AIQuestion,
AIQualifyResult,
ai_frame,
ai_frame_async,
)
router = APIRouter()
@@ -127,7 +127,7 @@ async def ai_chat(payload: AIChatRequest) -> AIChatResponse:
context=payload.context,
messages=[AIMessage(role=m.role, content=m.content) for m in payload.messages],
)
resp = ai_frame(req)
resp = await ai_frame_async(req)
return AIChatResponse(
done=resp.done,