Skip to content

Commit ed8c1ec

Browse files
committed
Poprawka zapisu ustawien modeli
1 parent 93457b6 commit ed8c1ec

File tree

4 files changed

+25
-15
lines changed

4 files changed

+25
-15
lines changed

requirements.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,9 @@ python-dotenv==1.0.1
2828
# Google Assistant / OAuth
2929
google-auth==2.35.0
3030
google-auth-oauthlib==1.2.1
31-
google-assistant-grpc==0.2.1
31+
google-assistant-grpc==0.3.0
3232
grpcio==1.66.1
33+
protobuf==3.20.3
3334

3435
# AI/ML Models
3536
openai-whisper==20240930
@@ -39,7 +40,7 @@ numpy==1.26.4
3940
torch==2.5.1
4041
piper-tts==1.2.0
4142
ollama==0.4.4
42-
mediapipe==0.10.18
43+
mediapipe==0.10.7
4344

4445
# RAG (Knowledge Base)
4546
chromadb==0.5.23

web/assets/i18n.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ export const I18N = {
175175
},
176176

177177
mcp: {
178-
title: { pl: "MCP Tools", en: "MCP Tools" },
178+
title: { pl: "Narzędzia MCP", en: "MCP Tools" },
179179
total_tools: { pl: "Narzędzia", en: "Tools" },
180180
invocations: { pl: "Wywołania", en: "Invocations" },
181181
last_tool: { pl: "Ostatnie", en: "Last" },

web/assets/pages/view.css

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -120,20 +120,20 @@
120120
}
121121

122122
.page-view .mcp-tool-item {
123-
display: flex;
124-
align-items: center;
125-
padding: var(--space-xxs) 0;
126-
border-bottom: 1px solid var(--color-border-subtle);
123+
display: block;
124+
padding: 0;
125+
border-bottom: none;
127126
}
128127

129128
.page-view .mcp-tool-item:last-child {
130129
border-bottom: none;
131130
}
132131

133132
.page-view .mcp-tool-name {
134-
font-weight: var(--font-weight-semibold);
133+
font-weight: var(--font-weight-normal);
135134
font-size: var(--font-size-sm);
136-
color: var(--color-accent);
135+
line-height: var(--line-height-normal);
136+
color: var(--color-fg-primary);
137137
}
138138

139139
.page-view .mcp-call-item {

web/models.html

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ <h3 class="engine-title u-mb-0">🤖 Silnik Rider-Pi (Health)</h3>
228228
chatgpt: ['gpt-4o-mini', 'gpt-4o', 'o1-mini']
229229
},
230230
// Obecnie aktywna konfiguracja (z /api/models/active)
231-
activeConfig: { text: {}, vision: {}, voice: {} },
231+
activeConfig: { text: {}, vision: {}, voice_asr: {}, voice_tts: {} },
232232
textProviderStatus: null
233233
},
234234
pi: {
@@ -262,6 +262,9 @@ <h3 class="engine-title u-mb-0">🤖 Silnik Rider-Pi (Health)</h3>
262262

263263
const LOCAL_PROVIDERS = new Set(['local', 'ollama', 'whisper', 'piper', 'yolo']);
264264
const CLOUD_PROVIDERS = new Set(['gemini', 'chatgpt', 'openai', 'auto']);
265+
const DOMAIN_SLOT_MAP = {
266+
voice: 'voice_asr'
267+
};
265268

266269

267270
// --- 2. INICJALIZACJA ---
@@ -476,6 +479,7 @@ <h3 class="engine-title u-mb-0">🤖 Silnik Rider-Pi (Health)</h3>
476479
const card = btn.closest('.pipeline-card');
477480
const domain = card.dataset.domain; // text, vision, voice
478481
const device = card.dataset.device; // pc, pi
482+
const slot = resolveSlot(domain);
479483

480484
const source = card.querySelector('.source-select').value;
481485
const model = card.querySelector('.model-select').value;
@@ -498,10 +502,10 @@ <h3 class="engine-title u-mb-0">🤖 Silnik Rider-Pi (Health)</h3>
498502
provider = 'gemini';
499503
} else if (model.includes('gpt') || model.includes('o1')) {
500504
provider = 'chatgpt';
501-
} else if (domain === 'voice') {
505+
} else if (slot === 'voice_asr') {
502506
provider = 'openai';
503507
}
504-
} else if (source === 'local' && domain === 'text') {
508+
} else if (source === 'local' && slot === 'text') {
505509
provider = 'ollama';
506510
}
507511
// Dla vision/voice 'local' jest ok.
@@ -510,12 +514,12 @@ <h3 class="engine-title u-mb-0">🤖 Silnik Rider-Pi (Health)</h3>
510514
const res = await fetch('/api/models/bind', {
511515
method: 'POST',
512516
headers: { 'Content-Type': 'application/json' },
513-
body: JSON.stringify({ slot: domain, provider: provider, model: model })
517+
body: JSON.stringify({ slot: slot, provider: provider, model: model })
514518
});
515519
if (!res.ok) throw new Error(`API Error: ${res.status}`);
516520

517521
// 3. (Opcjonalnie) Jeśli zmieniamy text, wymuś też zmianę backendu
518-
if(domain === 'text') {
522+
if(slot === 'text') {
519523
const backend = (provider === 'ollama') ? 'local' : provider;
520524
await fetch('/api/providers/text/backend', {
521525
method: 'PATCH', headers: {'Content-Type': 'application/json'},
@@ -675,7 +679,8 @@ <h3 class="engine-title u-mb-0">🤖 Silnik Rider-Pi (Health)</h3>
675679
}
676680

677681
function getEffectiveConfigForDomain(domain) {
678-
const base = { ...(AppState.pc.activeConfig[domain] || {}) };
682+
const slot = resolveSlot(domain);
683+
const base = { ...(AppState.pc.activeConfig[slot] || {}) };
679684
base.providerLabel = formatProviderLabel(base.provider);
680685

681686
if (domain === 'text') {
@@ -717,6 +722,10 @@ <h3 class="engine-title u-mb-0">🤖 Silnik Rider-Pi (Health)</h3>
717722
if (!name) return false;
718723
return CLOUD_PROVIDERS.has(name.toLowerCase());
719724
}
725+
726+
function resolveSlot(domain) {
727+
return DOMAIN_SLOT_MAP[domain] || domain;
728+
}
720729
</script>
721730
<script type="module" src="/web/assets/menu.js"></script>
722731
<script type="module" src="/web/assets/footer.js"></script>

0 commit comments

Comments
 (0)