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