You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

strapi-openai-translate

Package Overview
Dependencies
Maintainers
0
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

strapi-openai-translate

ChatGPT provider for translate plugin in Strapi 4

1.0.0
latest
Source
npmnpm
Version published
Weekly downloads
9
50%
Maintainers
0
Weekly downloads
 
Created
Source

ChatGPT provider for Strapi Translate Plugin

Configure the provider through the pluginOptions:

module.exports = {
  // ...
  translate: {
    enabled: true,
    config: {
      // Choose one of the available providers
      provider: 'chatgpt',
      // Pass credentials and other options to the provider
      providerOptions: {
        // your API key - required and wil cause errors if not provided
        apiKey: 'sk-...',
        // use base path - default: 'https://api.openai.com/v1'
        basePath: 'https://api.openai.com/v1',
        // model - default: 'gpt-4o'
        model: 'gpt-4o', 
        // max tokens used per one translate operation - default: 1000 
        maxTokens: 1000,
        // use custom locale mapping (for example 'en' locale is deprecated so need to choose between 'EN-GB' and 'EN-US')
        localeMap: {
          // use uppercase here!
          EN: 'EN-US',
        },
          
      },
      // other options ...
    },
  },
  // ...
}

or use the default environment variables:

  • OPENAI_API_KEY - default undefined
  • OPENAI_MODEL - default gpt-4o
  • OPENAI_BASE_PATH - default https://api.openai.com/v1
  • OPENAI_MAX_TOKENS - default 1000

To get an API key, register for platform.openai.com/account/api-keys.

Limitations:

To be described

Keywords

strapi

FAQs

Package last updated on 10 Jan 2025

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