mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 04:18:54 +00:00
fix: history attachment query (#6670)
This commit is contained in:
@@ -188,6 +188,7 @@ export class PromptService {
|
||||
create: messages.map((m, idx) => ({
|
||||
idx,
|
||||
...m,
|
||||
attachments: m.attachments || undefined,
|
||||
params: m.params || undefined,
|
||||
})),
|
||||
},
|
||||
@@ -206,6 +207,7 @@ export class PromptService {
|
||||
create: messages.map((m, idx) => ({
|
||||
idx,
|
||||
...m,
|
||||
attachments: m.attachments || undefined,
|
||||
params: m.params || undefined,
|
||||
})),
|
||||
},
|
||||
|
||||
@@ -161,6 +161,7 @@ export class ChatSessionService {
|
||||
|
||||
const messages = state.messages.map(m => ({
|
||||
...m,
|
||||
attachments: m.attachments || undefined,
|
||||
params: m.params || undefined,
|
||||
}));
|
||||
|
||||
@@ -322,6 +323,7 @@ export class ChatSessionService {
|
||||
select: {
|
||||
role: true,
|
||||
content: true,
|
||||
attachments: true,
|
||||
params: true,
|
||||
createdAt: true,
|
||||
},
|
||||
|
||||
@@ -59,7 +59,7 @@ export const ChatMessageRole = Object.values(AiPromptRole) as [
|
||||
|
||||
const PureMessageSchema = z.object({
|
||||
content: z.string(),
|
||||
attachments: z.array(z.string()).optional(),
|
||||
attachments: z.array(z.string()).optional().nullable(),
|
||||
params: z
|
||||
.record(z.union([z.string(), z.array(z.string())]))
|
||||
.optional()
|
||||
|
||||
Reference in New Issue
Block a user