Welcome to ROSMASTER M3 repository
05.AI Large Model Development - chatbot
AI Application Development - Chatbot
AI Application Development - Chatbot1. Course Content2. Starting the Dify Service3. Chatbot4. Accessing the Chatbot via Web
1. Course Content
- Master the use of Dify to quickly develop a chatbot
2. Starting the Dify Service
- Connect to the vehicle's computer via VNC or SSH, and enter the following command in the terminal:
xxxxxxxxxxbringup_dify

- Check the vehicle's IP address (you can view it on the OLED screen, using
ifconfig, or directly in the terminal). Enter the vehicle's IP address directly in the browser's address bar to access the Dify management page.

3. Chatbot
- On the homepage, click "Create from Blank".

- Click to select "Chat Assistant" in the "Beginner-friendly" Chatbot -> App Name & Icon-> Create.

- Then, we enter our role prompt in the "INSTRUCTIONS"

- Example prompt:
x# Role DefinitionYou are a friendly, patient, and talkative general-purpose chatbot named "Yahboom". Your core goal is to engage in natural and relaxed daily conversations with users, providing them with a pleasant conversational experience.# Conversation Rules1. Tone: Maintain a friendly and natural tone, like talking to a friend, avoiding overly formal or mechanical expressions;2. Response Length: For casual conversations, keep responses to 1-3 sentences. For complex questions from the user, you may elaborate, but avoid lengthy responses;3. Boundaries: If the user asks about something you don't know, honestly state that you don't know and try to offer relevant suggestions, without fabricating information; if the user makes an inappropriate request, politely decline and guide the conversation back to a normal topic;4. Logic: Follow the user's conversation context, stay on topic, and adjust your response style based on the user's tone (match humor with humor, maintain seriousness when the user is serious).# Start ConversationPlease respond to each of the user's messages according to the settings above.
- Then select the AI model; here,
qwen-maxis used as an example, and the parameters remain at their default settings.
[!TIP]
- If you need to add visual question answering functionality, you need to select a multimodal model and enable the visual switch.
- If you need to save the application modifications, you need to click Publish.

- Enter the test content in the chat box on the right to view the model's response.
[!TIP]
- If you are not satisfied with the model's response, you can adjust the prompt and model parameters to fine-tune the final result.

4. Accessing the Chatbot via Web
- To access the AI application we created, there are two methods: web access and backend API access. Here, we will use web access as an example.
- Click the settings button for the chatbot on the left.

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

- Paste the link into your browser's address bar to access the chatbot's web interface.
[!TIP]
- As long as the device is on the same network segment as the vehicle's infotainment system, you can access the page. Therefore, Dify can also be deployed on a server.
