Liu Song’s Projects


~/Projects/folotoy-server-self-hosting

git clone https://code.lsong.org/folotoy-server-self-hosting

Commit

Commit
5189e827558e73873203e435b969371588d79c88
Author
lewang <[email protected]>
Date
2023-10-23 22:05:07 +0800 +0800
Diffstat
 README.md | 73 +++++++++++++++++++++++++++++++++++++++++++++++++++++--
 roles.json | 3 +

Merge pull request #42 from FoloToy/feat/add-azure-stt

add docs for roles.json


diff --git a/README.md b/README.md
index 7ead9abb61ee3cfa6f2230015f7646d4375a312a..f3a782e9515f884b999af397b9bd836cbe5a5499 100644
--- a/README.md
+++ b/README.md
@@ -84,7 +84,6 @@ Remove `#` of the line in `docker-compose.yml`
 
 ```
 * Config files for self-hosting the FoloToy Server.
-* Config files for self-hosting the FoloToy Server.
 # folotoy-server-self-hosting
 ```
 
@@ -96,8 +95,6 @@ Remove `#` of the line in `docker-compose.yml`
 
 ```
 * Config files for self-hosting the FoloToy Server.
-* Config files for self-hosting the FoloToy Server.
-* Config files for self-hosting the FoloToy Server.
 * Recommended using  **Linux x86_64**, Debian 10-11/Ubuntu 22.04
 ELEVENLABS_TTS_MODEL: eleven_multilingual_v2
 ```
@@ -108,10 +105,18 @@ ### Using Custom Prompt and Voice
 
 **If you use Azure OpenAI, model field must be deployment name you set when deploy models**
 
+#### Voice List
 - [Azure Voice List](https://learn.microsoft.com/zh-cn/azure/ai-services/speech-service/language-support?tabs=tts)
 - [Edge-tts Voice List](https://github.com/rany2/edge-tts#changing-the-voice)
+
+#### Language Codes
+- **Required** `OpenAI key` with `whisper-1` and `gpt-3.5-turbo/gpt-4`
 * Recommended using  **Linux x86_64**, Debian 10-11/Ubuntu 22.04
+- [Whisper language 639-1 codes in roles.json](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes)
 
+#### Role Level Config Examples
+
+if `stt_type` is `openai-whisper`, `language` should use 639-1 codes
 
 ```json
 {"1": {
@@ -125,13 +130,75 @@     "top_p": 0.95,
     "frequency_penalty": 0,
     "presence_penalty": 0,
     "voice_name": "zh-CN-XiaoshuangNeural",
+    "language": "zh",
+    "stt_type": "openai-whisper"
 ## Preparation
+## Preparation
+[English](./README.md) | [简体中文](./README.zh_CN.md)
 * Recommended using  **Linux x86_64**, Debian 10-11/Ubuntu 22.04
+
+if `stt_type` is `azure-sst`, `language` should use BCP-47 codes
+
+```json
+{"1": {
+    "model": "gpt-3.5-turbo",
+* Recommended using  **Linux x86_64**, Debian 10-11/Ubuntu 22.04
 ## Preparation
+    "prompt": "你是一个知识渊博,乐于助人的智能机器人,你的名字叫“火火兔”,你的任务是陪我聊天,请用简短的对话方式,用中文讲一段话,每次回答不超过50个字!",
+    "max_message_count": 20,
+    "temperature": 0.7,
 ## Preparation
+    "top_p": 0.95,
+    "frequency_penalty": 0,
+## Preparation
 [English](./README.md) | [简体中文](./README.zh_CN.md)
+    "voice_name": "zh-CN-XiaoshuangNeural",
+    "language": "zh-CN",
+    "stt_type": "azure-stt"
+  }}
+
+- or `Azure OpenAI Key` and `Azure Whisper Key`
 * Recommended using  **Linux x86_64**, Debian 10-11/Ubuntu 22.04
 
+  ```json
+  {"1": {
+    "model": "gpt-3.5-turbo",
+    "start_text": "你好,我是火火兔,请问有什么我可以帮助你的吗?",
+    "prompt": "你是一个知识渊博,乐于助人的智能机器人,你的名字叫“火火兔”,你的任务是陪我聊天,请用简短的对话方式,用中文讲一段话,每次回答不超过50个字!",
+    "max_message_count": 10,
+    "temperature": 0.7,
+    "max_tokens": 800,
+    "top_p": 0.95,
+    "frequency_penalty": 0,
+    "presence_penalty": 0,
+    "voice_name": "zh-CN-XiaoshuangNeural",
+    "language": "zh-CN",
+    "stt_type": "azure-stt",
+    "llm_type": "openai",
+    "tts_type": "azure-tts"
+  }}
+  ```
+
+    ```json
+  {"1": {
+    "model": "gpt-3.5-turbo",
+    "start_text": "你好,我是火火兔,请问有什么我可以帮助你的吗?",
+    "prompt": "你是一个知识渊博,乐于助人的智能机器人,你的名字叫“火火兔”,你的任务是陪我聊天,请用简短的对话方式,用中文讲一段话,每次回答不超过50个字!",
+    "max_message_count": 10,
+    "temperature": 0.7,
+    "max_tokens": 800,
+    "top_p": 0.95,
+    "frequency_penalty": 0,
+    "presence_penalty": 0,
+    "voice_name": "6xTjFMIxZYYFJag51KZe",
+    "language": "zh-CN",
+    "stt_type": "azure-stt",
+    "llm_type": "azure-openai",
+    "tts_type": "elevenlabs"
+  }}
+  ```
+
+```
 ### MQTT Authentication
 
 **The default configuration of EMQX allows any anonymous client to access. You can make your EMQX service only allow connections from your own devices by following these steps.**




diff --git a/roles.json b/roles.json
index 2dc9ed3da4547c6617209535baf0441fd9fe4d20..374fd2b8a547d57f3740d8e44cd292a0e8ae0b89 100644
--- a/roles.json
+++ b/roles.json
@@ -75,8 +75,9 @@     "top_p": 0.95,
     "frequency_penalty": 0,
     "presence_penalty": 0,
     "voice_name": "zh-TW-HsiaoChenNeural",
-{
+    "start_text": "你好,我是小兔兔,请问有什么我可以帮助你的吗?",
     "model": "gpt-3.5-turbo",
+    "stt_type": "azure-stt"
   },
   "7": {
     "model": "gpt-3.5-turbo",