Skip to content

Commit

Permalink
Merge branch 'main' into feat/farsi_translation
Browse files Browse the repository at this point in the history
  • Loading branch information
n3d1117 committed Apr 27, 2023
2 parents c98bf07 + 656f9c2 commit 5da46d8
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 25 deletions.
48 changes: 24 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ A [Telegram bot](https://core.telegram.org/bots/api) that integrates with OpenAI
- [x] (NEW!) GPT-4 support
- If you have access to the GPT-4 API, simply change the `OPENAI_MODEL` parameter to `gpt-4`
- [x] (NEW!) Localized bot language
- Available languages :gb: :de: :ru: :tr: :it: :es: :indonesia: :netherlands: :cn: :vietnam: :iran:
- Available languages :gb: :de: :ru: :tr: :it: :es: :indonesia: :netherlands: :cn: :taiwan: :vietnam: :iran:
- [x] (NEW!) Improved inline queries support for group and private chats - by [@bugfloyd](https://github.com/bugfloyd)
- To use this feature, enable inline queries for your bot in BotFather via the `/setinline` [command](https://core.telegram.org/bots/inline)

Expand Down Expand Up @@ -68,29 +68,29 @@ The following parameters are optional and can be set in the `.env` file:
Check out the [Budget Manual](https://github.com/n3d1117/chatgpt-telegram-bot/discussions/184) for possible budget configurations.

#### Additional optional configuration options
| Parameter | Description | Default value |
|------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------|
| `ENABLE_QUOTING` | Whether to enable message quoting in private chats | `true` |
| `ENABLE_IMAGE_GENERATION` | Whether to enable image generation via the `/image` command | `true` |
| `ENABLE_TRANSCRIPTION` | Whether to enable transcriptions of audio and video messages | `true` |
| `PROXY` | Proxy to be used for OpenAI and Telegram bot (e.g. `http://localhost:8080`) | - |
| `OPENAI_MODEL` | The OpenAI model to use for generating responses | `gpt-3.5-turbo` |
| `ASSISTANT_PROMPT` | A system message that sets the tone and controls the behavior of the assistant | `You are a helpful assistant.` |
| `SHOW_USAGE` | Whether to show OpenAI token usage information after each response | `false` |
| `STREAM` | Whether to stream responses. **Note**: incompatible, if enabled, with `N_CHOICES` higher than 1 | `true` |
| `MAX_TOKENS` | Upper bound on how many tokens the ChatGPT API will return | `1200` for GPT-3, `2400` for GPT-4 |
| `MAX_HISTORY_SIZE` | Max number of messages to keep in memory, after which the conversation will be summarised to avoid excessive token usage | `15` |
| `MAX_CONVERSATION_AGE_MINUTES` | Maximum number of minutes a conversation should live since the last message, after which the conversation will be reset | `180` |
| `VOICE_REPLY_WITH_TRANSCRIPT_ONLY` | Whether to answer to voice messages with the transcript only or with a ChatGPT response of the transcript | `false` |
| `VOICE_REPLY_PROMPTS` | A semicolon separated list of phrases (i.e. `Hi bot;Hello chat`). If the transcript starts with any of them, it will be treated as a prompt even if `VOICE_REPLY_WITH_TRANSCRIPT_ONLY` is set to `true` | - |
| `N_CHOICES` | Number of answers to generate for each input message. **Note**: setting this to a number higher than 1 will not work properly if `STREAM` is enabled | `1` |
| `TEMPERATURE` | Number between 0 and 2. Higher values will make the output more random | `1.0` |
| `PRESENCE_PENALTY` | Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far | `0.0` |
| `FREQUENCY_PENALTY` | Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far | `0.0` |
| `IMAGE_SIZE` | The DALL·E generated image size. Allowed values: `256x256`, `512x512` or `1024x1024` | `512x512` |
| `GROUP_TRIGGER_KEYWORD` | If set, the bot in group chats will only respond to messages that start with this keyword | - |
| `IGNORE_GROUP_TRANSCRIPTIONS` | If set to true, the bot will not process transcriptions in group chats | `true` |
| `BOT_LANGUAGE` | Language of general bot messages. Currently available: `en`, `de`, `ru`, `tr`, `it`, `es`, `id`, `nl`, `cn`, `vi`, `fa`. [Contribute with additional translations](https://github.com/n3d1117/chatgpt-telegram-bot/discussions/219) | `en` |
| Parameter | Description | Default value |
|------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------|
| `ENABLE_QUOTING` | Whether to enable message quoting in private chats | `true` |
| `ENABLE_IMAGE_GENERATION` | Whether to enable image generation via the `/image` command | `true` |
| `ENABLE_TRANSCRIPTION` | Whether to enable transcriptions of audio and video messages | `true` |
| `PROXY` | Proxy to be used for OpenAI and Telegram bot (e.g. `http://localhost:8080`) | - |
| `OPENAI_MODEL` | The OpenAI model to use for generating responses | `gpt-3.5-turbo` |
| `ASSISTANT_PROMPT` | A system message that sets the tone and controls the behavior of the assistant | `You are a helpful assistant.` |
| `SHOW_USAGE` | Whether to show OpenAI token usage information after each response | `false` |
| `STREAM` | Whether to stream responses. **Note**: incompatible, if enabled, with `N_CHOICES` higher than 1 | `true` |
| `MAX_TOKENS` | Upper bound on how many tokens the ChatGPT API will return | `1200` for GPT-3, `2400` for GPT-4 |
| `MAX_HISTORY_SIZE` | Max number of messages to keep in memory, after which the conversation will be summarised to avoid excessive token usage | `15` |
| `MAX_CONVERSATION_AGE_MINUTES` | Maximum number of minutes a conversation should live since the last message, after which the conversation will be reset | `180` |
| `VOICE_REPLY_WITH_TRANSCRIPT_ONLY` | Whether to answer to voice messages with the transcript only or with a ChatGPT response of the transcript | `false` |
| `VOICE_REPLY_PROMPTS` | A semicolon separated list of phrases (i.e. `Hi bot;Hello chat`). If the transcript starts with any of them, it will be treated as a prompt even if `VOICE_REPLY_WITH_TRANSCRIPT_ONLY` is set to `true` | - |
| `N_CHOICES` | Number of answers to generate for each input message. **Note**: setting this to a number higher than 1 will not work properly if `STREAM` is enabled | `1` |
| `TEMPERATURE` | Number between 0 and 2. Higher values will make the output more random | `1.0` |
| `PRESENCE_PENALTY` | Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far | `0.0` |
| `FREQUENCY_PENALTY` | Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far | `0.0` |
| `IMAGE_SIZE` | The DALL·E generated image size. Allowed values: `256x256`, `512x512` or `1024x1024` | `512x512` |
| `GROUP_TRIGGER_KEYWORD` | If set, the bot in group chats will only respond to messages that start with this keyword | - |
| `IGNORE_GROUP_TRANSCRIPTIONS` | If set to true, the bot will not process transcriptions in group chats | `true` |
| `BOT_LANGUAGE` | Language of general bot messages. Currently available: `en`, `de`, `ru`, `tr`, `it`, `es`, `id`, `nl`, `zh-cn`, `zh-tw`, `vi`, `fa`. [Contribute with additional translations](https://github.com/n3d1117/chatgpt-telegram-bot/discussions/219) | `en` |

Check out the [official API reference](https://platform.openai.com/docs/api-reference/chat) for more details.

Expand Down
44 changes: 43 additions & 1 deletion translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@
"ask_chatgpt":"Vraag ChatGPT",
"loading":"Laden..."
},
"cn": {
"zh-cn": {
"help_description":"显示帮助信息",
"reset_description":"重置对话。可以选择传递高级指令(例如/reset 你是一个有用的助手)",
"image_description":"根据提示生成图像(例如/image 猫)",
Expand Down Expand Up @@ -377,6 +377,48 @@
"ask_chatgpt":"询问ChatGPT",
"loading":"载入中..."
},
"zh-tw": {
"help_description":"顯示幫助訊息",
"reset_description":"重置對話。可以選擇傳遞高級指示(例如 /reset 你是一個樂於助人的助手)",
"image_description":"根據提示生成圖像(例如 /image 貓)",
"stats_description":"取得當前使用統計",
"resend_description":"重發最後一個訊息",
"chat_description":"與機器人聊天!",
"disallowed":"抱歉,您不允許使用此機器人。查看原始碼:https://github.com/n3d1117/chatgpt-telegram-bot",
"budget_limit":"抱歉,已達到用量上限。",
"help_text":["我是一個 ChatGPT 機器人,跟我聊天吧!", "傳送語音訊息或檔案給我,我會為您進行轉錄", "開放原始碼:https://github.com/n3d1117/chatgpt-telegram-bot"],
"stats_conversation":["當前對話", "聊天訊息記錄", "聊天 Token 記錄"],
"usage_today":"今日用量",
"usage_month":"本月用量",
"stats_tokens":"Token 已使用",
"stats_images":"圖像已生成",
"stats_transcribe":["", "秒已轉錄"],
"stats_total":"💰 總計金額 $",
"stats_budget":"剩餘預算",
"monthly":"本月",
"daily":"今日",
"all-time":"",
"stats_openai":"本月您的 OpenAI 帳戶總共計費 $",
"resend_failed":"沒有訊息可以重發",
"reset_done":"重置完成!",
"image_no_prompt":"請輸入提示!(例如 /image 貓)",
"image_fail":"無法生成圖像",
"media_download_fail":["無法下載音效檔案", "請確保檔案大小不超過 20MB"],
"media_type_fail":"不支援的檔案類型",
"transcript":"轉錄",
"answer":"回答",
"transcribe_fail":"無法轉錄文字",
"chat_fail":"無法取得回應",
"prompt":"提示",
"completion":"填充",
"openai_rate_limit":"OpenAI 請求超出限制",
"openai_invalid":"OpenAI 無效請求",
"error":"發生錯誤",
"try_again":"請稍後重試",
"answer_with_chatgpt":"使用 ChatGPT 回答",
"ask_chatgpt":"詢問 ChatGPT",
"loading":"載入中…"
},
"vi": {
"help_description":"Hiển thị trợ giúp",
"reset_description":"Đặt lại cuộc trò chuyện. Tùy ý chuyển hướng dẫn cấp cao (ví dụ: /reset Bạn là một trợ lý hữu ích)",
Expand Down

0 comments on commit 5da46d8

Please sign in to comment.