Welcome to ROSMASTER M3 repository
02.Configuring API-KEY
Configure API-KEY
Configure API-KEY1. Course Content2. Start the Dify Service3. Configure Model Service Provider API-KEY4. Testing the API Key5. Configuring the multi_brains API Package5.1 International Users6. Using Local Speech Services(Orin)6.1 Local Speech Recognition6.2 Local Speech Synthesis7. Modifying the Dify Service API
1. Course Content
- Configure the robot's in-vehicle API-KEY using the previously registered API-KEY
[!WARNING]
Note: Please ensure the in-vehicle system is connected to the internet to use the cloud-based model services.
2. Start the Dify Service
[!TIP]
ROSMASTER-M3 uses Dify to build a multi-agent system, with Dify centrally managing the access to cloud-based models.
- Connect to the vehicle's infotainment system via VNC or SSH. Enter the following command in the terminal:
bringup_dify

- View the vehicle's infotainment system's IP address. This can be done via the OLED screen or in the terminal using
ifconfig.

- Directly enter the vehicle's infotainment system's IP address in your browser's address bar to access the Dify management page. If this is the first time logging in, a username and password are required. You can select the language in the upper left corner.
[!NOTE]
- Username:
yahboom@163.com- Password:
yahboom123- All account passwords, agent applications, and RAG data are stored locally.
- After logging in, see the image below.

3. Configure Model Service Provider API-KEY
- Click Settings

- Here, we take configuring the API for Alibaba Cloud Model Studio Platform account as an example. Click Model Provider -> Setup

- Enter your Alibaba Cloud Model Studio Platform's API-KEY, then select whether it is an international Endpoint, and click Save.

4. Testing the API Key
[!TIP]
- If you need to test whether the API key is available, you can refer to this section of the tutorial. If not, you can ignore this step.
- Click the TEST_API application in the studio.

- Then, select any model from the model selection menu to test.

- Enter any content in the chat box. If the registered API-KEY is valid, you will be able to see the model's reply.

5. Configuring the multi_brains API Package
5.1 International Users
- Generate parameter file, terminal execution command
xxxxxxxxxxcd ~/yahboomM3_ws/user_ws/src/m3_bringup/config/multi_brainscp .multi_brains_setting_example_en.yaml multi_brains_setting.yaml
- If you subsequently use Alibaba Cloud's speech synthesis service to generate a custom speech file, please apply for an Alibaba International Station API-KEY and fill in
ALIYUN_API_KEY. This will not affect normal use; you can ignore it if you don't need it.

6. Using Local Speech Services(Orin)
[!TIP]
By default, online speech services are used for speech recognition and synthesis. If you need to use local speech services, refer to this section of the tutorial. If you do not need to use a local speech model, you can skip this section.
6.1 Local Speech Recognition
xxxxxxxxxxnano ~/yahboomM3_ws/user_ws/src/m3_bringup/config/multi_brains/multi_brains_setting.yaml
- Locate the
USE_OLINE_ASRoption in theASR function settingsection and set it to False. Save and exit (Ctrl+X) to apply the changes to local speech recognition. - Other parameters are used to configure the recording process. See the comments for details on their functions. Beginners can use the default settings.
xxxxxxxxxx#####################ASR function setting#语音识别功能设置####################USE_OLINE_ASR False # Whether to use online ASRASR_SUPPLIER 'xunfei' #ASR Supplier (only effective when using online ASR): Chinese mainland: aliyun International: xunfei OLINE_ASR_MODEL 'paraformer-realtime-v2'ASR_THREASHOLD 3 # ASR recognition result threshold, unit: characters WAKEUP_THREASHOLD 5.0 # Wake-up time threshold, to prevent multiple wake-ups within WAKEUP_THREASHOLD time, unit: secondsVAD_MODE1 #vad灵敏度 VAD sensitivityMAX_SILENCE_FRAMES90 #尾音时长检测,单位:帧数 Tail sound duration detection, unit: frames
6.2 Local Speech Synthesis
xxxxxxxxxxnano ~/yahboomM3_ws/user_ws/src/m3_bringup/config/multi_brains/multi_brains_setting.yaml
- Locate the
USE_OLINE_TTSoption in theTS function settingsection and set it to False. Press Ctrl+X to save and exit for the changes to take effect for local speech synthesis.
xxxxxxxxxx#####################TTS function setting#语音合成功能设置####################USE_OLINE_TTS False #Whether to use online TTS.... 7. Modifying the Dify Service API
- Note: This section is for reference only for users with development needs. Generally, this section can be ignored and will not affect normal use.
- If you need to modify the API for accessing the Dify application from the vehicle's infotainment system later, or if Dify is deployed on other servers, you will need to modify the address accessed by the vehicle's infotainment system. Open the parameter configuration file:
xxxxxxxxxxnano ~/yahboomM3_ws/user_ws/src/m3_bringup/config/multi_brains/multi_brains_setting.yaml
- Locate the
DIFY_API_KEYandDIFY_BASE_URLparameters, where: DIFY_BASE_URLis the address for accessing the Dify backend service.DIFYAPI_KEYis the API key for AI applications in Dify.
xxxxxxxxxx##################### dify setting# dify配置选项####################DIFY_BASE_URL"http://localhost/v1"DIFY_API_KEY"app-mhawRyoHteauIho7wvXhlhwR" #dify applies API_KEY