Modellname im Chat anzeigen + Opus 4 als Default
- ChatPanel: Zeigt Modellname statt "Claude" (z.B. "opus-4", "haiku-4-5") - Modell-Info kommt aus dem result-Event der Bridge - Korrekter Modell-ID: claude-opus-4-20250514 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
87ccf014cc
commit
03f84ceb56
4 changed files with 14 additions and 9 deletions
|
|
@ -34,7 +34,7 @@ let client = null;
|
||||||
let apiKey = null;
|
let apiKey = null;
|
||||||
let conversationHistory = []; // Messages für Multi-Turn
|
let conversationHistory = []; // Messages für Multi-Turn
|
||||||
let activeAbortController = null;
|
let activeAbortController = null;
|
||||||
const MODEL = process.env.CLAUDE_MODEL || 'claude-opus-4-6-20250623';
|
const MODEL = process.env.CLAUDE_MODEL || 'claude-opus-4-20250514';
|
||||||
|
|
||||||
const SYSTEM_PROMPT = `Du bist Claude, ein hilfreicher KI-Assistent von Anthropic.
|
const SYSTEM_PROMPT = `Du bist Claude, ein hilfreicher KI-Assistent von Anthropic.
|
||||||
Du antwortest auf Deutsch. Du bist direkt, präzise und hilfreich.
|
Du antwortest auf Deutsch. Du bist direkt, präzise und hilfreich.
|
||||||
|
|
|
||||||
|
|
@ -71,7 +71,7 @@
|
||||||
{#if message.role === 'user'}
|
{#if message.role === 'user'}
|
||||||
👤 Du
|
👤 Du
|
||||||
{:else if message.role === 'assistant'}
|
{:else if message.role === 'assistant'}
|
||||||
🤖 Claude
|
🤖 {#if message.model}{message.model.replace('claude-', '').replace(/-\d+$/, '')}{:else}Claude{/if}
|
||||||
{:else}
|
{:else}
|
||||||
⚙️ System
|
⚙️ System
|
||||||
{/if}
|
{/if}
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,7 @@ export interface Message {
|
||||||
content: string;
|
content: string;
|
||||||
timestamp: Date;
|
timestamp: Date;
|
||||||
agentId?: string;
|
agentId?: string;
|
||||||
|
model?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface Permission {
|
export interface Permission {
|
||||||
|
|
|
||||||
|
|
@ -42,6 +42,7 @@ interface ResultEvent {
|
||||||
output: number;
|
output: number;
|
||||||
};
|
};
|
||||||
session_id?: string;
|
session_id?: string;
|
||||||
|
model?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Listener-Handles
|
// Listener-Handles
|
||||||
|
|
@ -156,15 +157,18 @@ export async function initEventListeners(): Promise<void> {
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
||||||
// Ergebnis (Kosten, Token)
|
// Ergebnis (Kosten, Token, Modell)
|
||||||
listeners.push(
|
listeners.push(
|
||||||
await listen<ResultEvent>('claude-result', (event) => {
|
await listen<ResultEvent>('claude-result', (event) => {
|
||||||
const { cost, tokens, session_id } = event.payload;
|
const { cost, tokens, session_id, model } = event.payload;
|
||||||
console.log('📊 Ergebnis:', {
|
console.log('📊 Ergebnis:', { cost: cost ? `$${cost.toFixed(4)}` : '-', tokens, model });
|
||||||
cost: cost ? `$${cost.toFixed(4)}` : 'unbekannt',
|
|
||||||
tokens,
|
// Modell an die Streaming-Nachricht anhängen
|
||||||
session_id
|
if (model && streamingMessageId) {
|
||||||
});
|
messages.update((msgs) =>
|
||||||
|
msgs.map((m) => m.id === streamingMessageId ? { ...m, model } : m)
|
||||||
|
);
|
||||||
|
}
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue