@realtimex/folio 0.1.12 → 0.1.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.env.example +1 -0
- package/api/src/routes/ingestions.ts +2 -5
- package/api/src/routes/settings.ts +2 -0
- package/api/src/services/IngestionService.ts +430 -181
- package/api/src/services/ModelCapabilityService.ts +32 -5
- package/api/src/services/supabase.ts +2 -0
- package/dist/api/src/routes/ingestions.js +2 -5
- package/dist/api/src/routes/settings.js +2 -0
- package/dist/api/src/services/IngestionService.js +384 -173
- package/dist/api/src/services/ModelCapabilityService.js +24 -5
- package/dist/assets/index-aI2VZJFA.js +113 -0
- package/dist/index.html +1 -1
- package/package.json +1 -1
- package/supabase/functions/api-v1-settings/index.ts +2 -0
- package/supabase/migrations/20260302000000_add_ingestion_llm_settings.sql +12 -0
- package/dist/assets/index-tVGLBfz6.js +0 -113
|
@@ -9,8 +9,12 @@ export class ModelCapabilityService {
|
|
|
9
9
|
static UNSUPPORTED_CONFIRMATION_FAILURES = 2;
|
|
10
10
|
static UNSUPPORTED_SCORE_THRESHOLD = 3;
|
|
11
11
|
static resolveVisionSupport(settingsRow, modality = "image") {
|
|
12
|
-
const provider = (settingsRow?.
|
|
13
|
-
|
|
12
|
+
const provider = (settingsRow?.ingestion_llm_provider ||
|
|
13
|
+
settingsRow?.llm_provider ||
|
|
14
|
+
SDKService.DEFAULT_LLM_PROVIDER).trim();
|
|
15
|
+
const model = (settingsRow?.ingestion_llm_model ||
|
|
16
|
+
settingsRow?.llm_model ||
|
|
17
|
+
SDKService.DEFAULT_LLM_MODEL).trim();
|
|
14
18
|
const state = this.getVisionState(settingsRow?.vision_model_capabilities, provider, model, modality);
|
|
15
19
|
return {
|
|
16
20
|
provider,
|
|
@@ -126,6 +130,16 @@ export class ModelCapabilityService {
|
|
|
126
130
|
}
|
|
127
131
|
const now = new Date();
|
|
128
132
|
const key = this.capabilityKey(provider, model, modality);
|
|
133
|
+
const existingEntry = map[key];
|
|
134
|
+
if (this.isManualOverrideActive(existingEntry) && reason !== "manual_override") {
|
|
135
|
+
logger.info(`Skipping auto capability update for ${provider}/${model} (${modality}) because manual override is active`, {
|
|
136
|
+
requestedState: state,
|
|
137
|
+
requestedReason: reason,
|
|
138
|
+
currentState: existingEntry?.state,
|
|
139
|
+
currentReason: existingEntry?.reason,
|
|
140
|
+
});
|
|
141
|
+
return;
|
|
142
|
+
}
|
|
129
143
|
const nextEntry = {
|
|
130
144
|
state,
|
|
131
145
|
learned_at: now.toISOString(),
|
|
@@ -212,6 +226,13 @@ export class ModelCapabilityService {
|
|
|
212
226
|
const expiryTs = Date.parse(entry.expires_at);
|
|
213
227
|
return Number.isFinite(expiryTs) && expiryTs <= Date.now();
|
|
214
228
|
}
|
|
229
|
+
static isManualOverrideActive(entry) {
|
|
230
|
+
if (!entry)
|
|
231
|
+
return false;
|
|
232
|
+
if (entry.reason !== "manual_override")
|
|
233
|
+
return false;
|
|
234
|
+
return !this.isExpired(entry);
|
|
235
|
+
}
|
|
215
236
|
static nextFailureCount(entry, nowTs) {
|
|
216
237
|
if (!entry || entry.state !== "pending_unsupported" || this.isExpired(entry)) {
|
|
217
238
|
return 1;
|
|
@@ -496,7 +517,7 @@ export class ModelCapabilityService {
|
|
|
496
517
|
}
|
|
497
518
|
const providerSpecificMatches = this.matchMessage(signal.message, this.providerCapabilityHints(provider, modality));
|
|
498
519
|
if (providerSpecificMatches.length > 0) {
|
|
499
|
-
score +=
|
|
520
|
+
score += 3;
|
|
500
521
|
evidence.push(...providerSpecificMatches.map((match) => `provider:${match}`));
|
|
501
522
|
}
|
|
502
523
|
const weakCapabilityHints = this.matchMessage(signal.message, modality === "pdf"
|
|
@@ -561,7 +582,6 @@ export class ModelCapabilityService {
|
|
|
561
582
|
if (normalized.includes("realtimex")) {
|
|
562
583
|
return [
|
|
563
584
|
"unsupported file input",
|
|
564
|
-
"invalid model",
|
|
565
585
|
];
|
|
566
586
|
}
|
|
567
587
|
return [];
|
|
@@ -586,7 +606,6 @@ export class ModelCapabilityService {
|
|
|
586
606
|
}
|
|
587
607
|
if (normalized.includes("realtimex")) {
|
|
588
608
|
return [
|
|
589
|
-
"invalid model",
|
|
590
609
|
"text-only model",
|
|
591
610
|
];
|
|
592
611
|
}
|