refactor: Use only the message data `model` property for displaying model used info
This commit is contained in:
parent
45bf2a4983
commit
049f40dfdf
|
|
@ -21,7 +21,6 @@
|
||||||
import ChatMessageActions from './ChatMessageActions.svelte';
|
import ChatMessageActions from './ChatMessageActions.svelte';
|
||||||
import Label from '$lib/components/ui/label/label.svelte';
|
import Label from '$lib/components/ui/label/label.svelte';
|
||||||
import { config } from '$lib/stores/settings.svelte';
|
import { config } from '$lib/stores/settings.svelte';
|
||||||
import { modelName as serverModelName } from '$lib/stores/server.svelte';
|
|
||||||
import { copyToClipboard } from '$lib/utils/copy';
|
import { copyToClipboard } from '$lib/utils/copy';
|
||||||
import type { ApiChatCompletionToolCall } from '$lib/types/api';
|
import type { ApiChatCompletionToolCall } from '$lib/types/api';
|
||||||
|
|
||||||
|
|
@ -93,19 +92,15 @@
|
||||||
|
|
||||||
const processingState = useProcessingState();
|
const processingState = useProcessingState();
|
||||||
let currentConfig = $derived(config());
|
let currentConfig = $derived(config());
|
||||||
let serverModel = $derived(serverModelName());
|
|
||||||
let displayedModel = $derived((): string | null => {
|
let displayedModel = $derived((): string | null => {
|
||||||
if (!currentConfig.showModelInfo) return null;
|
if (!currentConfig.showModelInfo) return null;
|
||||||
|
|
||||||
|
// Only show model from streaming data, no fallbacks to server props
|
||||||
if (message.model) {
|
if (message.model) {
|
||||||
return message.model;
|
return message.model;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!serverModel || serverModel === 'none' || serverModel === 'llama-server') {
|
|
||||||
return null;
|
return null;
|
||||||
}
|
|
||||||
|
|
||||||
return serverModel;
|
|
||||||
});
|
});
|
||||||
|
|
||||||
function handleCopyModel() {
|
function handleCopyModel() {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue