Skip to content

Commit

Permalink
docs: update README
Browse files Browse the repository at this point in the history
  • Loading branch information
tisfeng committed Jan 4, 2024
1 parent ecb83e5 commit a2a51f9
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 18 deletions.
35 changes: 26 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,10 @@
- [查询服务](#查询服务)
- [🍎 苹果系统词典](#-苹果系统词典)
- [OpenAI(ChatGPT)翻译](#openaichatgpt翻译)
- [配置 APIKey](#配置-apikey)
- [查询模式](#查询模式)
- [自定义设置](#自定义设置)
- [使用内置 Gemini key](#使用内置-gemini-key)
- [配置个人的 APIKey](#配置个人的-apikey)
- [OpenAI 查询模式](#openai-查询模式)
- [OpenAI 自定义参数](#openai-自定义参数)
- [DeepL 翻译](#deepl-翻译)
- [配置 AuthKey](#配置-authkey)
- [自定义 DeepL 接口地址](#自定义-deepl-接口地址)
Expand Down Expand Up @@ -343,11 +344,27 @@ Easydict 自动支持词典 App 中系统自带的词典,如牛津英汉汉英

### OpenAI(ChatGPT)翻译

1.3.0 版本开始支持 OpenAI 翻译,也支持 Azure OpenAI 接口,暂时还未写界面,需要在 Easydict 的输入框中使用如下命令方式配置
1.3.0 版本开始支持 OpenAI 翻译,也支持 Azure OpenAI 接口,需要使用 OpenAI API key

请先确保你有 APIKey。
如果你没有自己的 OpenAI APIKey,可以借助一些开源项目将第三方的 LLM 接口转为标准的 OpenAI 接口,这样就能直接在 `Easydict` 中使用了

#### 配置 APIKey
例如 [one-api](https://github.com/songquanpeng/one-api),one-api 是一个很好的 OpenAI 接口管理开源项目,支持多家 LLM 接口,包括 Azure、Anthropic Claude、Google PaLM 2 & Gemini、智谱 ChatGLM、百度文心一言、讯飞星火认知、阿里通义千问、360 智脑以及腾讯混元等,可用于二次分发管理 key,仅单可执行文件,已打包好 Docker 镜像,一键部署,开箱即用。

目前 GUI 方式配置 API key 功能还在开发中 [[#227](https://github.com/tisfeng/Easydict/issues/227)],暂时需要在 Easydict 的输入框中使用命令方式配置。

#### 使用内置 Gemini key

目前 Google 的 Gemini API 免费,实测下来翻译效果不错,由于项目对 Gemini 支持 [#270](https://github.com/tisfeng/Easydict/issues/270) 还在开发中,可能需要一点时间,因此我内置了一个 key,方便用户直接使用 Gemini 模型来翻译。但请注意,这个 key 有一定使用限制且不稳定,因此如果有能力部署 one-api,建议优先使用自己的 APIKey。

在 Beta 模式下,并且没有设置自己的 APIKey,这样就会自动使用内置的 Gemini key。

写入以下命令可开启 Beta 模式

```bash
easydict://writeKeyValue?EZBetaFeatureKey=1
```

#### 配置个人的 APIKey

```bash
easydict://writeKeyValue?EZOpenAIAPIKey=sk-xxx
Expand All @@ -363,7 +380,7 @@ easydict://writeKeyValue?EZOpenAIAPIKey=sk-xxx
easydict://readValueOfKey?EZOpenAIAPIKey
```

#### 查询模式
#### OpenAI 查询模式

目前 OpenAI 支持三种查询模式:单词,句子和长翻译,默认都是开启的,其中单词和句子也可关闭。

Expand Down Expand Up @@ -391,7 +408,7 @@ easydict://writeKeyValue?EZOpenAISentenceKey=0
<img width="475" alt="image" src="https://github.com/tisfeng/Easydict/assets/25194972/b8c2f0e3-a263-42fb-9cb0-efc68b8201c3">


#### 自定义设置
#### OpenAI 自定义参数

支持设置自定义域名和模型

Expand All @@ -402,7 +419,7 @@ easydict://writeKeyValue?EZOpenAIDomainKey=xxx
// xxx 是完整的请求地址,例如 https://api.ohmygpt.com/azure/v1/chat/completions
easydict://writeKeyValue?EZOpenAIEndPointKey=xxx

// xxx 默认是 gpt-3.5-turbo
// xxx 默认是 gpt-3.5-turbo-1106(目前最便宜实用的模型)
easydict://writeKeyValue?EZOpenAIModelKey=xxx
```

Expand Down
35 changes: 26 additions & 9 deletions README_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,10 @@ We plan to refactor the project with Swift. If you are interested in this open s
- [Translation Services](#translation-services)
- [🍎 Apple System Dictionary](#-apple-system-dictionary)
- [OpenAI (ChatGPT) Translation](#openai-chatgpt-translation)
- [Configure APIKey](#configure-apikey)
- [Query Mode](#query-mode)
- [Customizations](#customizations)
- [Use the built-in Gemini key](#use-the-built-in-gemini-key)
- [Configure Personal APIKey](#configure-personal-apikey)
- [OpenAI Query Mode](#openai-query-mode)
- [OpenAI Custom Settings](#openai-custom-settings)
- [DeepL Translate](#deepl-translate)
- [Configure AuthKey](#configure-authkey)
- [Configure API endpoint](#configure-api-endpoint)
Expand Down Expand Up @@ -341,11 +342,27 @@ For detailed information, please see [How to use macOS system dictionary in Easy

### OpenAI (ChatGPT) Translation

Version 1.3.0 starts to support OpenAI translation, also supports Azure OpenAI interface, the interface has not been written yet, you need to configure it in the input box of Easydict using the following command method.
Version 1.3.0 adds support for OpenAI translation, as well as Azure OpenAI interfaces, which require the use of OpenAI API keys.

Please make sure you have an APIKey.
If you don't have your own OpenAI APIKey, you can use some open source projects to convert third-party LLM interfaces into standard OpenAI interfaces, so that you can use them directly in `Easydict`.

#### Configure APIKey
For example, [one-api](https://github.com/songquanpeng/one-api), one-api is a good open source project for OpenAI interface management, which supports multiple LLM interfaces, including Azure, Anthropic Claude, Google PaLM 2 & Gemini, Zhupu ChatGLM, Baidu Wenxin Yiyu, Xunfei Xinghuo cognition, Ali Tongyi Qianwen, 360 Zhinao and Tencent Hunyuan, etc., which can be used for secondary distribution management key, only single executable file, Docker image has been packaged, one-click deployment, out of the box.

Currently, the GUI method of configuring API key is still under development [#227](https://github.com/tisfeng/Easydict/issues/227), so you need to configure it in the input box of Easydict in command mode for the time being.

#### Use the built-in Gemini key

Currently, Google's Gemini API is free, and the translation effect is good. Since the project's support for Gemini [#270](https://github.com/tisfeng/Easydict/issues/270), it may take some time, so I have built in a key to facilitate users to use the Gemini model directly for translation. However, please note that this key has certain usage restrictions and is unstable, so if you have the ability to deploy one-api, it is recommended to use your own APIKey first.

In Beta mode, and no APIKey is set, so the built-in Gemini key will be used automatically.

Write the following command to enable Beta mode

```bash
easydict://writeKeyValue?EZBetaFeatureKey=1
```

#### Configure Personal APIKey

```bash
easydict://writeKeyValue?EZOpenAIAPIKey=sk-xxx
Expand All @@ -361,7 +378,7 @@ Lookup for APIKey (similar to other keys), if the query succeeds, the result wil
easydict://readValueOfKey?EZOpenAIAPIKey
```

#### Query Mode
#### OpenAI Query Mode

Currently, OpenAI translation supports three query modes: word lookup, sentence translation, and long-text translation. They are all enabled by default, while words and sentences can be disabled.

Expand Down Expand Up @@ -389,7 +406,7 @@ A quick tip: If you only want to exclude occasional sentence analysis without tu
<img width="475" alt="image" src="https://github.com/tisfeng/Easydict/assets/25194972/b8c2f0e3-a263-42fb-9cb0-efc68b8201c3">


#### Customizations
#### OpenAI Custom Settings

Support custom domains and models

Expand All @@ -400,7 +417,7 @@ easydict://writeKeyValue?EZOpenAIDomainKey=xxx
// xxx is the complete address of the request; for example, https://api.ohmygpt.com/azure/v1/chat/completions
easydict://writeKeyValue?EZOpenAIEndPointKey=xxx

// xxx is set to default as gpt-3.5-turbo
// xxx is set to default as gpt-3.5-turbo-1106 (currently the cheapest and most practical model)
easydict://writeKeyValue?EZOpenAIModelKey=xxx
```

Expand Down

0 comments on commit a2a51f9

Please sign in to comment.