This commit is contained in:
duanfuxiang
2025-04-13 15:04:27 +08:00
parent 169c687ed3
commit 812aa76376
8 changed files with 139 additions and 40 deletions

View File

@@ -22,7 +22,8 @@ export class OpenAICompatibleProvider implements BaseLLMProvider {
private baseURL: string
constructor(apiKey: string, baseURL: string) {
this.adapter = new OpenAIMessageAdapter()
console.log('OpenAICompatibleProvider constructor', apiKey, baseURL)
this.adapter = new OpenAIMessageAdapter()
this.client = new OpenAI({
apiKey: apiKey,
baseURL: baseURL,
@@ -37,6 +38,7 @@ export class OpenAICompatibleProvider implements BaseLLMProvider {
request: LLMRequestNonStreaming,
options?: LLMOptions,
): Promise<LLMResponseNonStreaming> {
console.log('OpenAICompatibleProvider generateResponse', this.baseURL, this.apiKey)
if (!this.baseURL || !this.apiKey) {
throw new LLMBaseUrlNotSetException(
'OpenAI Compatible base URL or API key is missing. Please set it in settings menu.',