Skip to content

Releases: tcpipuk/maubot-openai-translate

v0.3.1

30 Aug 13:29
9dd5315
Compare
Choose a tag to compare

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

22 Dec 15:01
Compare
Choose a tag to compare

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

21 Dec 19:00
Compare
Choose a tag to compare

OpenAI Translate Maubot Plugin v0.2.4

Just when I thought I was safe, triangularowl in TWIM requested Liverpudlian, so that has been added as en-scouse even though there is no RFC for it.

v0.2.3

21 Dec 18:32
Compare
Choose a tag to compare

OpenAI Translate Maubot Plugin v0.2.3

By popular demand in the This Week in Matrix (TWIM) room, we now support en-cockney for Cockney, as defined in RFC1766 by Harald Alvestrand.

v0.2.2

21 Dec 15:36
Compare
Choose a tag to compare

OpenAI Translate Maubot Plugin v0.2.2

As a special treat for MTRNord, I've added nds for "Low German (Plattdütsch)" as a language option!

v0.2.1

19 Dec 22:38
b823819
Compare
Choose a tag to compare

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

19 Dec 20:39
68cf072
Compare
Choose a tag to compare

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

17 Dec 01:31
494c853
Compare
Choose a tag to compare

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.
  • 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.

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.

Note: OpenAI's API costs money. Make sure to set a spending limit in your OpenAI account, and monitor usage to avoid any surprises!