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 }) @Field(() => Boolean, { nullable: true })
pinned?: boolean; pinned?: boolean;
@Field(() => Boolean, {
nullable: true,
description: 'true by default, compliant for old version',
})
reuseLatestChat?: boolean;
} }
@InputType() @InputType()

View File

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

View File

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

View File

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

View File

@@ -552,6 +552,8 @@ export interface CreateChatSessionInput {
pinned?: InputMaybe<Scalars['Boolean']['input']>; pinned?: InputMaybe<Scalars['Boolean']['input']>;
/** The prompt name to use for the session */ /** The prompt name to use for the session */
promptName: Scalars['String']['input']; promptName: Scalars['String']['input'];
/** true by default, compliant for old version */
reuseLatestChat?: InputMaybe<Scalars['Boolean']['input']>;
workspaceId: Scalars['String']['input']; workspaceId: Scalars['String']['input'];
} }