This package is used to create a provider for AI using Google AI Dev into the VitNode app.
pnpm i backend-ai-google --filter backend
or
npn i backend-ai-google --workspace=backend
Add the following to your .env
file:
AI_GOOGLE_API_KEY={your_api_key}
Provide aiGoogle
to VitNodeCoreModule
and chose the model you want to use:
import { Module } from '@nestjs/common';
import { join } from 'path';
import { VitNodeCoreModule } from 'vitnode-backend';
import { aiGoogle } from 'vitnode-backend-ai-google';
import { DATABASE_ENVS, schemaDatabase } from './database/config';
import { DatabaseModule } from './database/database.module';
import { PluginsModule } from './plugins/plugins.module';
@Module({
imports: [
VitNodeCoreModule.register({
pathToEnvFile: join(process.cwd(), '..', '..', '.env'),
database: {
config: DATABASE_ENVS,
schemaDatabase,
},
ai: aiGoogle({
api_key: process.env.AI_GOOGLE_API_KEY,
model: 'gemini-1.0-pro',
}),
}),
DatabaseModule,
PluginsModule,
],
})
export class AppModule {}