feat(server): migrate copilot provider sdk (#11584)

fix AI-15
fix AI-16
This commit is contained in:
darkskygit
2025-04-10 04:14:09 +00:00
parent 0cf8e078e2
commit 5199a74426
12 changed files with 477 additions and 704 deletions
@@ -1,5 +1,4 @@
import { Injectable, OnApplicationBootstrap } from '@nestjs/common';
import OpenAI from 'openai';
import {
Cache,
@@ -46,7 +45,7 @@ export class CopilotContextService implements OnApplicationBootstrap {
private setup() {
const configure = this.config.copilot.providers.openai;
if (configure.apiKey) {
this.client = new OpenAIEmbeddingClient(new OpenAI(configure));
this.client = new OpenAIEmbeddingClient(configure);
}
}