# Case: WeSee Short Video Recommendation
This episode will use the WeSee Short Video API to configure short video recommendation and search skills. Developers can use this interface to enrich the content of Official Account message template and Mini Program, or follow this configuration logic, combined with custom interface, to provide users with video recommendation and search of their own resources.
# Effect display
WeSee Short Video API enables:
- Recommended short video (Intent: WeSee short video)
- Search Target Short Video (Intent: Video Search)
- Allow users to initiate referral requests multiple times in a row (Intent: WeSee Short Video Round 2).
The final configuration is expected to achieve the following effects:
- The user initiates the demand to watch short videos, and the robot recommends a short video list, and the user can click on the videos in the list to watch.
- The user gives the video content to watch, and the robot replies to the corresponding video H5 page.
- When the user is not satisfied with the given video, then recommend other short videos to the user.
# Step 1: Intent Configuration
(one)WeSee short video (short video is recommended)
- User Questions Configure the user to ask for a short video when the search content is not given. For example, users ask: WeSee short video, what hot video, I want to watch video and so on.
- Semantic Slot Setup The semantic slot under the same skill is universal, the three intentions of the skill use "WeSee short video API," this API has "query" and "single result" two input parameters, in which "single result" does not need to be associated with the semantic slot, "query" corresponds to the search content keywords. New semantic slot "keywords," associated with the dictionary "user asked method." Because the user does not give the search content under this intention, the search content and keywords are not involved in this intention, and there is no need to ask the keyword semantic slot.
- The robot answered. Under this intention, the robot will randomly give a list of short videos for users to select the short videos they want to watch. First select the robot reply type as "service interface call," and select the "WeSee short video" API, in the "interface configuration" input parameters "query" and "keyword." Once the configuration is complete, the output parameters of the API are slotted automatically at the semantic slot settings. After the interface configuration is completed, the next step will be to configure the robot's response. When successful: Of which: (1)Special identifier “[ ]” The middle of the symbol can fill in one or more slot information, the role of this special identifier is to list the slot information and clickable, in order to achieve the recommended short video list, and allow clickable. (2)<<a> Tag definition hyperlinks are syntax rules for linking from one page to another in HTML. Href is its most important attribute, indicating the target of the link. According to this rule, enter the URL of Weishi short video, and associate the short video id {feedid} returned by the interface. (3)Display the content of the "video title" semantic slot returned by the API, making it a front-end display for the URL. When the interface call fails, prompt the call failed and attach the error code:
The final configuration effect of this intent is as follows:
(two)WeSee short video second round
- User Questions Add a user question to initiate the next round of video recommendations:
- Semantic Slot Setup Agree with the setup of semantic slot in "WeSee Short Video"
- The robot answered. Agree with the robot answer in the "WeSee short video" Finally achieve the following effects:
(3) Video search (short video of the search target)
- User Questions When the configuration gives the search requirements of the video you want to watch, the robot will reply with a corresponding H5 card, which is marked with information such as the name of the short video and the number of plays.
- Semantic Slot Setup In this case, users will search for the content they want to see, so create a new semantic slot called "Videos to Watch" at the semantic slot settings, and associate it with the relevant dictionaries. Here users can also associate relevant custom dictionaries to enhance the experience. Because of this intention, the content information you want to see must be given to the interface, so open the questioning and set up the questioning technique here. The specific configuration is as follows:
- The robot answered. First, select the service interface to call WeSee short video at the robot's answer, and associate the input parameter "query" with the semantic slot "video to be seen," then the system will automatically build slot for the output parameter after clicking OK. Then select Direct Reply - H5 when the call is successful. Corresponding output parameter semantic slots are associated in the form of "$semantic slots $" at titles, abstracts, cover images, etc. The final configuration effect is as follows:
# Step 2: Multiple rounds of dialogue
Due to the intention of "Weishi short video" and "Weishi short video second round" to undertake the relationship, the intention "Weishi short video second round" to undertake the intention "3500 short video". After the above configuration, using Weishi short video API short video recommendation and search skills to achieve.