vitnode-backend-ai-google
TypeScript icon, indicating that this package has built-in type declarations

0.0.9 • Public • Published

(Vitnode) Backend Google AI Provider

This package is used to create a provider for AI using Google AI Dev into the VitNode app.


VitNode Logo

Installation

pnpm i backend-ai-google --filter backend

or

npn i backend-ai-google --workspace=backend

.env file

Add the following to your .env file:

AI_GOOGLE_API_KEY={your_api_key}

Provide config

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 {}

Package Sidebar

Install

npm i vitnode-backend-ai-google

Homepage

vitnode.com

Weekly Downloads

3

Version

0.0.9

License

MIT

Unpacked Size

60.9 kB

Total Files

6

Last publish

Collaborators

  • axendev