Skip to main content

Run Pipeline

This runs a pipeline.


POST
https://controller.${CLOUD_REGION}.zillizcloud.com/v1/pipeline/{PIPELINE_ID}/run

Example

📘Notes

This API requires an API key as the authentication token.

Currently, you can run Zilliz Cloud pipelines to ingest,search, and purge multiple types of data, and the request parameters vary with the data types.

export CLOUD_REGION="gcp-us-west1"
export API_KEY=""
export PIPELINE_ID="pipe-xxxxxxxxxxxxxxxxxxxxxx"

curl --request POST \
--header "Content-Type: application/json" \
--header "Authorization: Bearer ${API_KEY}" \
--url "https://controller.api.${CLOUD_REGION}.zillizcloud.com/v1/pipelines/${PIPELINE_ID}/run" \
-d '{
"data": {
"text_list": ["Zilliz Cloud is a fully managed vector database and data services, empowering you to unlock the full potential of unstructured data for your AI applications.", "It can store, index, and manage massive embedding vectors generated by deep neural networks and other machine learning (ML) models."],
"source": "Zilliz official website"
}
}'

Possible response is similar to the following

{
"code": 200,
"data": {
"num_entities": 2,
"ids": [
449281041373015598,
449281041373015599
],
"usage": {
"embedding": 62
},
}
}

Request

Parameters

  • No query parameters required

  • Path parameters

    ParameterDescription
    PIPELINE_IDstring(required)
    A valid pipeline ID obtained from either the list-pipelines API endpoints or Zilliz Cloud console.
  • Header parameters

    ParameterDescription
    Authorizationstring
    Content-Typestring

Request Body

Option 1: Data ingestion parameters.

{}
ParameterDescription
dataobject | object | object
data[opt_1]object
data[opt_1].doc_urlstring
The URL of the document stored on an object storage. You should use a URL that is either not encoded or encoded in UTF-8. Ensure that the URL remains valid for at least one hour.
data[opt_1].{YOUR_PRESERVED_FIELD}string
The metadata field to preserve. The input field name should be consistent with what you defined when creating the Ingestion pipeline and adding the PRESERVE function. The value of this field should also follow the predefined field type.
data[opt_2]object
data[opt_2].text_liststring
The text or text list to ingest.
data[opt_2].sourcestring
The metadata field to preserve. The input field name should be consistent with what you defined when creating the Ingestion pipeline and adding the PRESERVE function. The value of this field should also follow the predefined field type.
data[opt_3]object
data[opt_3].image_urlstring
The URL of the image stored on an object storage. You should use a URL that is either not encoded or encoded in UTF-8. Ensure that the URL remains valid for at least one hour.
data[opt_3].image_idstring
The ID of the image stored on an object storage.
data[opt_3].image_titlestring
The title of the image.

Option 2:

{
"data": {
"query_text": "string",
"query_image_url": "string"
},
"params": {
"limit": "integer",
"offset": "integer",
"outputFields": [],
"filter": "string"
}
}
ParameterDescription
dataobject
Search data.
data.query_textstring
A query text. Zilliz Cloud embeds it and use the generated vector embeddings to conduct a search in the target collection. This applies to pipelines of a SEARCH_TEXT, a SEARCH_DOC_CHUNK, or a SEARCH_IMAGE_BY_TEXT type.
data.query_image_urlstring
The URL of a query image. This applies to pipelines of a SEARCH_IMAGE_BY_IMAGE type.
paramsobject
Search parameters.
params.limitinteger
Total number of records to return.
params.offsetinteger
Total number of records to skip in the search results.
params[].outputFieldsarray
A list of fields to output for each match in the search result.
params[].outputFields[]string
A valid output field and should be the one defined in the preserve functions.
params.filterstring
A boolean expression for Zilliz Cloud to filter records before actual searches.

Option 3:

{
"code": "string",
"data": {
"expression": "string",
"doc_name": "string",
"image_id": "string"
}
}
ParameterDescription
dataobject
Payload of the doc deletion request.
data.expressionstring
A filter expression. This applies to pipelines of the INDEX_TEXT type.
data.doc_namestring
Name of the document to delete. Note that you can delete document by its name, and all the chunks of the document will be removed. This applies to pipelines of the INDEX_DOC_CHUNK type.
data.image_idstring
ID of an image. This applies to pipelines of the INDEX_IMAGE type.

Response

Returns the result of running a specific pipeline.

Response Body

Option 1:

{
"code": "integer",
"data": {
"oneOf": [
{
"num_entities": "integer",
"ids": [
{}
],
"usage": {
"embedding": "integer"
}
},
{
"num_chunks": "integer",
"doc_name": "string",
"usage": {
"embedding": "integer"
}
},
{
"num_entities": "integer",
"usage": {
"embedding": "string"
}
}
]
}
}
PropertyDescription
codeinteger
Indicates whether the request succeeds.
  • 0: The request succeeds.
  • Others: Some error occurs.
dataobject | object | object
Payload of the response.
data[opt_1]object
data[opt_1].num_entitiesinteger
Number of text strings added to the collection.
data[opt_1][].idsarray
IDs of the returned text strings in the collection.
data[opt_1][].ids[]integer
data[opt_1].usageobject
Token usage statistics
data[opt_1].usage.embeddinginteger
Number of tokens used in text embedding
data[opt_2]object
Payload of the response.
data[opt_2].num_chunksinteger
Number of chunks generated.
data[opt_2].doc_namestring
Name of the chunked document with the file extension.
data[opt_2].usageobject
Token usage statistics
data[opt_2].usage.embeddinginteger
Number of tokens used in text embedding
data[opt_3]object
data[opt_3].num_entitiesinteger
Number of images added.
data[opt_3].usageobject
Token usage statistics
data[opt_3].usage.embeddingstring
Number of tokens used in image embedding

Option 2:

{
"code": "integer",
"data": {
"results": {
"oneOf": [
[
{
"id": "string",
"distance": "string",
"chuck_text": "string",
"chunk_id": "string",
"doc_name": "string"
}
],
[
{
"id": "string",
"distance": "string",
"text": "string"
}
],
[
{
"id": "string",
"distance": "string",
"image_id": "string",
"image_title": "string"
}
]
]
},
"usage": {
"embedding": "integer",
"rerank": "integer"
}
}
}
PropertyDescription
codeinteger
Indicates whether the request succeeds.
  • 0: The request succeeds.
  • Others: Some error occurs.
dataobject
Payload of the response
resultsarray | array | array
results[][opt_1]array
Returned search result. It is an array of objects.
results[][opt_1][]object
results[][opt_1][].idstring
ID of a hit entity, representing a chunk of a document.
results[][opt_1][].distancestring
Distance to the vector embedings of the specified query string.
results[][opt_1][].chuck_textstring
A searched document chunk.
results[][opt_1][].chunk_idstring
A searched chunk ID.
results[][opt_1][].doc_namestring
Name of the document to which the searched chunk belongs
results[][opt_2]array
results[][opt_2][]object
results[][opt_2][].idstring
ID of a hit entity, representing a chunk of a document.
results[][opt_2][].distancestring
Distance to the vector embedings of the specified query string.
results[][opt_2][].textstring
A searched text.
results[][opt_3]array
results[][opt_3][]object
results[][opt_3][].idstring
ID of a hit entity, representing a chunk of a document.
results[][opt_3][].distancestring
Distance to the vector embedings of the specified query string.
results[][opt_3][].image_idstring
ID of the searched image in the object storage.
results[][opt_3][].image_titlestring
Title of the searched image.
data.usageobject
Token usage statistics
data.usage.embeddinginteger
Number of tokens used in embedding
data.usage.rerankinteger
Number of tokens used for reranking.

Option 3:

{
"code": "string",
"data": {
"num_deleted_chunks": "integer"
}
}
PropertyDescription
codeinteger
Indicates whether the request succeeds.
  • 0: The request succeeds.
  • Others: Some error occurs.
dataobject
data.num_deleted_chunksinteger
Number of deleted chunks. Note that Zilliz Cloud deletes all chunks of a document if a deletion pipeline carriesits name.

Error Response

{
"code": integer,
"message": string
}
PropertyDescription
codeinteger
Indicates whether the request succeeds.
  • 0: The request succeeds.
  • Others: Some error occurs.
messagestring
Indicates the possible reason for the reported error.