Getting Started
Before starting you need to be authenticated, since the package is hosted within a private npm registry, the authentication steps are described before.
Authentication
npm i @tradinos/cms-backend-aiimport { Module } from '@nestjs/common';
import { ConfigService } from '@nestjs/config';
import { AIModule } from '@tradinos/cms-backend-ai';
import { AIController } from 'src/domain/ai/ai.controller';
@Module({
imports: [
AIModule.configureAsync({
inject: [ConfigService],
useFactory: (config: ConfigService) => {
return {
operations: {
articleGeneration: {
promptFactory: (topic, length, tone, language, eventDetails) => "Your Prompt Here"
},
postGeneration: {
promptFactory: (platform, language, platformLimit, article, notes) => "Your Prompt Here"
}
},
openai: { apiKey: /** Your API Key Here */ },
};
},
}),
],
controllers: [AIController],
})
export class LocalAIModule { }For articleGenerationPromptFactory(...) => string
articleGenerationPromptFactory(...) => stringFor postGenerationPromptFactory(...) => string
postGenerationPromptFactory(...) => stringLast updated