Skip to Content

@loopstack/openai-module

Installation

npm install @loopstack/openai-module

Register the module in your app module:

import { Module } from '@nestjs/common'; import { OpenAiModule } from '@loopstack/openai-module'; @Module({ imports: [OpenAiModule], }) export class AppModule {}

OpenAiModule registers the openai provider into the LLM provider registry on startup, so import it alongside LlmProviderModule (from @loopstack/llm-provider-module).

The module reads the OpenAI API key from the OPENAI_API_KEY environment variable:

OPENAI_API_KEY=sk-...
Last updated on