feat(server): expose reuse latest chat (#12999)

fix AI-289
This commit is contained in:
DarkSky
2025-07-03 12:46:23 +08:00
committed by GitHub
parent 4fd42a8461
commit 2ea3c3da9d
5 changed files with 13 additions and 1 deletions

View File

@@ -64,6 +64,12 @@ class CreateChatSessionInput {
@Field(() => Boolean, { nullable: true })
pinned?: boolean;
@Field(() => Boolean, {
nullable: true,
description: 'true by default, compliant for old version',
})
reuseLatestChat?: boolean;
}
@InputType()

View File

@@ -446,7 +446,7 @@ export class ChatSessionService {
// when client create chat session, we always find root session
parentSessionId: null,
},
true
options.reuseLatestChat ?? true
);
}

View File

@@ -76,6 +76,7 @@ export interface ChatSessionOptions {
docId: string | null;
promptName: string;
pinned: boolean;
reuseLatestChat?: boolean;
}
export interface ChatSessionForkOptions

View File

@@ -453,6 +453,9 @@ input CreateChatSessionInput {
"""The prompt name to use for the session"""
promptName: String!
"""true by default, compliant for old version"""
reuseLatestChat: Boolean
workspaceId: String!
}