Use AI VibeFlow to produce vector data
A DataPipeline is the core management object in AI VibeFlow. You can create a DataPipeline through the console, ossutil, an SDK, or an API to automatically vectorize unstructured data, such as text, images, and videos, in an OSS general-purpose bucket and write the vectors to an OSS vector bucket.
Prerequisites
-
OSS is activated, and an object bucket (to store the raw data) is created in the target region.
-
A vector bucket and a vector index are created in the same region as the object bucket, and the index dimensions are the same as the output dimensions of the selected Model Studio vector model. For how to create them, see Vector bucket.
-
To use the Vectorization with Alibaba Cloud Model Studio mode, you must have activated Alibaba Cloud Model Studio and obtained an API key (which starts with
sk-). Confirm that the throttling quota (RPM/TPM) of your Model Studio API key meets your expected processing speed. To increase throughput, request a higher RPM/TPM quota through the Model Studio console, or contact technical support to increase the processing QPS. The AI VibeStudio mode does not require Alibaba Cloud Model Studio or a Model Studio API key. -
If you use a RAM user (instead of the Alibaba Cloud account) to operate AI VibeFlow, you must complete the following permission configuration in advance.
Processing templates
AI VibeFlow provides two model versions: Fast and Balanced. When you use the Processing with AI VibeStudio mode to create a DataPipeline, you only need to select the source file type and model version, and AI VibeFlow automatically selects the processing template, so you do not need to configure vector models individually. The model version determines how many types of vectors each file produces, and each type of vector requires one vector index, so it also determines how many indexes you must prepare before you create the DataPipeline. See the following table for details.
|
Model version |
What it processes |
Vectors produced |
Best for |
|
Fast |
|
1 vector index each for images, videos, and documents |
|
|
Balanced |
|
2 vector indexes for images and videos, 1 for documents |
|
A DataPipeline supports only one model version, which applies to all source file types that the DataPipeline processes. If you process images, videos, and documents at the same time, all three must use the same model version. You cannot use Fast for images and Balanced for documents in the same DataPipeline.
Example: To process a batch of product images and search for them with text descriptions, select Image as the source file type and Balanced as the model version. This combination produces two types of vectors, so you need to create two vector indexes in advance and assign them to the two vector types when you create the DataPipeline.
Index schema
In the AI VibeStudio mode, the DataPipeline writes data to 5 types of vector indexes. In each index, every row consists of a Key, a vector, and a set of metadata. The metadata is stored together with the vector and returned with query results, and filterable fields can also be used as filter conditions. The following sections describe the complete structure of each row by index type. When you create a vector index, the data type and dimensions must match those described in this section. Otherwise, the DataPipeline fails to be created due to a mismatch.
Image embedding
Corresponds to the Destination.ImageEmbedding field. Each image object generates at most 1 row, and the vector has 768 dimensions. The Balanced model version additionally writes the three model-generated fields Caption, Description, and OCRTexts, while the Fast model version does not generate these three fields.
|
Field |
Type |
Always written |
Description |
|
Key |
string |
Yes |
Key of a single-row index, in the format [Prefix/]ObjectId. ObjectId is the SHA-256 value of the source object URI, expressed as 64 lowercase hexadecimal characters. |
|
Vector |
float32 array |
Yes |
768-dimensional image vector. NaN, Inf, and all-zero vectors are not allowed. |
|
Prefix |
string |
Yes |
The Prefix configured in Destination. If no Prefix is configured, this field is an empty string. |
|
ObjectId |
string |
Yes |
SHA-256 value of the source object URI, expressed as 64 lowercase hexadecimal characters. |
|
URI |
string |
Yes |
Source object URI, in the format oss://<Bucket>/<ObjectKey>. |
|
MediaType |
string |
Yes |
Fixed to image. |
|
CreateTime |
string |
Yes |
Time when this vector row was generated, in UTC RFC3339 format. |
|
OSSETag |
string |
Yes |
ETag of the source object (without quotation marks), used to reuse existing vectors when an event for the source object has the same ETag. |
|
ContentType |
string |
Yes |
MIME type of the source object. |
|
Filename |
string |
No |
Filename of the source object. |
|
Size |
int64 |
No |
Size of the source object in bytes. |
|
OSSStorageClass |
string |
No |
Storage class of the source object. |
|
OSSObjectType |
string |
No |
Object type of the source object. |
|
OSSTagging |
string array |
No |
OSS tags copied from the source object. Each entry is in the key=value format, sorted by key. |
|
OSSUserMeta |
string array |
No |
OSS user metadata copied from the source object. Each entry is in the key=value format, sorted by key. |
|
ImageWidth |
int64 |
No |
Image width in pixels. |
|
ImageHeight |
int64 |
No |
Image height in pixels. |
|
ProduceTime |
string |
No |
Time when the image was captured or generated, in UTC RFC3339 format. |
|
LatLong |
string |
No |
Geographic location of the image. |
|
Labels |
string array |
No |
List of image tag names. Only tag names are stored. |
|
Caption |
string |
No |
Image summary generated by the model. Written only by the Balanced model version. Empty values are not written. |
|
Description |
string |
No |
Visual description of the image generated by the model. Written only by the Balanced model version. Empty values are not written. |
|
OCRTexts |
string |
No |
Text in the image recognized by the model. Written only by the Balanced model version. Empty values are not written. |
Image text embedding
Corresponds to the Destination.ImageTextEmbedding field. Written only by the Balanced model version. Each image object generates at most 1 row, and the vector has 1024 dimensions. To generate the vector, the values of Caption, Description, and OCRTexts are trimmed in this order, empty values are skipped, and the remaining values are joined with line breaks. If the joined result is empty, no row is generated.
|
Field |
Type |
Always written |
Description |
|
Key |
string |
Yes |
Key of a single-row index, in the format [Prefix/]ObjectId. ObjectId is the SHA-256 value of the source object URI, expressed as 64 lowercase hexadecimal characters. |
|
Vector |
float32 array |
Yes |
1024-dimensional aggregated image text vector. NaN, Inf, and all-zero vectors are not allowed. |
|
Prefix |
string |
Yes |
The Prefix configured in Destination. If no Prefix is configured, this field is an empty string. |
|
ObjectId |
string |
Yes |
SHA-256 value of the source object URI, expressed as 64 lowercase hexadecimal characters. |
|
URI |
string |
Yes |
Source object URI, in the format oss://<Bucket>/<ObjectKey>. |
|
MediaType |
string |
Yes |
Fixed to image. |
|
CreateTime |
string |
Yes |
Time when this vector row was generated, in UTC RFC3339 format. |
|
OSSETag |
string |
Yes |
ETag of the source object (without quotation marks), used to reuse existing vectors when an event for the source object has the same ETag. |
|
ContentType |
string |
Yes |
MIME type of the source object. |
|
Filename |
string |
No |
Filename of the source object. |
|
Size |
int64 |
No |
Size of the source object in bytes. |
|
OSSStorageClass |
string |
No |
Storage class of the source object. |
|
OSSObjectType |
string |
No |
Object type of the source object. |
|
OSSTagging |
string array |
No |
OSS tags copied from the source object. Each entry is in the key=value format, sorted by key. |
|
OSSUserMeta |
string array |
No |
OSS user metadata copied from the source object. Each entry is in the key=value format, sorted by key. |
|
ImageWidth |
int64 |
No |
Image width in pixels. |
|
ImageHeight |
int64 |
No |
Image height in pixels. |
|
ProduceTime |
string |
No |
Time when the image was captured or generated, in UTC RFC3339 format. |
|
LatLong |
string |
No |
Geographic location of the image. |
|
Labels |
string array |
No |
List of image tag names. Only tag names are stored. |
|
Caption |
string |
No |
Image summary included in the aggregation. Empty values are not written. |
|
Description |
string |
No |
Visual description of the image included in the aggregation. Empty values are not written. |
|
OCRTexts |
string |
No |
Recognized text included in the aggregation. Empty values are not written. |
Video frame embedding
Corresponds to the Destination.VideoFrameEmbedding field. Both the Fast and Balanced model versions process all video streams. Each extracted frame generates 1 row, and the vector has 768 dimensions.
|
Field |
Type |
Always written |
Description |
|
Key |
string |
Yes |
Key of a multi-row index, in the format [Prefix/]ObjectId/000000, where the sequence number increases consecutively from 000000. ObjectId is the SHA-256 value of the source object URI, expressed as 64 lowercase hexadecimal characters. |
|
Vector |
float32 array |
Yes |
768-dimensional video frame vector. NaN, Inf, and all-zero vectors are not allowed. |
|
Prefix |
string |
Yes |
The Prefix configured in Destination. If no Prefix is configured, this field is an empty string. |
|
ObjectId |
string |
Yes |
SHA-256 value of the source object URI, expressed as 64 lowercase hexadecimal characters. |
|
URI |
string |
Yes |
Source object URI, in the format oss://<Bucket>/<ObjectKey>. |
|
MediaType |
string |
Yes |
Fixed to video. |
|
CreateTime |
string |
Yes |
Time when this vector row was generated, in UTC RFC3339 format. |
|
OSSETag |
string |
Yes |
ETag of the source object (without quotation marks), used to reuse existing vectors when an event for the source object has the same ETag. |
|
ContentType |
string |
Yes |
MIME type of the source object. |
|
Filename |
string |
No |
Filename of the source object. |
|
Size |
int64 |
No |
Size of the source object in bytes. |
|
OSSStorageClass |
string |
No |
Storage class of the source object. |
|
OSSObjectType |
string |
No |
Object type of the source object. |
|
OSSTagging |
string array |
No |
OSS tags copied from the source object. Each entry is in the key=value format, sorted by key. |
|
OSSUserMeta |
string array |
No |
OSS user metadata copied from the source object. Each entry is in the key=value format, sorted by key. |
|
VideoWidth |
int64 |
No |
Video width in pixels. |
|
VideoHeight |
int64 |
No |
Video height in pixels. |
|
Duration |
float64 |
No |
Video duration in seconds. |
|
Bitrate |
int64 |
No |
Video bitrate. |
|
FormatName |
string |
No |
Short name of the video container format. |
|
FormatLongName |
string |
No |
Full name of the video container format. |
|
StreamCount |
int64 |
No |
Number of video streams. |
|
ProgramCount |
int64 |
No |
Number of video programs. |
|
StartTime |
float64 |
No |
Start time of the media. |
|
VideoStartTime |
float64 |
No |
Start time of the video stream. |
|
VideoStreams |
string |
No |
Information about all video streams, as a JSON array of objects. |
|
ProduceTime |
string |
No |
Time when the video was captured or generated, in UTC RFC3339 format. |
|
LatLong |
string |
No |
Geographic location of the video. |
|
Addresses |
string |
No |
Address information, as a JSON array of objects. |
|
VideoStreamIndex |
int64 |
Yes |
Index of the video stream to which the current frame belongs in the VideoStreams array, starting from 0. |
Video text embedding
Corresponds to the Destination.VideoTextEmbedding field. Written only by the Balanced model version. Each SceneElement generates 1 row, and the vector has 1024 dimensions. To generate the vector, the values of Caption and Description of each SceneElement are trimmed in this order, empty values are skipped, and the remaining values are joined with line breaks. The row is generated only when the joined result is not empty. This index does not perform OCR.
|
Field |
Type |
Always written |
Description |
|
Key |
string |
Yes |
Key of a multi-row index, in the format [Prefix/]ObjectId/000000, where the sequence number increases consecutively from 000000. ObjectId is the SHA-256 value of the source object URI, expressed as 64 lowercase hexadecimal characters. |
|
Vector |
float32 array |
Yes |
1024-dimensional aggregated Scene text vector. NaN, Inf, and all-zero vectors are not allowed. |
|
Prefix |
string |
Yes |
The Prefix configured in Destination. If no Prefix is configured, this field is an empty string. |
|
ObjectId |
string |
Yes |
SHA-256 value of the source object URI, expressed as 64 lowercase hexadecimal characters. |
|
URI |
string |
Yes |
Source object URI, in the format oss://<Bucket>/<ObjectKey>. |
|
MediaType |
string |
Yes |
Fixed to video. |
|
CreateTime |
string |
Yes |
Time when this vector row was generated, in UTC RFC3339 format. |
|
OSSETag |
string |
Yes |
ETag of the source object (without quotation marks), used to reuse existing vectors when an event for the source object has the same ETag. |
|
ContentType |
string |
Yes |
MIME type of the source object. |
|
Filename |
string |
No |
Filename of the source object. |
|
Size |
int64 |
No |
Size of the source object in bytes. |
|
OSSStorageClass |
string |
No |
Storage class of the source object. |
|
OSSObjectType |
string |
No |
Object type of the source object. |
|
OSSTagging |
string array |
No |
OSS tags copied from the source object. Each entry is in the key=value format, sorted by key. |
|
OSSUserMeta |
string array |
No |
OSS user metadata copied from the source object. Each entry is in the key=value format, sorted by key. |
|
VideoWidth |
int64 |
No |
Video width in pixels. |
|
VideoHeight |
int64 |
No |
Video height in pixels. |
|
Duration |
float64 |
No |
Video duration in seconds. |
|
Bitrate |
int64 |
No |
Video bitrate. |
|
FormatName |
string |
No |
Short name of the video container format. |
|
FormatLongName |
string |
No |
Full name of the video container format. |
|
StreamCount |
int64 |
No |
Number of video streams. |
|
ProgramCount |
int64 |
No |
Number of video programs. |
|
StartTime |
float64 |
No |
Start time of the media. |
|
VideoStartTime |
float64 |
No |
Start time of the video stream. |
|
VideoStreams |
string |
No |
Information about all video streams, as a JSON array of objects. |
|
ProduceTime |
string |
No |
Time when the video was captured or generated, in UTC RFC3339 format. |
|
LatLong |
string |
No |
Geographic location of the video. |
|
Addresses |
string |
No |
Address information, as a JSON array of objects. |
|
VideoStreamIndex |
int64 |
Yes |
Index of the video stream to which the current SceneElement belongs in the VideoStreams array, starting from 0. |
|
TimeRange |
string |
Yes |
Time range of the SceneElement, as a JSON array of integers. |
|
FrameTimes |
string |
Yes |
Time information of the frames contained in the SceneElement, as a JSON array of integers. |
|
FrameCount |
int64 |
Yes |
Number of frames contained in the SceneElement. |
|
SceneElementType |
string |
Yes |
Type of the SceneElement. This field cannot be empty. |
|
Caption |
string |
No |
SceneElement summary included in the aggregation. Empty values are not written. |
|
Description |
string |
No |
Visual description of the SceneElement included in the aggregation. Empty values are not written. |
Document chunk embedding
Corresponds to the Destination.DocumentChunkEmbedding field. The structure is the same for the Fast and Balanced model versions. Each text chunk of the document generates 1 row, the vector has 1024 dimensions, and the sequence number in the Key increases consecutively from 000000. If the document has no embeddable text, no rows are retained for the object in this index and existing rows are deleted.
|
Field |
Type |
Always written |
Description |
|
Key |
string |
Yes |
Key of a multi-row index, in the format [Prefix/]ObjectId/000000, where the sequence number increases consecutively from 000000. ObjectId is the SHA-256 value of the source object URI, expressed as 64 lowercase hexadecimal characters. |
|
Vector |
float32 array |
Yes |
1024-dimensional text chunk vector. NaN, Inf, and all-zero vectors are not allowed. |
|
Prefix |
string |
Yes |
The Prefix configured in Destination. If no Prefix is configured, this field is an empty string. |
|
ObjectId |
string |
Yes |
SHA-256 value of the source object URI, expressed as 64 lowercase hexadecimal characters. |
|
URI |
string |
Yes |
Source object URI, in the format oss://<Bucket>/<ObjectKey>. |
|
MediaType |
string |
Yes |
Fixed to document. |
|
CreateTime |
string |
Yes |
Time when this vector row was generated, in UTC RFC3339 format. |
|
OSSETag |
string |
Yes |
ETag of the source object (without quotation marks), used to reuse existing vectors when an event for the source object has the same ETag. |
|
ContentType |
string |
Yes |
MIME type of the source object. |
|
Filename |
string |
No |
Filename of the source object. |
|
Size |
int64 |
No |
Size of the source object in bytes. |
|
OSSStorageClass |
string |
No |
Storage class of the source object. |
|
OSSObjectType |
string |
No |
Object type of the source object. |
|
OSSTagging |
string array |
No |
OSS tags copied from the source object. Each entry is in the key=value format, sorted by key. |
|
OSSUserMeta |
string array |
No |
OSS user metadata copied from the source object. Each entry is in the key=value format, sorted by key. |
|
ElementType |
string |
Yes |
Type of the text chunk, such as title or content. |
|
ChunkText |
string |
Yes |
Content of the text chunk, as a non-empty UTF-8 string. |
|
ChunkOffset |
int64 |
Yes |
Start position of the text chunk in the source text, counted in Unicode code points. The value is greater than or equal to 0. |
|
ChunkLength |
int64 |
Yes |
Length of the text chunk, counted in Unicode code points. The value is greater than 0. |
Metadata size limits: In each index, the total size of filterable metadata in a row cannot exceed 2 KB, and the total size of all metadata in a row (filterable and non-filterable) cannot exceed 200 KB.
Recommendations for index creation: Model-generated text fields can be large and easily exceed these limits. We recommend that you configure the fields in the following table as non-filterable by using nonFilterableMetadataKeys when you create the vector index. Fields configured as non-filterable are still returned with query results, but they still count toward the 200 KB limit. You can specify this setting only when you create the index; it cannot be changed after the index is created.
|
Index |
Fields recommended to be non-filterable |
|
|
Caption, Description, OCRTexts |
|
ImageTextEmbedding |
Caption, Description, OCRTexts |
|
|
VideoStreams |
|
|
VideoStreams, Caption, Description, FrameTimes |
|
|
ChunkText |
The schema of a vector index is determined when the index is created and cannot be modified afterward. To adjust the dimensions or metadata fields, you must delete the DataPipeline first, rebuild the vector index based on the new schema, and then create the DataPipeline again. Rebuilding an index with the same name without deleting the DataPipeline does not take effect, because the DataPipeline contains the schema snapshot from when it was created.
Create a DataPipeline
A single Alibaba Cloud account can create up to 1,000 DataPipelines in a single region. A DataPipeline cannot be modified after it is created. To adjust it, delete it and create a new one.
Console
The console currently supports only the Vectorization with Alibaba Cloud Model Studio mode. To use the AI VibeStudio mode, create the DataPipeline through the API, SDKs, or ossutil.
-
Log on to the OSS console.
-
In the left-side navigation pane, click AI VibeFlow.
-
On the AI VibeFlow page, click Create Data Pipeline.
-
In the Create Data Pipeline panel, configure the following items as instructed, and then click OK.
-
Basic settings
-
Rule Name: up to 64 characters. Uppercase and lowercase letters, digits, hyphens (-), and underscores (_) are supported. The name must be unique within the same account and region.
-
Rule Description: optional, up to 200 characters.
-
-
Source data settings
-
Source Bucket: first select the region, and then select the target bucket.
-
Source File Scope: All Files processes all objects in the bucket; Specify File Name Prefix processes only the objects that match the prefix.
-
Source File Type: you can select multiple types from Text, Image, and Video. The selection must match the capabilities of the vector model you use later.
-
Processing Mode: Process Existing Data Only (files that already exist when the pipeline is created); Process Incremental Data Only (newly uploaded files trigger processing automatically); Process Existing and Incremental Data.
-
-
Vectorization settings
-
Vector Model Source: currently only Alibaba Cloud Model Studio is supported.
-
API Key: enter the Model Studio API key, which starts with
sk-and is 35 to 128 characters in length. -
Vector Model: text models such as
text-embedding-v4(default) andtext-embedding-v3; multimodal models such astongyi-embedding-vision-plusandtongyi-embedding-vision-flash. Make sure that the model output dimensions are the same as the vector index dimensions. -
Video Snapshot Frequency: can be configured only for multimodal models. The value range is (0, 1], and the default value is 1.0. A smaller value captures fewer frames.
-
Cascade Delete Settings: Retain vector data when the source object is deleted (default); Delete corresponding vector data when the source object is deleted.
-
-
Destination data settings
-
Vector Bucket: must be located in the same region as the source bucket.
-
Vector Index: select the target index from the index list of the selected vector bucket. The index dimensions must be the same as the output dimensions of the vector model.
-
Vector Key Naming Method: optional. If you enter a prefix, the format is
{prefix}/{ObjectKey}. If you leave it empty, the vector key is the same as theObjectKey. -
Use ObjectTag as Metadata: optional, up to 10 keys, used for subsequent scalar filtering during retrieval.
-
Use UserMeta as Metadata: optional, up to 8 keys. The system automatically adds the
X-OSS-META-prefix.
-
-
Exception handling and authorization
-
Exception Handling: Continue tasks despite errors; Skip exceptions and continue with subsequent tasks while recording exception details (you must configure Exception Information Bucket and Exception Log Prefix to receive error messages; the receiving bucket must be located in the same region as the source bucket and cannot be the source bucket itself); Stop subsequent tasks on failure.
-
Authorization Role: select New RAM Role to automatically create and bind
oss-embedding-{uuid}.
-
-
Confirm the settings: check all settings and click OK after you confirm that they are correct.
-
ossutil
Examples
Vectorization with Alibaba Cloud Model Studio
First, write the data pipeline configuration to config.xml:
<?xml version="1.0" encoding="UTF-8" ?>
<DataPipelineConfiguration>
<Sources>
<InputBucket>my-bucket</InputBucket>
<InputDataScope>All</InputDataScope>
</Sources>
<DataPipelineEmbeddingConfiguration>
<EmbeddingProvider>bailian</EmbeddingProvider>
<ApiKey>sk-xxxx</ApiKey>
<Model>qwen2.5-vl-embedding</Model>
</DataPipelineEmbeddingConfiguration>
<Destination>
<VectorBucketName>my-vector-bucket</VectorBucketName>
<VectorIndexNames>myIndex</VectorIndexNames>
</Destination>
<DataPipelineError>
<ErrorMode>ignore</ErrorMode>
</DataPipelineError>
</DataPipelineConfiguration>
Processing with AI VibeStudio
The following example uses balanced mode to process all three media types and writes 5 indexes. To process only some types, delete the extra ObjectMediaTypes and their corresponding containers.
<?xml version="1.0" encoding="UTF-8" ?>
<DataPipelineConfiguration>
<ModelTier>standard</ModelTier>
<Sources>
<InputBucket>my-bucket</InputBucket>
<InputDataScope>All</InputDataScope>
<FilterConfiguration>
<PrefixSet>media/</PrefixSet>
<ObjectMediaTypes>image</ObjectMediaTypes>
<ObjectMediaTypes>video</ObjectMediaTypes>
<ObjectMediaTypes>document</ObjectMediaTypes>
</FilterConfiguration>
</Sources>
<DataPipelineDataProcessConfiguration>
<SearchMode>balanced</SearchMode>
</DataPipelineDataProcessConfiguration>
<Destination>
<ImageEmbedding><Bucket>my-vector-bucket</Bucket><IndexName>image</IndexName><Prefix>v2</Prefix></ImageEmbedding>
<ImageTextEmbedding><Bucket>my-vector-bucket</Bucket><IndexName>image-text</IndexName><Prefix>v2</Prefix></ImageTextEmbedding>
<VideoFrameEmbedding><Bucket>my-vector-bucket</Bucket><IndexName>video-frame</IndexName><Prefix>v2</Prefix></VideoFrameEmbedding>
<VideoTextEmbedding><Bucket>my-vector-bucket</Bucket><IndexName>video-text</IndexName><Prefix>v2</Prefix></VideoTextEmbedding>
<DocumentChunkEmbedding><Bucket>my-vector-bucket</Bucket><IndexName>document</IndexName><Prefix>v2</Prefix></DocumentChunkEmbedding>
</Destination>
<DataPipelineError>
<ErrorMode>ignoreAndRecord</ErrorMode>
<ErrorBucket>my-error-bucket</ErrorBucket>
<ErrorPrefix>error-output/</ErrorPrefix>
</DataPipelineError>
</DataPipelineConfiguration>
Then, run the command to create the data pipeline:
ossutil api do-data-pipe-line-action --action putDataPipelineConfiguration \
--parameters dataPipelineName=my-data-pipeline \
--parameters role=acs:ram::<AccountId>:role/my-data-pipeline-role \
--body file://config.xml \
--region cn-hangzhou
SDK
Java
Vectorization with Alibaba Cloud Model Studio
import com.aliyun.sdk.service.oss2.credentials.CredentialsProvider;
import com.aliyun.sdk.service.oss2.credentials.EnvironmentVariableCredentialsProvider;
import com.aliyun.sdk.service.oss2.dataprocess.OSSDataProcessClient;
import com.aliyun.sdk.service.oss2.dataprocess.models.*;
import java.util.Arrays;
import java.util.Collections;
public class PutDataPipelineConfigurationSample {
public static void main(String[] args) throws Exception {
String role = "acs:ram::<AccountId>:role/my-data-pipeline-role";
CredentialsProvider provider = new EnvironmentVariableCredentialsProvider();
try (OSSDataProcessClient client = OSSDataProcessClient.newBuilder()
.region("cn-hangzhou")
.credentialsProvider(provider)
.build()) {
DataPipelineSourceFilterConfiguration filterConfig =
DataPipelineSourceFilterConfiguration.newBuilder()
.prefixSet(Arrays.asList("data/"))
.objectMediaTypes(Arrays.asList("image", "video"))
.build();
DataPipelineSource source = DataPipelineSource.newBuilder()
.inputBucket("my-bucket")
.inputDataScope("All")
.ignoreDelete(true)
.filterConfiguration(filterConfig)
.build();
DataPipelineEmbeddingConfiguration embeddingConfig =
DataPipelineEmbeddingConfiguration.newBuilder()
.embeddingProvider("bailian")
.apiKey("sk-xxxx")
.model("qwen2.5-vl-embedding")
.fps(1.0f)
.build();
DataPipelineDestination destination = DataPipelineDestination.newBuilder()
.vectorBucketName("my-vector-bucket")
.vectorIndexNames(Collections.singletonList("my-index"))
.build();
PutDataPipelineConfigurationConfiguration config =
PutDataPipelineConfigurationConfiguration.newBuilder()
.dataPipelineDescription("Data pipeline sample")
.sources(Collections.singletonList(source))
.dataPipelineEmbeddingConfiguration(embeddingConfig)
.destination(destination)
.build();
PutDataPipelineConfigurationResult result = client.putDataPipelineConfiguration(
PutDataPipelineConfigurationRequest.newBuilder()
.dataPipelineName("my-data-pipeline")
.role(role)
.putDataPipelineConfigurationConfiguration(config)
.build());
System.out.printf("Status code:%d, request id:%s%n",
result.statusCode(), result.requestId());
} catch (Exception e) {
System.out.printf("error:%n%s", e);
}
}
}
Vectorization with AI VibeStudio
import com.aliyun.sdk.service.oss2.credentials.CredentialsProvider;
import com.aliyun.sdk.service.oss2.credentials.EnvironmentVariableCredentialsProvider;
import com.aliyun.sdk.service.oss2.dataprocess.OSSDataProcessClient;
import com.aliyun.sdk.service.oss2.dataprocess.models.*;
import java.util.Collections;
public class PutDataPipelineV2ConfigurationSample {
public static void main(String[] args) throws Exception {
String role = "acs:ram::<AccountId>:role/my-data-pipeline-role";
CredentialsProvider provider = new EnvironmentVariableCredentialsProvider();
try (OSSDataProcessClient client = OSSDataProcessClient.newBuilder()
.region("cn-hangzhou")
.credentialsProvider(provider)
.build()) {
DataPipelineSource source = DataPipelineSource.newBuilder()
.inputBucket("my-bucket")
.inputDataScope("All")
.ignoreDelete(false)
.filterConfiguration(DataPipelineSourceFilterConfiguration.newBuilder()
.prefixSet(Collections.singletonList("media/"))
.objectMediaTypes(Collections.singletonList("image"))
.build())
.build();
DataPipelineDataProcessConfiguration processConfiguration =
DataPipelineDataProcessConfiguration.newBuilder()
.searchMode("fast")
.insights(DataPipelineInsights.newBuilder()
.image(InsightsImage.newBuilder()
.caption(InsightsCaption.newBuilder()
.prompt("Describe the image.")
.build())
.build())
.build())
.build();
DataPipelineDestination destination = DataPipelineDestination.newBuilder()
.imageEmbedding(ImageEmbedding.newBuilder()
.bucket("my-vector-bucket")
.indexName("my-image-index")
.prefix("v2")
.build())
.build();
PutDataPipelineConfigurationConfiguration config =
PutDataPipelineConfigurationConfiguration.newBuilder()
.dataPipelineDescription("V2 image semantic vector pipeline")
.sources(Collections.singletonList(source))
.modelTier("standard")
.dataPipelineDataProcessConfiguration(processConfiguration)
.destination(destination)
.dataPipelineError(DataPipelineError.newBuilder()
.errorMode("ignore")
.build())
.build();
PutDataPipelineConfigurationResult result = client.putDataPipelineConfiguration(
PutDataPipelineConfigurationRequest.newBuilder()
.dataPipelineName("my-data-pipeline")
.role(role)
.putDataPipelineConfigurationConfiguration(config)
.build());
System.out.printf("Status code:%d, request id:%s%n",
result.statusCode(), result.requestId());
} catch (Exception e) {
System.out.printf("error:%n%s", e);
}
}
}
Go
OSS SDK for Go V2 does not support creating data pipelines in AI VibeStudio mode yet. Use Java SDK or the API instead.
package main
import (
"context"
"log"
"github.com/aliyun/alibabacloud-oss-go-sdk-v2/oss"
"github.com/aliyun/alibabacloud-oss-go-sdk-v2/oss/credentials"
"github.com/aliyun/alibabacloud-oss-go-sdk-v2/oss/dataprocess"
)
func main() {
region := "cn-hangzhou"
role := "acs:ram::<AccountId>:role/my-data-pipeline-role"
apiKey := "sk-xxxx"
dataPipelineName := "my-data-pipeline"
cfg := oss.LoadDefaultConfig().
WithCredentialsProvider(credentials.NewEnvironmentVariableCredentialsProvider()).
WithRegion(region)
client := dataprocess.NewClient(cfg)
result, err := client.PutDataPipelineConfiguration(context.TODO(), &dataprocess.PutDataPipelineConfigurationRequest{
DataPipelineName: oss.Ptr(dataPipelineName),
Role: oss.Ptr(role),
DataPipelineConfiguration: &dataprocess.DataPipelineConfiguration{
DataPipelineDescription: oss.Ptr("Vectorize business data using the BERT multimodal model"),
Sources: []dataprocess.DataPipelineSource{
{
InputBucket: oss.Ptr("bucket"),
InputDataScope: oss.Ptr("All"),
FilterConfiguration: &dataprocess.DataPipelineSourceFilterConfiguration{
PrefixSet: []string{"prefix1"},
ObjectMediaTypes: []string{"text"},
},
},
},
DataPipelineEmbeddingConfiguration: &dataprocess.DataPipelineEmbeddingConfiguration{
ApiKey: oss.Ptr(apiKey),
EmbeddingProvider: oss.Ptr("bailian"),
FPS: oss.Ptr(float64(1)),
Model: oss.Ptr("qwen2.5-vl-embedding"),
},
Destination: &dataprocess.DataPipelineDestination{
VectorBucketName: oss.Ptr("my-vector-bucket"),
VectorIndexNames: []string{"index"},
VectorKeyPrefix: oss.Ptr("prefix"),
ObjectTagToMetadata: []string{"key1"},
UsermetaToMetadata: []string{"x-oss-meta-key1"},
},
DataPipelineError: &dataprocess.DataPipelineError{
ErrorMode: oss.Ptr("ignoreAndRecord"),
ErrorBucket: oss.Ptr("my-error-bucket"),
ErrorPrefix: oss.Ptr("error-output/"),
},
},
})
if err != nil {
log.Fatalf("failed to put pipeline configuration %v", err)
}
log.Printf("put pipeline configuration result:%#v\n", result)
}
API
Call the PutDataPipelineConfiguration operation to create a DataPipeline.
Get the DataPipeline configuration
Console
-
On the AI VibeFlow page, click the Rule Name of the target
DataPipelineor click View Details in the Actions column. -
On the details page, view the complete information, including the basic settings, source data settings, vectorization settings, destination settings, exception handling settings, and authorization settings.
ossutil
Examples
ossutil api do-data-pipe-line-action --action getDataPipelineConfiguration \
--parameters dataPipelineName=my-data-pipeline \
--region cn-hangzhouSDK
Java
import com.aliyun.sdk.service.oss2.credentials.CredentialsProvider;
import com.aliyun.sdk.service.oss2.credentials.EnvironmentVariableCredentialsProvider;
import com.aliyun.sdk.service.oss2.dataprocess.OSSDataProcessClient;
import com.aliyun.sdk.service.oss2.dataprocess.models.*;
public class GetDataPipelineConfigurationSample {
public static void main(String[] args) throws Exception {
CredentialsProvider provider = new EnvironmentVariableCredentialsProvider();
try (OSSDataProcessClient client = OSSDataProcessClient.newBuilder()
.region("cn-hangzhou")
.credentialsProvider(provider)
.build()) {
GetDataPipelineConfigurationResult result = client.getDataPipelineConfiguration(
GetDataPipelineConfigurationRequest.newBuilder()
.dataPipelineName("my-data-pipeline")
.build());
System.out.printf("Status code:%d, request id:%s%n",
result.statusCode(), result.requestId());
DataPipelineConfiguration cfg = result.dataPipelineConfiguration();
if (cfg != null) {
System.out.printf("Pipeline name:%s, status:%s, role:%s, createTime:%s%n",
cfg.dataPipelineName(), cfg.status(),
cfg.dataPipelineRole(), cfg.createTime());
if (cfg.dataPipelineDataProcessConfiguration() != null) {
System.out.printf("Model tier:%s, search mode:%s%n",
cfg.modelTier(),
cfg.dataPipelineDataProcessConfiguration().searchMode());
}
if (cfg.destination() != null) {
System.out.printf("Destination vector bucket:%s%n",
cfg.destination().vectorBucketName());
if (cfg.destination().imageEmbedding() != null) {
System.out.printf("Image embedding destination:%s/%s%n",
cfg.destination().imageEmbedding().bucket(),
cfg.destination().imageEmbedding().indexName());
}
}
if (cfg.dataPipelineError() != null) {
System.out.printf("Pipeline error mode:%s, bucket:%s, prefix:%s%n",
cfg.dataPipelineError().errorMode(),
cfg.dataPipelineError().errorBucket(),
cfg.dataPipelineError().errorPrefix());
}
}
} catch (Exception e) {
System.out.printf("error:%n%s", e);
}
}
}
Go
package main
import (
"context"
"log"
"github.com/aliyun/alibabacloud-oss-go-sdk-v2/oss"
"github.com/aliyun/alibabacloud-oss-go-sdk-v2/oss/credentials"
"github.com/aliyun/alibabacloud-oss-go-sdk-v2/oss/dataprocess"
)
func main() {
region := "cn-hangzhou"
dataPipelineName := "my-data-pipeline"
cfg := oss.LoadDefaultConfig().
WithCredentialsProvider(credentials.NewEnvironmentVariableCredentialsProvider()).
WithRegion(region)
client := dataprocess.NewClient(cfg)
result, err := client.GetDataPipelineConfiguration(context.TODO(), &dataprocess.GetDataPipelineConfigurationRequest{
DataPipelineName: oss.Ptr(dataPipelineName),
})
if err != nil {
log.Fatalf("failed to get pipeline configuration %v", err)
}
log.Printf("get pipeline configuration result:%#v\n", result)
}
API
Call the GetDataPipelineConfiguration operation to get the DataPipeline configuration.
List DataPipelines
Console
On the AI VibeFlow page, you can directly view the list of all DataPipelines of the current account in the selected region, including information such as the rule name, description, status, and creation time.
ossutil
Examples
ossutil api do-data-pipe-line-action --action listDataPipelineConfigurations \
--parameters maxResults=100 \
--region cn-hangzhouSDK
Java
import com.aliyun.sdk.service.oss2.credentials.CredentialsProvider;
import com.aliyun.sdk.service.oss2.credentials.EnvironmentVariableCredentialsProvider;
import com.aliyun.sdk.service.oss2.dataprocess.OSSDataProcessClient;
import com.aliyun.sdk.service.oss2.dataprocess.models.*;
public class ListDataPipelineConfigurationsSample {
public static void main(String[] args) throws Exception {
CredentialsProvider provider = new EnvironmentVariableCredentialsProvider();
try (OSSDataProcessClient client = OSSDataProcessClient.newBuilder()
.region("cn-hangzhou")
.credentialsProvider(provider)
.build()) {
String nextToken = null;
do {
ListDataPipelineConfigurationsRequest.Builder reqBuilder =
ListDataPipelineConfigurationsRequest.newBuilder().maxResults(100);
if (nextToken != null) {
reqBuilder.nextToken(nextToken);
}
ListDataPipelineConfigurationsResult result =
client.listDataPipelineConfigurations(reqBuilder.build());
System.out.printf("Status code:%d, request id:%s%n",
result.statusCode(), result.requestId());
if (result.dataPipelineConfigurations() != null) {
for (DataPipelineConfiguration cfg : result.dataPipelineConfigurations()) {
System.out.printf("Pipeline: name=%s, status=%s, createTime=%s%n",
cfg.dataPipelineName(), cfg.status(), cfg.createTime());
}
}
nextToken = result.nextToken();
} while (nextToken != null && !nextToken.isEmpty());
} catch (Exception e) {
System.out.printf("error:%n%s", e);
}
}
}
Go
package main
import (
"context"
"log"
"github.com/aliyun/alibabacloud-oss-go-sdk-v2/oss"
"github.com/aliyun/alibabacloud-oss-go-sdk-v2/oss/credentials"
"github.com/aliyun/alibabacloud-oss-go-sdk-v2/oss/dataprocess"
)
func main() {
region := "cn-hangzhou"
cfg := oss.LoadDefaultConfig().
WithCredentialsProvider(credentials.NewEnvironmentVariableCredentialsProvider()).
WithRegion(region)
client := dataprocess.NewClient(cfg)
p := client.NewListDataPipelineConfigurationsPaginator(&dataprocess.ListDataPipelineConfigurationsRequest{})
var i int
log.Println("Data Pipeline Configurations:")
for p.HasNext() {
i++
page, err := p.NextPage(context.TODO())
if err != nil {
log.Fatalf("failed to get page %v, %v", i, err)
}
for _, data := range page.DataPipelineConfigurations {
log.Printf("Data Pipeline Name:%v, Data Pipeline Description:%v, Data Pipeline Role:%v, Status:%v, Phase:%v\n", oss.ToString(data.DataPipelineName), oss.ToString(data.DataPipelineDescription), oss.ToString(data.DataPipelineRole), oss.ToString(data.Status), oss.ToString(data.Phase))
}
}
}
API
Call the ListDataPipelineConfigurations operation to list DataPipelines.
Pause a DataPipeline
A pipeline in the Running state can be paused. After it is paused, unprocessed files remain in the waiting state, and the vector data that has already been written is not affected.
Console
On the AI VibeFlow page, find the target DataPipeline and click Suspend in the Actions column.
ossutil
Examples
ossutil api do-data-pipe-line-action --action pauseDataPipeline \
--parameters dataPipelineName=my-data-pipeline \
--region cn-hangzhouSDK
Java
import com.aliyun.sdk.service.oss2.credentials.CredentialsProvider;
import com.aliyun.sdk.service.oss2.credentials.EnvironmentVariableCredentialsProvider;
import com.aliyun.sdk.service.oss2.dataprocess.OSSDataProcessClient;
import com.aliyun.sdk.service.oss2.dataprocess.models.*;
public class PauseDataPipelineSample {
public static void main(String[] args) throws Exception {
CredentialsProvider provider = new EnvironmentVariableCredentialsProvider();
try (OSSDataProcessClient client = OSSDataProcessClient.newBuilder()
.region("cn-hangzhou")
.credentialsProvider(provider)
.build()) {
PauseDataPipelineResult result = client.pauseDataPipeline(
PauseDataPipelineRequest.newBuilder()
.dataPipelineName("my-data-pipeline")
.build());
System.out.printf("Status code:%d, request id:%s%n",
result.statusCode(), result.requestId());
} catch (Exception e) {
System.out.printf("error:%n%s", e);
}
}
}
Go
package main
import (
"context"
"log"
"github.com/aliyun/alibabacloud-oss-go-sdk-v2/oss"
"github.com/aliyun/alibabacloud-oss-go-sdk-v2/oss/credentials"
"github.com/aliyun/alibabacloud-oss-go-sdk-v2/oss/dataprocess"
)
func main() {
region := "cn-hangzhou"
dataPipelineName := "my-data-pipeline"
cfg := oss.LoadDefaultConfig().
WithCredentialsProvider(credentials.NewEnvironmentVariableCredentialsProvider()).
WithRegion(region)
client := dataprocess.NewClient(cfg)
result, err := client.PauseDataPipeline(context.TODO(), &dataprocess.PauseDataPipelineRequest{
DataPipelineName: oss.Ptr(dataPipelineName),
})
if err != nil {
log.Fatalf("failed to pause pipeline %v", err)
}
log.Printf("pause pipeline result:%#v\n", result)
}
API
Call the PauseDataPipeline operation to pause a DataPipeline.
Restart a DataPipeline
A paused pipeline can be restarted to continue processing. If the pipeline was automatically paused because the index is full, create a new index first, and then create a new DataPipeline or delete and recreate the DataPipeline to point to the new index.
Console
On the AI VibeFlow page, find the target DataPipeline and click Restart in the Actions column.
ossutil
Examples
ossutil api do-data-pipe-line-action --action restartDataPipeline \
--parameters dataPipelineName=my-data-pipeline \
--region cn-hangzhouSDK
Java
import com.aliyun.sdk.service.oss2.credentials.CredentialsProvider;
import com.aliyun.sdk.service.oss2.credentials.EnvironmentVariableCredentialsProvider;
import com.aliyun.sdk.service.oss2.dataprocess.OSSDataProcessClient;
import com.aliyun.sdk.service.oss2.dataprocess.models.*;
public class RestartDataPipelineSample {
public static void main(String[] args) throws Exception {
CredentialsProvider provider = new EnvironmentVariableCredentialsProvider();
try (OSSDataProcessClient client = OSSDataProcessClient.newBuilder()
.region("cn-hangzhou")
.credentialsProvider(provider)
.build()) {
RestartDataPipelineResult result = client.restartDataPipeline(
RestartDataPipelineRequest.newBuilder()
.dataPipelineName("my-data-pipeline")
.build());
System.out.printf("Status code:%d, request id:%s%n",
result.statusCode(), result.requestId());
} catch (Exception e) {
System.out.printf("error:%n%s", e);
}
}
}
Go
package main
import (
"context"
"log"
"github.com/aliyun/alibabacloud-oss-go-sdk-v2/oss"
"github.com/aliyun/alibabacloud-oss-go-sdk-v2/oss/credentials"
"github.com/aliyun/alibabacloud-oss-go-sdk-v2/oss/dataprocess"
)
func main() {
region := "cn-hangzhou"
dataPipelineName := "my-data-pipeline"
cfg := oss.LoadDefaultConfig().
WithCredentialsProvider(credentials.NewEnvironmentVariableCredentialsProvider()).
WithRegion(region)
client := dataprocess.NewClient(cfg)
result, err := client.RestartDataPipeline(context.TODO(), &dataprocess.RestartDataPipelineRequest{
DataPipelineName: oss.Ptr(dataPipelineName),
})
if err != nil {
log.Fatalf("failed to restart pipeline %v", err)
}
log.Printf("restart pipeline result:%#v\n", result)
}
API
Call the RestartDataPipeline operation to restart a DataPipeline.
Delete a DataPipeline
After a pipeline is deleted, OSS stops vectorization, and the vector data that has already been written to the vector bucket is not deleted. Pause a running pipeline before you delete it. The deletion cannot be undone.
Console
On the AI VibeFlow page, find the target DataPipeline, click Delete in the Actions column, and confirm to complete the deletion.
ossutil
Examples
ossutil api do-data-pipe-line-action --action deleteDataPipelineConfiguration \
--parameters dataPipelineName=my-data-pipeline \
--region cn-hangzhouSDK
Java
import com.aliyun.sdk.service.oss2.credentials.CredentialsProvider;
import com.aliyun.sdk.service.oss2.credentials.EnvironmentVariableCredentialsProvider;
import com.aliyun.sdk.service.oss2.dataprocess.OSSDataProcessClient;
import com.aliyun.sdk.service.oss2.dataprocess.models.*;
public class DeleteDataPipelineConfigurationSample {
public static void main(String[] args) throws Exception {
CredentialsProvider provider = new EnvironmentVariableCredentialsProvider();
try (OSSDataProcessClient client = OSSDataProcessClient.newBuilder()
.region("cn-hangzhou")
.credentialsProvider(provider)
.build()) {
DeleteDataPipelineConfigurationResult result = client.deleteDataPipelineConfiguration(
DeleteDataPipelineConfigurationRequest.newBuilder()
.dataPipelineName("my-data-pipeline")
.build());
System.out.printf("Status code:%d, request id:%s%n",
result.statusCode(), result.requestId());
} catch (Exception e) {
System.out.printf("error:%n%s", e);
}
}
}
Go
package main
import (
"context"
"log"
"github.com/aliyun/alibabacloud-oss-go-sdk-v2/oss"
"github.com/aliyun/alibabacloud-oss-go-sdk-v2/oss/credentials"
"github.com/aliyun/alibabacloud-oss-go-sdk-v2/oss/dataprocess"
)
func main() {
region := "cn-hangzhou"
dataPipelineName := "my-data-pipeline"
cfg := oss.LoadDefaultConfig().
WithCredentialsProvider(credentials.NewEnvironmentVariableCredentialsProvider()).
WithRegion(region)
client := dataprocess.NewClient(cfg)
result, err := client.DeleteDataPipelineConfiguration(context.TODO(), &dataprocess.DeleteDataPipelineConfigurationRequest{
DataPipelineName: oss.Ptr(dataPipelineName),
})
if err != nil {
log.Fatalf("failed to delete pipeline configuration %v", err)
}
log.Printf("delete pipeline configuration result:%#v\n", result)
}
API
Call the DeleteDataPipelineConfiguration operation to delete a DataPipeline.
DataPipeline status descriptions
|
Status |
Description |
Recommended action |
|
Preparing |
The pipeline is created and being initialized. |
Wait a moment. It automatically enters the Running state. |
|
Running |
Existing data is being processed, or incremental data is being monitored. |
Use it as normal. You can click View Details to learn about the progress. |
|
Completed |
All existing data has been vectorized (Process Existing Data Only mode only). |
Go to the vector bucket to perform retrieval. |
|
Paused |
Paused manually, or automatically paused because the index is full. |
Check the cause and restart after handling it. |
|
Failed |
Terminated due to configuration errors (such as an invalid API key or insufficient permissions). |
Check the failure cause, fix it, and re-create the pipeline. |
Considerations
A DataPipeline processes source objects of different storage classes differently:
-
Standard and Infrequent Access (IA) objects are processed directly.
-
Archive objects are processed directly if Archive Direct Read is enabled. If Archive Direct Read is not enabled, objects that are not restored are skipped as failed files.
-
Cold Archive and Deep Cold Archive objects must be restored before they can be processed.
An object that is not restored causes only that file to fail and be skipped. It does not pause or fail the entire DataPipeline.
Reading, Archive Direct Read, and restore operations for IA, Archive, Cold Archive, and Deep Cold Archive objects may incur additional OSS fees and waiting time.
Troubleshooting
Error record files
If you selected Skip exceptions and continue with subsequent tasks while recording exception details when you created the pipeline, the error details of files that fail to be vectorized are written as objects to the Exception Information Bucket.
The path format of the error record file is:
{ErrorBucket}/{ErrorPrefix}/{DataPipelineName}/{ObjectKey}-{millisecond timestamp}.log
Example: if ErrorBucket is my-error-bucket, ErrorPrefix is pipeline-errors, the pipeline name is my-image-pipeline, and the source object key is images/photo.jpg, the error record path is:
my-error-bucket/pipeline-errors/my-image-pipeline/images/photo.jpg-1735689600000.log
Error record content
Each error record file contains the following fields:
|
Field |
Description |
|
ErrorCode |
The error code, which identifies the type of the failure cause. |
|
ErrorMessage |
The error description, which is a textual explanation of the failure cause. |
|
RequestId |
The request ID on the Model Studio side, which you can provide to Alibaba Cloud Model Studio technical support to locate the issue. |
Common errors and handling suggestions
|
Error scenario |
Possible cause |
Handling suggestion |
|
The vectorization request is rejected. |
The API key is invalid or expired. |
Confirm the key status in the Model Studio console and re-create the pipeline. |
|
The vectorization request exceeds the limit. |
The RPM/TPM reaches the upper limit. |
Contact Model Studio to increase the throttling limit. The tasks are automatically queued and retried. |
|
The vector fails to be written. |
The dimensions do not match the index. |
Confirm that the output dimensions of the selected Model Studio model are the same as the vector index dimensions, and re-create the DataPipeline. |
|
The source file fails to be read. |
The file has been deleted. |
Verify whether the source file still exists. No action is required. The pipeline skips it and continues. |
|
The vector index is full. |
The number of index rows reaches 2 billion. |
Create a new vector index and a new DataPipeline to continue processing. |