mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-05-07 14:39:25 +08:00
fix(ai): issue where the default baseURL
for LLM provider is undefined (#6367)
This commit is contained in:
parent
ea64d975ed
commit
7404e57d4c
@ -12,7 +12,9 @@ import { LLMProvider } from './provider';
|
||||
import { LLMProviderOptions } from '../manager/ai-manager';
|
||||
|
||||
export class DeepSeekProvider extends LLMProvider {
|
||||
baseURL = 'https://api.deepseek.com';
|
||||
get baseURL() {
|
||||
return 'https://api.deepseek.com';
|
||||
}
|
||||
|
||||
createModel() {
|
||||
const { baseURL, apiKey } = this.serviceOptions || {};
|
||||
|
@ -11,7 +11,9 @@ import { ChatOpenAI } from '@langchain/openai';
|
||||
import { LLMProvider } from './provider';
|
||||
|
||||
export class OpenAIProvider extends LLMProvider {
|
||||
baseURL = 'https://api.openai.com/v1';
|
||||
get baseURL() {
|
||||
return 'https://api.openai.com/v1';
|
||||
}
|
||||
|
||||
createModel() {
|
||||
const { baseURL, apiKey } = this.serviceOptions || {};
|
||||
|
@ -13,7 +13,6 @@ import { parseMessages } from './handlers/parse-messages';
|
||||
import { Application } from '@nocobase/server';
|
||||
|
||||
export abstract class LLMProvider {
|
||||
baseURL?: string;
|
||||
serviceOptions: Record<string, any>;
|
||||
modelOptions: Record<string, any>;
|
||||
messages: any[];
|
||||
@ -22,6 +21,10 @@ export abstract class LLMProvider {
|
||||
|
||||
abstract createModel(): BaseChatModel;
|
||||
|
||||
get baseURL() {
|
||||
return null;
|
||||
}
|
||||
|
||||
constructor(opts: {
|
||||
app: Application;
|
||||
serviceOptions: any;
|
||||
|
Loading…
x
Reference in New Issue
Block a user