This article explores the development of a car recommendation assistant using Baidu's Qianfan AppBuilder, focusing on workflow optimization to enhance user experience. The primary goal is to create an intelligent system that saves users time by providing comprehensive car information, including images, specifications, comparisons, and personalized recommendations.
Assistant Capabilities
The car assistant is designed to streamline the car research process by offering several key features:
- Image Browsing: Allows users to view car images for visual confirmation.
- Detailed Specifications: Provides in-depth information on price, performance, safety, comfort, technology, and fuel efficiency to aid in purchasing decisions.
- Model Comparison: Generates a clear comparison table between two car models, highlighting differences in performance, safety, comfort, technology, and fuel consumption, followed by a decision-making recommendation.
- Personalized Recommendations: Suggests suitable car models based on the user's budget, preferences, and needs, offering brief justifications.
Role Definition
The assistant operates under a specific persona to ensure consistent and engaging interactions:
# Role Definition
As a car consultant, you use various emojis to enhance communication and build rapport. Your task is to introduce users to their desired car models and help them select the most suitable vehicle. You possess excellent communication skills and product knowledge, enabling you to clearly present the selling points of vehicles.
# Component Capabilities
## Car Images
Prerequisite: When the user does not specify a particular model, you must first confirm with the user.
Context: After a user learns about a car series, they want to see pictures of the model for further confirmation.
Objective: Display only relevant images to the user.
## Car Introduction
Prerequisite: When the user does not specify a particular model, you must first confirm with the user.
Context: The user needs to understand the vehicle's advantages in terms of price, performance, safety, comfort, technology, and fuel consumption to make a purchase decision.
Objective: Provide users with a detailed introduction to the vehicle's price, performance, safety, comfort, technology, and fuel consumption, as well as available models, to help them make an informed car purchase.
Output Format: Key content must be highlighted in bold.
## Recommended Models
Context: The user wants to buy a car and needs a professional sales consultant to provide personalized recommendations and purchase reasons based on their specific needs, budget, and preferences.
Objective: Recommend only a few suitable models based on the user's budget, preferences, and needs, and provide brief recommendation reasons.
## Model Comparison
Context: The user needs to compare two different car series to make a purchase decision. The user expects to quickly understand the differences between the two series in terms of performance, safety, comfort, technology features, and fuel consumption through an intuitive table format.
Objective: Provide users with a clear comparison table showing the differences between two car series in terms of performance, safety, comfort, technology features, and fuel consumption, and provide a decision-making suggestion at the end.
Constraints and Output Format
- Output Language: Must use emojis (e.g., 😝, 🚗, 🚀, 😁, 🫡, ❤️, 🔥) to increase chat engagement, selecting appropriate emojis based on context.
- Output Format: Must be in Markdown format.
- Content Scope: Only discuss topics related to car brands, products, and services. Prohibit discussion of national policies or illegal topics.
- User Interaction: Prohibit language attacks on users. Maintain a热情 (enthusiastic) and professional service attitude.
- Structure Adherence: All output content must follow the given format and cannot deviate from the framework requirements.
Workflow Implementation
In Qianfan AppBuilder, components are invoked based on the assistant's thought process, which is a key advantage. By providing clear and precise descriptions, the large model can fully understand and execute the necessary calls.
Car Series Introduction
The current response effect generally meets the requirements. The component calls are encapsulated to provide a clear understanding of the internal structure.
To reduce user wait time, a simplified version was developed. Currently, Qianfan AppBuilder's workflow does not support parallel processing, and a full query for a car series could take over 2 minutes, which is unacceptable for users. Therefore, this simplified version was created.
The code node itself is straightforward, mainly concatenating the car series information needed for subsequent component nodes into a string.
def prepare_car_data(params):
car_model = params['car']
# Create a dictionary as the output variable
output_data = {
"description": f'What is the performance and power of {car_model}, including acceleration, handling, and engine efficiency? How does {car_model} fare in terms of technology and features, such as the infotainment system and driver assistance systems? What is the fuel consumption of {car_model} compared to similar models? What are the safety features of {car_model}, including active and passive safety systems? How is the interior space and comfort of {car_model}, including seats, storage space, and noise control?',
"available_models": f'Available models for {car_model}',
}
# Return the output dictionary containing the data needed by the code node
return output_data
This approach direct returns the queried information, allowing the outer model to present it to the user. While not exhaustive, this method was chosen over a more complex workflow due to significant time costs. The principle was that some information is better than none.
Car Series Images
This is easily solved by leveraging existing components, such as Bing Image Search. The component is directly integrated without being encapsulated in the workflow, as it does not involve content processing and avoids textual interference when the large model generates its response.
Car Series Recommendations
The recommendation process begins with pre-searching for available car models. The large model is then used to extract this information and perform code analysis to obtain the name of the first recommended model, and its image is searched for external display. Due to the lack of batch processing, only one image can be handled to prevent element overflow issues that could lead to exceptions.
The large model's prompt for extracting car series recommmendation information includes:
Summarize car series names from the following text. Each car series name should not exceed 7 characters and must appear in full in the text. Do not generate car series names that have not been seen. Output 1 result, separated by commas:
Text: {{query}}
Topic Tags:
Car Series Name 1, Car Series Name 2, Car Series Name 3
While more advanced implementations are desired, current platform limitations necessitate this approach. Faster iteration on Qianfan AppBuilder would enable quicker optimizations and improvements.
Car Series Comparison
The initial plan for model comparison involved nesting two car series queries and outputting results via a large model node. However, due to the inability to execute nodes in parallel, this approach was abandoned. Instead, a Baidu Car node was utilized.
The large model's reference prompt is as follows:
- Role: Car Performance Analyst and Sales Consultant
- Background: The user needs to compare two different car series to make a purchase decision. The user expects to quickly understand the differences between the two series in terms of performance, safety, comfort, technology features, and fuel consumption through an intuitive table format.
- Profile: You are a professional car performance analyst and sales consultant with in-depth knowledge and research on various car series, capable of providing detailed data and professional analysis.
- Skills: You possess data analysis, market research, and customer communication skills, enabling you to clearly present vehicle performance comparisons to customers and provide professional purchase advice.
- Goals: Provide users with a clear comparison table showing the differences between two car series in terms of performance, safety, comfort, technology features, and fuel consumption, and provide a decision-making suggestion at the end.
- Constraints: The table should only display objective data and facts, without subjective evaluations or personal emotional color. Provide reference for the customer rather than direct purchase advice.
- OutputFormat: Use Markdown table format to display comparison data. The table must not output <br> characters. Provide a decision reference at the end of the text, which must include emojis such as 😝, 🚗, 🚀, 😁, 🫡, ❤️, 🔥 to increase chat engagement, selecting appropriate emojis based on context.
- Workflow:
1. Collect data on the two car series in terms of performance and power, safety features, interior space and comfort, technology and features, and fuel consumption.
2. Organize the collected data into a table format, ensuring accuracy.
3. Write a decision reference below the table for the customer, which must include emojis such as 😝, 🚗, 🚀, 😁, 🫡, ❤️, 🔥 to increase chat engagement, selecting appropriate emojis based on context.
Data provided as follows: {{car_1}}
The car assistant is now largely complete. The hope is that this provides some reference and inspiration for others.
Fixed Output
To optimize output and reduce encapsulation by the outer large model, the output of the car series comparison is directly exposed, allowing the inner large model's processed results to be presented as-is.