1.0.4 • Published 10 months ago

strapi-provider-translate-openai-gpt v1.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

OpenAI translation provider for Strapi Translate Plugin

Configure the OpenAi provider through the pluginOptions:

module.exports = {
  // ...
  translate: {
    enabled: true,
    config: {
      // Add the name of your provider
      provider: 'openai-gpt',
      providerOptions: {
        // your API key
        apiKey: 'sk-YOUR_API_KEY',
        // model - default: 'gpt-4o'
        model: 'gpt-4o',
        // max tokens used per one translate operation - default: 4096
        maxTokens: 4096,
        // additional system prompt for the translation - default: none.
        generalPrompt: 'Do not translate paths, slugs, etc.',
      },
      // Which field types are translated (default string, text, richtext, components and dynamiczones)
      // Either string or object with type and format
      // Possible formats: plain, markdown, html (default plain)
      translatedFieldTypes: [
        'string',
        { type: 'text', format: 'plain' },
        { type: 'richtext', format: 'markdown' },
        'component',
        'dynamiczone',
      ],
      // If relations should be translated (default true)
      translateRelations: true,
    },
  },
  // ...
}

or use environment variables:

  • OPENAI_API_KEY - default undefined
  • OPENAI_MODEL - default gpt-4o
  • OPENAI_MAX_TOKENS - default 1000
  • OPENAI_GENERAL_PROMPT - default none
1.0.4

10 months ago

1.0.3

10 months ago

1.0.2

10 months ago

1.0.1

10 months ago

1.0.0

10 months ago