mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-15 05:37:32 +00:00
feat(server): stop embedding in doc embedding disabled workspace (#11761)
fix AI-33
This commit is contained in:
@@ -701,6 +701,10 @@ export const USER_FRIENDLY_ERRORS = {
|
||||
message: ({ contextId, content, message }) =>
|
||||
`Failed to match context ${contextId} with "${escape(content)}": ${message}`,
|
||||
},
|
||||
copilot_embedding_disabled: {
|
||||
type: 'action_forbidden',
|
||||
message: `Embedding feature is disabled, please contact the administrator to enable it in the workspace settings.`,
|
||||
},
|
||||
copilot_embedding_unavailable: {
|
||||
type: 'action_forbidden',
|
||||
message: `Embedding feature not available, you may need to install pgvector extension to your database`,
|
||||
|
||||
@@ -759,6 +759,12 @@ export class CopilotFailedToMatchContext extends UserFriendlyError {
|
||||
}
|
||||
}
|
||||
|
||||
export class CopilotEmbeddingDisabled extends UserFriendlyError {
|
||||
constructor(message?: string) {
|
||||
super('action_forbidden', 'copilot_embedding_disabled', message);
|
||||
}
|
||||
}
|
||||
|
||||
export class CopilotEmbeddingUnavailable extends UserFriendlyError {
|
||||
constructor(message?: string) {
|
||||
super('action_forbidden', 'copilot_embedding_unavailable', message);
|
||||
@@ -1037,6 +1043,7 @@ export enum ErrorNames {
|
||||
COPILOT_CONTEXT_FILE_NOT_SUPPORTED,
|
||||
COPILOT_FAILED_TO_MODIFY_CONTEXT,
|
||||
COPILOT_FAILED_TO_MATCH_CONTEXT,
|
||||
COPILOT_EMBEDDING_DISABLED,
|
||||
COPILOT_EMBEDDING_UNAVAILABLE,
|
||||
COPILOT_TRANSCRIPTION_JOB_EXISTS,
|
||||
COPILOT_TRANSCRIPTION_JOB_NOT_FOUND,
|
||||
|
||||
Reference in New Issue
Block a user