mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-16 17:46:18 +08:00
@@ -3,6 +3,7 @@ import { createHash } from 'node:crypto';
|
||||
import { Injectable, OnApplicationBootstrap } from '@nestjs/common';
|
||||
|
||||
import { FileUpload, JobQueue, PaginationInput } from '../../../base';
|
||||
import { ServerFeature, ServerService } from '../../../core';
|
||||
import { Models } from '../../../models';
|
||||
import { CopilotStorage } from '../storage';
|
||||
import { readStream } from '../utils';
|
||||
@@ -12,6 +13,7 @@ export class CopilotWorkspaceService implements OnApplicationBootstrap {
|
||||
private supportEmbedding = false;
|
||||
|
||||
constructor(
|
||||
private readonly server: ServerService,
|
||||
private readonly models: Models,
|
||||
private readonly queue: JobQueue,
|
||||
private readonly storage: CopilotStorage
|
||||
@@ -19,8 +21,9 @@ export class CopilotWorkspaceService implements OnApplicationBootstrap {
|
||||
|
||||
async onApplicationBootstrap() {
|
||||
const supportEmbedding =
|
||||
await this.models.copilotContext.checkEmbeddingAvailable();
|
||||
await this.models.copilotWorkspace.checkEmbeddingAvailable();
|
||||
if (supportEmbedding) {
|
||||
this.server.enableFeature(ServerFeature.CopilotEmbedding);
|
||||
this.supportEmbedding = true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user