Releases: tcpipuk/maubot-openai-translate
v0.3.1
OpenAI Translate Maubot Plugin v0.3.1
This is quite a minor maintenance release as it seems to be working very well as is.
I've tidied up the code a bit with some linting, and switched the default model from gpt-3.5-turbo
to gpt-4o-mini
- in testing this has not only proven much cheaper, but the translations are faster and more natural, so win-win!
I've also changed the plugin name from xyz.maubot.openaitranslate
to uk.tcpip.openaitranslate
because I mistakenly used Maubot's domain when creating the project and it's always bugged me.
v0.3.0
OpenAI Translate Maubot Plugin v0.3.0
Another big one!
Custom Language Codes
I've relocated "custom" language codes to Maubot's config manager, so now you can add custom languages like this:
languages:
replace_list: false
codes:
en-cockney: Cockney English
en-pirate: Pirate English
en-scouse: Scouse English
lotr-sindarin: Sindarin (Tolkien)
By toggling replace_list: true
you can completely replace the built-in list with your custom one, otherwise the changes will be merged into the full list, letting you add or replace existing ones as needed.
Custom API Endpoints
I'm hoping to support more APIs in the future, but for now, you can set the custom_endpoint
config entry to an alternative API you want to use that supports the OpenAI Chat Completions API standard. If you leave the field blank, it'll default to the official one, which is currently https://api.openai.com/v1/chat/completions
.
You should find when you install this update that your config is automatically updated with the new options without affecting the old ones. Please file an issue if you have any problems!
v0.2.4
v0.2.3
v0.2.2
v0.2.1
OpenAI Translate Maubot Plugin v0.2.1
I've added a minor release including a number of IETF language codes (e.g. en-gb
, fr-ca
, pt-br
) to make it easier to select specific regional variants of languages.
This is not an exhaustive list, but hopefully acts as a demonstration that can be expanded in the future.
v0.2.0
OpenAI Translate Maubot Plugin v0.2.0
Now added customisable rate limits and error messages!
By default, we use a rate limit of 5 translations per 3600 seconds (or 1 hour) so any user requesting more than that should get an error message instead.
You can set the rate limit window in seconds, so you could just as easily set 1 per 30 seconds, or 20 per 86400 seconds (or 24 hours).
For error messages, you can set the message for rate limit failures, an empty/non-existent message, or an unknown 2-letter language code - for the latter two, you can use {language_code}
to include the language code the user provided, like this:
bot.empty_message
:I didn't see a message: try replying to one using '!tr {language_code}'
bot.unknown_message
:I don't recognise language '{language_code}', sorry!
As per usual, just add the plugin in Maubot, set up an instance with your preferred client, then fill out the config options including your OpenAI API key.
Note: OpenAI's API costs money. Make sure to set a spending limit in your OpenAI account, and monitor usage to avoid any surprises!
v0.1.0
OpenAI Translate Maubot Plugin v0.1.0
This is a (fairly) simple Maubot plugin that uses OpenAI's GPT models to provide quick and accurate translations in a more natural style than traditional translation services.
Currently we support:
- Direct Translation: Use
!tr <language_code> <message>
to translate a specific message.- Example:
!tr fr Hello World
will translate "Hello World" into French.
- Example:
- Reply Translation: Reply to an existing message with
!tr <language_code>
, and the bot will reply to the same message in the chosen language.- Example: Replying with
!tr de
to a message will translate it into German.
- Example: Replying with
It supports most ISO 639-1 codes for languages, but the languages.py can be updated with extra languages that OpenAI might recognise if needed.
Just add the plugin in Maubot, set up an instance with your preferred client, then fill out the config options including your OpenAI API key.