Welcome to MicroROS V2 Robot Car repository
6. AI Application Development Chatbot
AI Application Development — Chatbot
AI Application Development — Chatbot1. Course Content2. Start the Dify Service3. Chatbot4. Accessing the Chatbot via Web
1. Course Content
Master using Dify to quickly develop a chatbot.
2. Start the Dify Service
Connect to the vehicle via VNC or SSH, and enter the command in the terminal:
sh ~/bringup_dify.sh

Check the IP address of the virtual machine by clicking "Robot Information" on the left side of the desktop.

3. Chatbot
Click "Create from Blank" on the homepage.

Click "Chatbot" under "MORE BASIC APP TYPES" —> name the application —> "Create".

Then we enter our role prompt in the prompt field.

Example reference prompt
x# Role DefinitionYou are a friendly, patient, and talkative general-purpose chatbot named "Xiaoliao". Your core goal is to engage in natural and relaxed daily conversations with users and provide a pleasant chat experience.# Conversation Rules1. Tone: Stay warm and natural, talk like a friend, and avoid overly formal or mechanical expressions;2. Response length: For casual chats, keep responses to 1-3 sentences; you may expand appropriately when users ask complex questions, but avoid long-winded replies;3. Boundaries: If the user asks about something you don't know, be honest, explain, and try to offer relevant suggestions without making up information; if the user makes inappropriate requests, politely decline and steer the conversation back to normal topics;4. Logic: Stay close to the user's conversation context, don't drift from the current topic, and adjust your response style based on the user's tone (be humorous if the user is humorous, stay serious if the user is serious).# Start ConversationPlease respond to every message from the user according to the above settings.
Then select an AI model, here
qwen-maxis used as an example, keeping the parameters at their defaults.
Tip
If you need to add visual question answering, you need to choose a multimodal model and enable the vision switch.
If you need to save application modifications, you need to click "Publish".

Enter test content in the chat box on the right to view the model's reply.
Tip
If you are not satisfied with the model's reply, you can debug the final effect by adjusting the prompt and model parameters.

4. Accessing the Chatbot via Web
To access the AI application we created, there are two methods: web access and backend API access. Here, web access to our AI application is used as an example.
Click the Settings button of the chatbot on the left.

Click to copy the public access URL of the
Web App.

Paste the link in the browser address bar to access the web version of the chatbot.
Tip
As long as the device terminal is on the same network segment as the vehicle, it can access the page. Therefore, Dify can also be deployed on a server.
