Add vector IO and text filtering
This commit is contained in:
@@ -15,6 +15,11 @@ export function getSettings() {
|
||||
return ext;
|
||||
}
|
||||
|
||||
const DEFAULT_FILTER_RULES = [
|
||||
{ start: '<think>', end: '</think>' },
|
||||
{ start: '<thinking>', end: '</thinking>' },
|
||||
];
|
||||
|
||||
export function getSummaryPanelConfig() {
|
||||
const defaults = {
|
||||
api: { provider: 'st', url: '', key: '', model: '', modelCache: [] },
|
||||
@@ -29,6 +34,7 @@ export function getSummaryPanelConfig() {
|
||||
wrapperTail: '',
|
||||
forceInsertAtEnd: false,
|
||||
},
|
||||
vector: null,
|
||||
};
|
||||
try {
|
||||
const raw = localStorage.getItem('summary_panel_config');
|
||||
@@ -64,12 +70,21 @@ export function getVectorConfig() {
|
||||
const raw = localStorage.getItem('summary_panel_config');
|
||||
if (!raw) return null;
|
||||
const parsed = JSON.parse(raw);
|
||||
return parsed.vector || null;
|
||||
const cfg = parsed.vector || null;
|
||||
if (cfg && !cfg.textFilterRules) {
|
||||
cfg.textFilterRules = [...DEFAULT_FILTER_RULES];
|
||||
}
|
||||
return cfg;
|
||||
} catch {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
export function getTextFilterRules() {
|
||||
const cfg = getVectorConfig();
|
||||
return cfg?.textFilterRules || DEFAULT_FILTER_RULES;
|
||||
}
|
||||
|
||||
export function saveVectorConfig(vectorCfg) {
|
||||
try {
|
||||
const raw = localStorage.getItem('summary_panel_config') || '{}';
|
||||
|
||||
Reference in New Issue
Block a user