@@ -28,6 +28,8 @@ export interface Conversation {
|
||||
characterId: number
|
||||
title: string
|
||||
presetId?: number
|
||||
worldbookId?: number
|
||||
worldbookEnabled: boolean
|
||||
aiProvider: string
|
||||
model: string
|
||||
settings?: Record<string, any>
|
||||
@@ -50,6 +52,8 @@ export interface CreateConversationRequest {
|
||||
characterId: number
|
||||
title?: string
|
||||
presetId?: number
|
||||
worldbookId?: number
|
||||
worldbookEnabled?: boolean
|
||||
aiProvider?: string
|
||||
model?: string
|
||||
settings?: Record<string, any>
|
||||
@@ -103,8 +107,12 @@ export const conversationApi = {
|
||||
},
|
||||
|
||||
// 更新对话设置
|
||||
updateConversationSettings: (conversationId: number, settings: Record<string, any>) => {
|
||||
return apiClient.put(`/app/conversation/${conversationId}/settings`, { settings })
|
||||
updateConversationSettings: (conversationId: number, data: {
|
||||
settings?: Record<string, any>
|
||||
worldbookId?: number
|
||||
worldbookEnabled?: boolean
|
||||
}) => {
|
||||
return apiClient.put(`/app/conversation/${conversationId}/settings`, data)
|
||||
},
|
||||
|
||||
// 重新生成最后一条 AI 回复(非流式)
|
||||
|
||||
@@ -149,7 +149,7 @@ export default function ChatArea({ conversation, character, onConversationUpdate
|
||||
} else {
|
||||
settings.presetId = presetId
|
||||
}
|
||||
await conversationApi.updateConversationSettings(conversation.id, settings)
|
||||
await conversationApi.updateConversationSettings(conversation.id, { settings })
|
||||
setSelectedPresetId(presetId ?? undefined)
|
||||
setShowPresetSelector(false)
|
||||
const convResp = await conversationApi.getConversationById(conversation.id)
|
||||
@@ -170,7 +170,7 @@ export default function ChatArea({ conversation, character, onConversationUpdate
|
||||
} else {
|
||||
settings.aiConfigId = configId
|
||||
}
|
||||
await conversationApi.updateConversationSettings(conversation.id, settings)
|
||||
await conversationApi.updateConversationSettings(conversation.id, { settings })
|
||||
setSelectedConfigId(configId ?? undefined)
|
||||
setShowModelSelector(false)
|
||||
const convResp = await conversationApi.getConversationById(conversation.id)
|
||||
|
||||
Reference in New Issue
Block a user