1.0.48 • Published 1 year ago

strapi-provider-translate-openai v1.0.48

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago

OpenAI provider for Strapi Translate Plugin

Configure the provider through the pluginOptions:

Only for translate plain text and EditorJS.

module.exports = {
  // ...
  translate: {
    enabled: true,
    config: {
      // Choose one of the available providers
      provider: 'openai',
      // Pass credentials and other options to the provider
      providerOptions: {
        // your API key - required and wil cause errors if not provided
        apiKey: 'sk-...',
        // 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_MAX_TOKENS - default 1000

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

Limitations:

To be described

1.0.48

1 year ago

1.0.47

1 year ago

1.0.46

1 year ago

1.0.45

1 year ago

1.0.44

1 year ago

1.0.43

1 year ago

1.0.42

1 year ago

1.0.41

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago