mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-13 04:48:53 +00:00
feat(server): add created timestamp to history (#6607)
This commit is contained in:
@@ -318,6 +318,7 @@ export class ChatSessionService {
|
||||
select: {
|
||||
id: true,
|
||||
promptName: true,
|
||||
createdAt: true,
|
||||
messages: {
|
||||
select: {
|
||||
role: true,
|
||||
@@ -335,7 +336,7 @@ export class ChatSessionService {
|
||||
})
|
||||
.then(sessions =>
|
||||
Promise.all(
|
||||
sessions.map(async ({ id, promptName, messages }) => {
|
||||
sessions.map(async ({ id, promptName, messages, createdAt }) => {
|
||||
try {
|
||||
const ret = PromptMessageSchema.array().safeParse(messages);
|
||||
if (ret.success) {
|
||||
@@ -357,6 +358,7 @@ export class ChatSessionService {
|
||||
sessionId: id,
|
||||
action: prompt.action || undefined,
|
||||
tokens,
|
||||
createdAt,
|
||||
messages: preload.concat(ret.data),
|
||||
};
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user