Launch Week Day 2: Introducing Reports: An Extensible Reporting Framework for Socket Data.Learn More
Socket
Book a DemoSign in
Socket

@all-inclusive/nestjs-openai

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@all-inclusive/nestjs-openai

OpenAI API client for nestjs

latest
Source
npmnpm
Version
0.0.4
Version published
Maintainers
1
Created
Source

All-Inclusive Digital Logo

OpenAI Node API Library from NestJS

Description

This library provides convenient access to the OpenAI REST API from NestJS.

Installation

$ npm i @all-inclusive/nestjs-openai

Usage

In a parent module "forRoot"

import { OpenAiModule, Models } from "@all-inclusive/nestjs-openai";

@Module({
  imports: [
    OpenAiModule.forRoot({
      apiKey: 'YOUR_OPEN_AI_API_KEY',
      model: Models.GPT4
    })
  ],
})
class AppModule {}

In a parent module "forRootAsync"

import { OpenAiModule, Models } from "@all-inclusive/nestjs-openai";

@Module({
  imports: [
    OpenAiModule.forRootAsync(      
      {
        inject: [...any],
        useFactory: {
          apiKey: 'YOUR_OPEN_AI_API_KEY',
          model: Models.GPT4,
        },
    })
  ],
})
class AppModule {}

Keywords

all-inclusive

FAQs

Package last updated on 26 Dec 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts