Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sorz/chatlibre
ChatGPT Translate for Mastodon. Enable ChatGPT API-powered translation on your Mastodon instance.
https://github.com/sorz/chatlibre
chatgpt mastodon translation
Last synced: about 2 months ago
JSON representation
ChatGPT Translate for Mastodon. Enable ChatGPT API-powered translation on your Mastodon instance.
- Host: GitHub
- URL: https://github.com/sorz/chatlibre
- Owner: sorz
- License: mit
- Created: 2023-07-05T14:58:16.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-10-16T23:45:11.000Z (3 months ago)
- Last Synced: 2024-10-19T00:03:17.260Z (3 months ago)
- Topics: chatgpt, mastodon, translation
- Language: Python
- Homepage:
- Size: 19.5 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ChatGPT Translate for Mastodon
Enable ChatGPT API-powered translation on your Mastodon instance!A lightweight scirpt that act as LibreTranslate service but chat with GPT to
get translation done.## Setup
Prerequisite: [openai-python](https://github.com/openai/openai-python)
Run the script:
```bash
export OPENAI_API_KEY=sk-xxxxxxxxxx
./chatlibre.py
```Update Mastodon [environment variables](https://docs.joinmastodon.org/admin/config/#libre_translate_endpoint):
```
LIBRE_TRANSLATE_ENDPOINT=http://localhost:8080
LIBRE_TRANSLATE_API_KEY=whatever
```(We don't check LibreTranslate API key, so this value doesn't matter)
Then restart your Mastodon web server.
## Run as systemd service
Clone this repo into `/opt/chatlibre`, then
```bash
cd /opt/chatlibre
cp systemd/* /etc/systemd/system/
echo sk-xxxxxxxxxx > openai_key
chmod og-r openai_key
```Edit `chatlibre.service` if you use path other than `/opt/chatlibre`.
Edit `chatlibre.socket` to change listen address and port number.
```bash
systemctl daemon-reload
systemctl enable --now chatlibre.socket
```