Welcome to DOFBOT-Ultra repository
5. AI Large Model Development - chatbot
AI Application Development — Chat Bot
Please ensure that the web control program backend process is not running in the background. To close it, refer to the [Get Started Quickly - 2. Access the Terminal] section in [Disable the Auto-Start Web Control Backend Process]. After closing, please restart DofbotUltra!!!
AI Application Development — Chat Bot1. Course Content2. Start Dify Service3. Chat Bot4. Web Access to Chat Bot
1. Course Content
Master using Dify to quickly develop a chat bot
2. Start Dify Service
Dify backend runs in the host machine of the DofbotUltra mainboard, not inside a docker container.
After connecting to the vehicle via VNC or SSH, execute the following command in any directory of the host machine to start Dify:
bringup_dify
After startup is complete, you can view the vehicle's IP address through the OLED screen,
ifconfig, or directly in the terminal. Enter this IP in a browser on the same local network to access the Dify management page.
Tip
If you haven't configured the model provider API Key yet, please complete the
02-Configure API-KEYcourse earlier in this chapter before continuing with subsequent AI application configuration.If the browser cannot access, you can execute
docker pson the host machine to confirm thatlanggenius/dify-*related containers are inUpstatus.

3. Chat Bot
Click "Create Blank Application" on the homepage

Click to select "Chat Assistant" under "Beginner Friendly" -> Name the application -> Create

Then we input our role prompt in the prompt (prompt)

Example reference prompt
x# Role PositioningYou are a friendly, patient, and talkative general chat bot named "Xiaoya". Your core goal is to engage in natural, relaxed daily conversations with users and provide a pleasant dialogue experience.# Conversation Rules1. Tone: Maintain a friendly, natural tone like a friend, avoid overly formal or mechanical expressions;2. Response Length: For daily casual chat, keep responses to 1-3 sentences. When users ask complex questions, expand appropriately but avoid lengthy discourses;3. Boundaries: If users ask about content you don't know, honestly explain and try to provide relevant suggestions without fabricating information. If users make inappropriate requests, politely refuse and guide back to normal topics;4. Logic: Follow the user's conversation context closely without deviating from the current topic, and adjust your response style based on the user's tone (be humorous if the user is humorous, be serious if the user is serious).# Start ConversationPlease respond to each user's message according to the above settings.
Then select the AI model, here using
qwen-maxas an example, keep parameters at default
Tip
If you need to add visual Q&A functionality, you need to select a multimodal model and turn on the visual switch
If you need to save application changes, you need to click publish

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

4. Web Access to Chat Bot
If you need to access the AI application we created, it is divided into web access and backend API access. Here we take web access to our AI application as an example
Click the settings button of the chat bot on the left

Click to copy the public access URL of
Web App

Paste the link in the browser address bar to access the web end of the chat bot
Tip
As long as the device terminal is on the same network segment as the vehicle, it can access the page, so dify can also be deployed in a server.
