更改参数默认值

main
落雨楓 6 months ago
parent e6005f3a9f
commit 96419b8d54

@ -494,7 +494,7 @@ export class MemoryController {
return;
}
if (body.inheritMetadata) {
if (body.inheritMetadata ?? true) {
const currentPage = await ctx.database!.getRepository(ConversationPage)
.findOneBy({ conversationId: conversation.conversationId, pageId: conversation.currentPage });
if (currentPage) {

@ -118,7 +118,7 @@ export type UpdatePageMetadataItemReqType = z.infer<typeof UpdatePageMetadataIte
export const CreateNewPageReq = z.object({
metadata: z.record(z.any()).describe('The metadata for the new page.').nullable().optional(),
inheritMetadata: z.boolean().describe('Whether to inherit metadata from the current page.').default(false),
inheritMetadata: z.boolean().describe('Whether to inherit metadata from the current page.').default(true),
}).describe('NewPageReq');
export type CreateNewPageReqType = z.infer<typeof CreateNewPageReq>;

Loading…
Cancel
Save