Pre-Final Backup
This commit is contained in:
@@ -65,17 +65,19 @@ The AI subsystem is centered on:
|
||||
|
||||
- Primary model: gemini-2.5-flash
|
||||
- Optional secondary Gemini model: AI_MODEL_SECONDARY_GEMINI
|
||||
- Fallback model provider: Groq (default: llama-3.3-70b-versatile)
|
||||
- Gemini models are de-duplicated and iterated in order before Groq fallback
|
||||
- Groq extraction fallback currently applies to image inputs in this pipeline; JSON repair and Q&A fallback are text-based
|
||||
- Fallback model provider: Mistral AI (default: mistral-large-latest, vision: pixtral-large-latest)
|
||||
- Gemini models are de-duplicated and iterated in order before Mistral fallback
|
||||
- Mistral extraction fallback supports both text and image inputs via Pixtral vision; JSON repair and Q&A fallback are text-based
|
||||
|
||||
### 2.3 Environment Variables
|
||||
|
||||
- AI_API_KEY (or AI_API_KEY2 / AI_API_KEY3 fallback)
|
||||
- AI_MODEL_PRIMARY (optional override)
|
||||
- AI_MODEL_SECONDARY_GEMINI (optional override)
|
||||
- AI_MODEL_SECONDARY (legacy alias supported for compatibility)
|
||||
- AI_MODEL_FALLBACK (optional override)
|
||||
- GROQ_API_KEY (or AI_GROQ_API_KEY)
|
||||
- MISTRAL_API_KEY
|
||||
- AI_MODEL_MISTRAL_VISION (optional, default: pixtral-large-latest)
|
||||
|
||||
## 3. AI Capability Matrix
|
||||
|
||||
@@ -206,7 +208,7 @@ sequenceDiagram
|
||||
participant AIS as AIService
|
||||
participant GP as Gemini Primary
|
||||
participant GS as Gemini Secondary (optional)
|
||||
participant GR as Groq Fallback
|
||||
participant MR as Mistral AI Fallback
|
||||
|
||||
AIS->>GP: generate analysis (strict JSON)
|
||||
alt GP success with usable output
|
||||
@@ -220,17 +222,17 @@ sequenceDiagram
|
||||
alt lenient success
|
||||
GP-->>AIS: raw text
|
||||
else lenient fails
|
||||
AIS->>GR: generate analysis (strict JSON)
|
||||
GR-->>AIS: text
|
||||
AIS->>MR: generate analysis (strict JSON)
|
||||
MR-->>AIS: text
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
AIS->>AIS: parseJsonResponse
|
||||
alt parse failed
|
||||
AIS->>GR: repairMalformedJson(originalText, parseError)
|
||||
AIS->>MR: repairMalformedJson(originalText, parseError)
|
||||
alt repair success
|
||||
GR-->>AIS: repaired JSON text
|
||||
MR-->>AIS: repaired JSON text
|
||||
AIS->>AIS: parse repaired JSON
|
||||
else repair failed
|
||||
AIS->>AIS: emergencyExtractFields(rawText)
|
||||
|
||||
Reference in New Issue
Block a user