feat(server): allow multiple session attach to doc (#12933)

fix AI-236
This commit is contained in:
DarkSky
2025-06-26 10:15:31 +08:00
committed by GitHub
parent e32c9a814a
commit 06f27e8d6a
14 changed files with 1304 additions and 306 deletions

View File

@@ -323,11 +323,14 @@ export interface CopilotHistories {
/** An mark identifying which view to use to display the session */
action: Maybe<Scalars['String']['output']>;
createdAt: Scalars['DateTime']['output'];
docId: Maybe<Scalars['String']['output']>;
messages: Array<ChatMessage>;
pinned: Scalars['Boolean']['output'];
sessionId: Scalars['String']['output'];
/** The number of tokens used in the session */
tokens: Scalars['Int']['output'];
updatedAt: Scalars['DateTime']['output'];
workspaceId: Scalars['String']['output'];
}
export interface CopilotInvalidContextDataType {
@@ -340,22 +343,6 @@ export interface CopilotMessageNotFoundDataType {
messageId: Scalars['String']['output'];
}
export enum CopilotModels {
DallE3 = 'DallE3',
Gpt4Omni = 'Gpt4Omni',
Gpt4Omni0806 = 'Gpt4Omni0806',
Gpt4OmniMini = 'Gpt4OmniMini',
Gpt4OmniMini0718 = 'Gpt4OmniMini0718',
Gpt41 = 'Gpt41',
Gpt41Mini = 'Gpt41Mini',
Gpt41Nano = 'Gpt41Nano',
Gpt410414 = 'Gpt410414',
GptImage = 'GptImage',
TextEmbedding3Large = 'TextEmbedding3Large',
TextEmbedding3Small = 'TextEmbedding3Small',
TextEmbeddingAda002 = 'TextEmbeddingAda002',
}
export interface CopilotPromptConfigInput {
frequencyPenalty?: InputMaybe<Scalars['Float']['input']>;
presencePenalty?: InputMaybe<Scalars['Float']['input']>;
@@ -515,7 +502,7 @@ export interface CreateCopilotPromptInput {
action?: InputMaybe<Scalars['String']['input']>;
config?: InputMaybe<CopilotPromptConfigInput>;
messages: Array<CopilotPromptMessageInput>;
model: CopilotModels;
model: Scalars['String']['input'];
name: Scalars['String']['input'];
}
@@ -3575,6 +3562,41 @@ export type ForkCopilotSessionMutation = {
forkCopilotSession: string;
};
export type GetCopilotLatestDocSessionQueryVariables = Exact<{
workspaceId: Scalars['String']['input'];
docId: Scalars['String']['input'];
}>;
export type GetCopilotLatestDocSessionQuery = {
__typename?: 'Query';
currentUser: {
__typename?: 'UserType';
copilot: {
__typename?: 'Copilot';
histories: Array<{
__typename?: 'CopilotHistories';
sessionId: string;
workspaceId: string;
docId: string | null;
pinned: boolean;
action: string | null;
tokens: number;
createdAt: string;
updatedAt: string;
messages: Array<{
__typename?: 'ChatMessage';
id: string | null;
role: string;
content: string;
attachments: Array<string> | null;
params: Record<string, string> | null;
createdAt: string;
}>;
}>;
};
} | null;
};
export type GetCopilotSessionQueryVariables = Exact<{
workspaceId: Scalars['String']['input'];
sessionId: Scalars['String']['input'];
@@ -3600,6 +3622,32 @@ export type GetCopilotSessionQuery = {
} | null;
};
export type GetCopilotRecentSessionsQueryVariables = Exact<{
workspaceId: Scalars['String']['input'];
limit?: InputMaybe<Scalars['Int']['input']>;
}>;
export type GetCopilotRecentSessionsQuery = {
__typename?: 'Query';
currentUser: {
__typename?: 'UserType';
copilot: {
__typename?: 'Copilot';
histories: Array<{
__typename?: 'CopilotHistories';
sessionId: string;
workspaceId: string;
docId: string | null;
pinned: boolean;
action: string | null;
tokens: number;
createdAt: string;
updatedAt: string;
}>;
};
} | null;
};
export type UpdateCopilotSessionMutationVariables = Exact<{
options: UpdateChatSessionInput;
}>;
@@ -5209,11 +5257,21 @@ export type Queries =
variables: CopilotQuotaQueryVariables;
response: CopilotQuotaQuery;
}
| {
name: 'getCopilotLatestDocSessionQuery';
variables: GetCopilotLatestDocSessionQueryVariables;
response: GetCopilotLatestDocSessionQuery;
}
| {
name: 'getCopilotSessionQuery';
variables: GetCopilotSessionQueryVariables;
response: GetCopilotSessionQuery;
}
| {
name: 'getCopilotRecentSessionsQuery';
variables: GetCopilotRecentSessionsQueryVariables;
response: GetCopilotRecentSessionsQuery;
}
| {
name: 'getCopilotSessionsQuery';
variables: GetCopilotSessionsQueryVariables;