This topic describes how to create an application flow by using the Chat With Web Search template in LangStudio. Application flows integrate with Alibaba Cloud real-time search capabilities, which can empower a model the web search feature. This allows the model to provide more accurate answers to user questions based on real-time search results. In addition, developers can flexibly expand the Chat With Web Search template and perform secondary development to meet special scenario requirements.
Overview
The overall process consists of three parts. In this topic, the DeepSeek-R1 service is used.
Contact your customer manager to activate Alibaba Cloud information query service.
Configure the DeepSeek-R1 connection.
Create an application flow by using the Chat With Web Search template in LangStudio.
(Optional) Deploy the application flow as the DeepSeek-R1 service with the web search feature.
Create a connection
Before you create an application flow, perform the following steps to create a connection:
Go to the Permission page in the Resource Access Management (RAM) console by using your Alibaba Cloud account. Then, select a RAM role and attach the AliyunIQSFullAccess, AliyunOSSFullAccess, and AliyunPAIFullAccess policies to the RAM role. Configure the principal as PAI and the EAS service in the trust policy of the RAM role.
The following sample code provides an example of the trust policy:
{ "Statement": [ { "Action": "sts:AssumeRole", "Effect": "Allow", "Principal": { "Service": "pai.aliyuncs.com" } }, { "Action": "sts:AssumeRole", "Effect": "Allow", "Principal": { "Service": "eas.pai.aliyuncs.com" } } ], "Version": "1" }
Configure the DeepSeek-R1 service.
If you use Model Gallery to deploy the DeepSeek-R1 service, select a service from the EAS Service drop-down list on the New Connection page. The system automatically configures the
base_url
andapi_key
parameters.If you use an official DeepSeek service, create a connection by using the following method:
base_url
:https://api.deepseek.com
api_key
: Obtain the value from the DeepSeek Official Website.If you use a service from a third-party service provider, such as Model Studio, obtain the values of
base_url
andapi_key
by referring to Make your first API call to Qwen.
Create an application flow
On the Application Flow tab of the Application Development (LangStudio) page, click Create Application Flow to create an application flow by using a template.
On the application flow details page, configure the parameters.
In the upper-right corner, click Start Runtime. Then, click Chat.
Deploy an application flow
After the test is complete, click Deploy in the upper-right corner of the application flow details page. In the Deploy panel, specify a service name, configure a resource group, select a VPC, and deploy the application flow as an EAS service that is the DeepSeek-R1 service. The web search feature invokes the Alibaba Cloud information query service which is deployed only in the China (Zhangjiakou), China (Beijing), and China (Shanghai) regions. If your application flow does not reside in one of these regions, you must configure Internet access. By default, EAS online services do not support Internet access. For information about how to configure Internet access, see Configure Internet access.
For more information about service deployment and invocation, see Deploy an application flow.