Skip to content

Commit 71fa633

Browse files
committed
fix start new thread params lose
1 parent ed34177 commit 71fa633

File tree

2 files changed

+21
-6
lines changed

2 files changed

+21
-6
lines changed

src/main/presenter/threadPresenter/index.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -455,6 +455,7 @@ export class ThreadPresenter implements IThreadPresenter {
455455
title: string,
456456
settings: Partial<CONVERSATION_SETTINGS> = {}
457457
): Promise<string> {
458+
console.log('createConversation', title, settings)
458459
const latestConversation = await this.getLatestConversation()
459460

460461
if (latestConversation) {
@@ -484,6 +485,18 @@ export class ThreadPresenter implements IThreadPresenter {
484485
if (settings.artifacts) {
485486
mergedSettings.artifacts = settings.artifacts
486487
}
488+
if (settings.maxTokens) {
489+
mergedSettings.maxTokens = settings.maxTokens
490+
}
491+
if (settings.temperature) {
492+
mergedSettings.temperature = settings.temperature
493+
}
494+
if (settings.contextLength) {
495+
mergedSettings.contextLength = settings.contextLength
496+
}
497+
if (settings.systemPrompt) {
498+
mergedSettings.systemPrompt = settings.systemPrompt
499+
}
487500
const conversationId = await this.sqlitePresenter.createConversation(title, mergedSettings)
488501
await this.setActiveConversation(conversationId)
489502
return conversationId

src/renderer/src/components/message/MessageItemAssistant.vue

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
<template>
2-
<div ref="messageNode" :class="['flex flex-row py-4 pl-4 pr-11 group gap-2 w-full', 'justify-start']">
2+
<div
3+
ref="messageNode"
4+
:class="['flex flex-row py-4 pl-4 pr-11 group gap-2 w-full', 'justify-start']"
5+
>
36
<ModelIcon
47
:model-id="message.model_id"
58
custom-class="flex-shrink-0 w-5 h-5 block rounded-md bg-background"
@@ -66,13 +69,14 @@ import MessageInfo from './MessageInfo.vue'
6669
import { useChatStore } from '@/stores/chat'
6770
import ModelIcon from '@/components/icons/ModelIcon.vue'
6871
import { Icon } from '@iconify/vue'
69-
import { toBlob } from 'html-to-image';
70-
72+
import { toBlob } from 'html-to-image'
73+
import { useDark } from '@vueuse/core'
7174
7275
const props = defineProps<{
7376
message: AssistantMessage
7477
}>()
7578
79+
const isDark = useDark()
7680
const chatStore = useChatStore()
7781
const currentVariantIndex = ref(0)
7882
@@ -81,8 +85,6 @@ const messageNode = useTemplateRef('messageNode')
8185
// 获取当前会话ID
8286
const currentThreadId = computed(() => chatStore.activeThreadId || '')
8387
84-
85-
8688
// 计算当前消息的所有变体(包括缓存中的)
8789
const allVariants = computed(() => {
8890
const messageVariants = props.message.variants || []
@@ -164,7 +166,7 @@ const handleAction = (action: 'retry' | 'delete' | 'copy' | 'prev' | 'next' | 'c
164166
if (messageNode.value) {
165167
toBlob(messageNode.value, {
166168
quality: 1,
167-
backgroundColor: '#FFFFFF',
169+
backgroundColor: isDark ? '#000000' : '#FFFFFF'
168170
}).then((blob) => {
169171
if (blob) {
170172
const rd = new FileReader()

0 commit comments

Comments
 (0)