Refresh AI model setup (#13171)
Instead of initializing model at start time we do it at run time to be able to swap model provider more easily. Also introduce a third driver for openai-compatible providers, which among other allows for local models with Ollama
This commit is contained in:
+1
-5
@@ -1,8 +1,6 @@
|
||||
import { Module } from '@nestjs/common';
|
||||
import { TypeOrmModule } from '@nestjs/typeorm';
|
||||
|
||||
import { AiDriver } from 'src/engine/core-modules/ai/interfaces/ai.interface';
|
||||
|
||||
import { AiModule } from 'src/engine/core-modules/ai/ai.module';
|
||||
import { AgentEntity } from 'src/engine/metadata-modules/agent/agent.entity';
|
||||
import { AgentModule } from 'src/engine/metadata-modules/agent/agent.module';
|
||||
@@ -13,9 +11,7 @@ import { AiAgentWorkflowAction } from './ai-agent.workflow-action';
|
||||
@Module({
|
||||
imports: [
|
||||
AgentModule,
|
||||
AiModule.forRoot({
|
||||
useFactory: () => ({ type: AiDriver.OPENAI }),
|
||||
}),
|
||||
AiModule,
|
||||
TypeOrmModule.forFeature([AgentEntity], 'core'),
|
||||
],
|
||||
providers: [ScopedWorkspaceContextFactory, AiAgentWorkflowAction],
|
||||
|
||||
Reference in New Issue
Block a user