strapi-provider-translate-openai
v1.0.48
Published
OpenAI provider for translate plugin in Strapi 4
Downloads
33
Maintainers
Readme
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
- defaultundefined
OPENAI_MODEL
- defaultgpt-4o
OPENAI_MAX_TOKENS
- default1000
To get an API key, register for platform.openai.com/account/api-keys.
Limitations:
To be described