strapi-provider-translate-chatgpt

1.0.5 • Public • Published

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: 'text-davinci-003'
        model: 'text-davinci-003', 
        // 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 text-davinci-003
  • 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

Package Sidebar

Install

npm i strapi-provider-translate-chatgpt

Weekly Downloads

0

Version

1.0.5

License

ISC

Unpacked Size

53.6 kB

Total Files

40

Last publish

Collaborators

  • braunmann