mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-18 02:26:21 +08:00
feat(server): global embedding gql endpoint (#11809)
fix AI-30 fix AI-31 fix PD-2487
This commit is contained in:
@@ -239,6 +239,11 @@ export interface CopilotDocType {
|
||||
status: Maybe<ContextEmbedStatus>;
|
||||
}
|
||||
|
||||
export interface CopilotFailedToAddWorkspaceFileEmbeddingDataType {
|
||||
__typename?: 'CopilotFailedToAddWorkspaceFileEmbeddingDataType';
|
||||
message: Scalars['String']['output'];
|
||||
}
|
||||
|
||||
export interface CopilotFailedToMatchContextDataType {
|
||||
__typename?: 'CopilotFailedToMatchContextDataType';
|
||||
content: Scalars['String']['output'];
|
||||
@@ -359,6 +364,23 @@ export interface CopilotSessionType {
|
||||
promptName: Scalars['String']['output'];
|
||||
}
|
||||
|
||||
export interface CopilotWorkspaceConfig {
|
||||
__typename?: 'CopilotWorkspaceConfig';
|
||||
files: Array<CopilotWorkspaceFile>;
|
||||
ignoredDocs: Array<Scalars['String']['output']>;
|
||||
workspaceId: Scalars['String']['output'];
|
||||
}
|
||||
|
||||
export interface CopilotWorkspaceFile {
|
||||
__typename?: 'CopilotWorkspaceFile';
|
||||
createdAt: Scalars['DateTime']['output'];
|
||||
fileId: Scalars['String']['output'];
|
||||
fileName: Scalars['String']['output'];
|
||||
mimeType: Scalars['String']['output'];
|
||||
size: Scalars['SafeInt']['output'];
|
||||
workspaceId: Scalars['String']['output'];
|
||||
}
|
||||
|
||||
export interface CreateChatMessageInput {
|
||||
attachments?: InputMaybe<Array<Scalars['String']['input']>>;
|
||||
blobs?: InputMaybe<Array<Scalars['Upload']['input']>>;
|
||||
@@ -507,6 +529,7 @@ export type ErrorDataUnion =
|
||||
| BlobNotFoundDataType
|
||||
| CopilotContextFileNotSupportedDataType
|
||||
| CopilotDocNotFoundDataType
|
||||
| CopilotFailedToAddWorkspaceFileEmbeddingDataType
|
||||
| CopilotFailedToMatchContextDataType
|
||||
| CopilotFailedToModifyContextDataType
|
||||
| CopilotInvalidContextDataType
|
||||
@@ -572,6 +595,7 @@ export enum ErrorNames {
|
||||
COPILOT_DOC_NOT_FOUND = 'COPILOT_DOC_NOT_FOUND',
|
||||
COPILOT_EMBEDDING_DISABLED = 'COPILOT_EMBEDDING_DISABLED',
|
||||
COPILOT_EMBEDDING_UNAVAILABLE = 'COPILOT_EMBEDDING_UNAVAILABLE',
|
||||
COPILOT_FAILED_TO_ADD_WORKSPACE_FILE_EMBEDDING = 'COPILOT_FAILED_TO_ADD_WORKSPACE_FILE_EMBEDDING',
|
||||
COPILOT_FAILED_TO_CREATE_MESSAGE = 'COPILOT_FAILED_TO_CREATE_MESSAGE',
|
||||
COPILOT_FAILED_TO_GENERATE_TEXT = 'COPILOT_FAILED_TO_GENERATE_TEXT',
|
||||
COPILOT_FAILED_TO_MATCH_CONTEXT = 'COPILOT_FAILED_TO_MATCH_CONTEXT',
|
||||
@@ -1040,6 +1064,8 @@ export interface Mutation {
|
||||
addContextDoc: CopilotContextDoc;
|
||||
/** add a file to context */
|
||||
addContextFile: CopilotContextFile;
|
||||
/** Update workspace embedding files */
|
||||
addWorkspaceEmbeddingFiles: CopilotWorkspaceFile;
|
||||
addWorkspaceFeature: Scalars['Boolean']['output'];
|
||||
approveMember: Scalars['Boolean']['output'];
|
||||
/** Ban an user */
|
||||
@@ -1107,6 +1133,8 @@ export interface Mutation {
|
||||
removeContextDoc: Scalars['Boolean']['output'];
|
||||
/** remove a file from context */
|
||||
removeContextFile: Scalars['Boolean']['output'];
|
||||
/** Remove workspace embedding files */
|
||||
removeWorkspaceEmbeddingFiles: Scalars['Boolean']['output'];
|
||||
removeWorkspaceFeature: Scalars['Boolean']['output'];
|
||||
resumeSubscription: SubscriptionType;
|
||||
retryAudioTranscription: Maybe<TranscriptionResultType>;
|
||||
@@ -1142,6 +1170,8 @@ export interface Mutation {
|
||||
updateUserFeatures: Array<FeatureType>;
|
||||
/** Update workspace */
|
||||
updateWorkspace: WorkspaceType;
|
||||
/** Update ignored docs */
|
||||
updateWorkspaceEmbeddingIgnoredDocs: Scalars['Int']['output'];
|
||||
/** Upload user avatar */
|
||||
uploadAvatar: UserType;
|
||||
verifyEmail: Scalars['Boolean']['output'];
|
||||
@@ -1171,6 +1201,11 @@ export interface MutationAddContextFileArgs {
|
||||
options: AddContextFileInput;
|
||||
}
|
||||
|
||||
export interface MutationAddWorkspaceEmbeddingFilesArgs {
|
||||
blob: Scalars['Upload']['input'];
|
||||
workspaceId: Scalars['String']['input'];
|
||||
}
|
||||
|
||||
export interface MutationAddWorkspaceFeatureArgs {
|
||||
feature: FeatureType;
|
||||
workspaceId: Scalars['String']['input'];
|
||||
@@ -1364,6 +1399,11 @@ export interface MutationRemoveContextFileArgs {
|
||||
options: RemoveContextFileInput;
|
||||
}
|
||||
|
||||
export interface MutationRemoveWorkspaceEmbeddingFilesArgs {
|
||||
fileId: Scalars['String']['input'];
|
||||
workspaceId: Scalars['String']['input'];
|
||||
}
|
||||
|
||||
export interface MutationRemoveWorkspaceFeatureArgs {
|
||||
feature: FeatureType;
|
||||
workspaceId: Scalars['String']['input'];
|
||||
@@ -1494,6 +1534,12 @@ export interface MutationUpdateWorkspaceArgs {
|
||||
input: UpdateWorkspaceInput;
|
||||
}
|
||||
|
||||
export interface MutationUpdateWorkspaceEmbeddingIgnoredDocsArgs {
|
||||
add?: InputMaybe<Array<Scalars['String']['input']>>;
|
||||
remove?: InputMaybe<Array<Scalars['String']['input']>>;
|
||||
workspaceId: Scalars['String']['input'];
|
||||
}
|
||||
|
||||
export interface MutationUploadAvatarArgs {
|
||||
avatar: Scalars['Upload']['input'];
|
||||
}
|
||||
@@ -2232,6 +2278,7 @@ export interface WorkspaceType {
|
||||
createdAt: Scalars['DateTime']['output'];
|
||||
/** Get get with given id */
|
||||
doc: DocType;
|
||||
embedding: CopilotWorkspaceConfig;
|
||||
/** Enable AI */
|
||||
enableAi: Scalars['Boolean']['output'];
|
||||
/** Enable doc embedding */
|
||||
@@ -3169,6 +3216,71 @@ export type GetCopilotSessionsQuery = {
|
||||
} | null;
|
||||
};
|
||||
|
||||
export type AddWorkspaceEmbeddingFilesMutationVariables = Exact<{
|
||||
workspaceId: Scalars['String']['input'];
|
||||
blob: Scalars['Upload']['input'];
|
||||
}>;
|
||||
|
||||
export type AddWorkspaceEmbeddingFilesMutation = {
|
||||
__typename?: 'Mutation';
|
||||
addWorkspaceEmbeddingFiles: {
|
||||
__typename?: 'CopilotWorkspaceFile';
|
||||
fileId: string;
|
||||
fileName: string;
|
||||
mimeType: string;
|
||||
size: number;
|
||||
createdAt: string;
|
||||
};
|
||||
};
|
||||
|
||||
export type RemoveWorkspaceEmbeddingFilesMutationVariables = Exact<{
|
||||
workspaceId: Scalars['String']['input'];
|
||||
fileId: Scalars['String']['input'];
|
||||
}>;
|
||||
|
||||
export type RemoveWorkspaceEmbeddingFilesMutation = {
|
||||
__typename?: 'Mutation';
|
||||
removeWorkspaceEmbeddingFiles: boolean;
|
||||
};
|
||||
|
||||
export type GetWorkspaceEmbeddingConfigQueryVariables = Exact<{
|
||||
workspaceId: Scalars['String']['input'];
|
||||
}>;
|
||||
|
||||
export type GetWorkspaceEmbeddingConfigQuery = {
|
||||
__typename?: 'Query';
|
||||
workspace: {
|
||||
__typename?: 'WorkspaceType';
|
||||
embedding: {
|
||||
__typename?: 'CopilotWorkspaceConfig';
|
||||
ignoredDocs: Array<string>;
|
||||
files: Array<{
|
||||
__typename?: 'CopilotWorkspaceFile';
|
||||
fileId: string;
|
||||
fileName: string;
|
||||
mimeType: string;
|
||||
size: number;
|
||||
createdAt: string;
|
||||
}>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
export type UpdateWorkspaceEmbeddingIgnoredDocsMutationVariables = Exact<{
|
||||
workspaceId: Scalars['String']['input'];
|
||||
add?: InputMaybe<
|
||||
Array<Scalars['String']['input']> | Scalars['String']['input']
|
||||
>;
|
||||
remove?: InputMaybe<
|
||||
Array<Scalars['String']['input']> | Scalars['String']['input']
|
||||
>;
|
||||
}>;
|
||||
|
||||
export type UpdateWorkspaceEmbeddingIgnoredDocsMutation = {
|
||||
__typename?: 'Mutation';
|
||||
updateWorkspaceEmbeddingIgnoredDocs: number;
|
||||
};
|
||||
|
||||
export type CreateCheckoutSessionMutationVariables = Exact<{
|
||||
input: CreateCheckoutSessionInput;
|
||||
}>;
|
||||
@@ -4427,6 +4539,11 @@ export type Queries =
|
||||
variables: GetCopilotSessionsQueryVariables;
|
||||
response: GetCopilotSessionsQuery;
|
||||
}
|
||||
| {
|
||||
name: 'getWorkspaceEmbeddingConfigQuery';
|
||||
variables: GetWorkspaceEmbeddingConfigQueryVariables;
|
||||
response: GetWorkspaceEmbeddingConfigQuery;
|
||||
}
|
||||
| {
|
||||
name: 'getDocRolePermissionsQuery';
|
||||
variables: GetDocRolePermissionsQueryVariables;
|
||||
@@ -4784,6 +4901,21 @@ export type Mutations =
|
||||
variables: UpdateCopilotSessionMutationVariables;
|
||||
response: UpdateCopilotSessionMutation;
|
||||
}
|
||||
| {
|
||||
name: 'addWorkspaceEmbeddingFilesMutation';
|
||||
variables: AddWorkspaceEmbeddingFilesMutationVariables;
|
||||
response: AddWorkspaceEmbeddingFilesMutation;
|
||||
}
|
||||
| {
|
||||
name: 'removeWorkspaceEmbeddingFilesMutation';
|
||||
variables: RemoveWorkspaceEmbeddingFilesMutationVariables;
|
||||
response: RemoveWorkspaceEmbeddingFilesMutation;
|
||||
}
|
||||
| {
|
||||
name: 'updateWorkspaceEmbeddingIgnoredDocsMutation';
|
||||
variables: UpdateWorkspaceEmbeddingIgnoredDocsMutationVariables;
|
||||
response: UpdateWorkspaceEmbeddingIgnoredDocsMutation;
|
||||
}
|
||||
| {
|
||||
name: 'createCheckoutSessionMutation';
|
||||
variables: CreateCheckoutSessionMutationVariables;
|
||||
|
||||
Reference in New Issue
Block a user