Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@amplication/plugin-integrate-openai

Package Overview
Dependencies
Maintainers
8
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@amplication/plugin-integrate-openai

Add a module and a service to use OpenAI API to Amplication generated code

  • 2.0.4-beta.pr-354.1e83d71
  • npm
  • Socket score

Version published
Weekly downloads
12K
decreased by-59.86%
Maintainers
8
Weekly downloads
 
Created
Source

@amplication/plugin-integrate-openai

NPM Downloads

Adds a service to use OpenAI API

Purpose

This plugin adds a module and a service to use OpenAI API, and adds the openai package as a dependency. It expose a single function createChatCompletion that can be used to create a chat completion using the OpenAI API.

const result = await this.openaiService.createChatCompletion(
  "gpt-3.5-turbo",
  [
    {
      role: "system",
      content: "This is a test system message",
    },
    {
      role: "user",
      content: "This is a test user message",
    },
  ],
  {
    temperature: 1,
    max_tokens: 2048,
    top_p: 1,
    frequency_penalty: 0,
    presence_penalty: 0,
  }
);

Configuration

This plugin requires the following environment variables: OPENAI_API_KEY=[open-ai-key]

Note: For development purposes, the plugin adds the variable to the .env file, but you should never use .env to hold secrets in production, and you should never check in a secrets file to source control. You should use a secrets manager like AWS Secrets Manager or Azure Key Vault to store secrets.

FAQs

Package last updated on 12 Mar 2024

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc