From 9c1fdcaf8d16a5034c3c369f56d87042566ee873 Mon Sep 17 00:00:00 2001 From: weizijun Date: Wed, 28 Aug 2024 17:23:04 +0800 Subject: [PATCH 01/20] add alibaba cloud ai search inference docs --- .../inference/inference-apis.asciidoc | 1 + .../inference/put-inference.asciidoc | 1 + .../service-alibabacloud-ai-search.asciidoc | 193 ++++++++++++++++++ .../semantic-search-inference.asciidoc | 1 + .../infer-api-ingest-pipeline-widget.asciidoc | 17 ++ .../infer-api-ingest-pipeline.asciidoc | 26 +++ .../infer-api-mapping-widget.asciidoc | 17 ++ .../inference-api/infer-api-mapping.asciidoc | 32 +++ .../infer-api-reindex-widget.asciidoc | 17 ++ .../inference-api/infer-api-reindex.asciidoc | 23 +++ .../infer-api-requirements-widget.asciidoc | 17 ++ .../infer-api-requirements.asciidoc | 6 + .../infer-api-search-widget.asciidoc | 17 ++ .../inference-api/infer-api-search.asciidoc | 65 ++++++ .../infer-api-task-widget.asciidoc | 17 ++ .../inference-api/infer-api-task.asciidoc | 29 +++ 16 files changed, 479 insertions(+) create mode 100644 docs/reference/inference/service-alibabacloud-ai-search.asciidoc diff --git a/docs/reference/inference/inference-apis.asciidoc b/docs/reference/inference/inference-apis.asciidoc index 33db148755d8e..8fdf8aecc2ae5 100644 --- a/docs/reference/inference/inference-apis.asciidoc +++ b/docs/reference/inference/inference-apis.asciidoc @@ -39,6 +39,7 @@ include::delete-inference.asciidoc[] include::get-inference.asciidoc[] include::post-inference.asciidoc[] include::put-inference.asciidoc[] +include::service-alibabacloud-ai-search.asciidoc[] include::service-amazon-bedrock.asciidoc[] include::service-anthropic.asciidoc[] include::service-azure-ai-studio.asciidoc[] diff --git a/docs/reference/inference/put-inference.asciidoc b/docs/reference/inference/put-inference.asciidoc index 57485e0720cca..ba26a563541fc 100644 --- a/docs/reference/inference/put-inference.asciidoc +++ b/docs/reference/inference/put-inference.asciidoc @@ -39,6 +39,7 @@ The create {infer} API enables you to create an {infer} endpoint and configure a The following services are available through the {infer} API, click the links to review the configuration details of the services: +* <> * <> * <> * <> diff --git a/docs/reference/inference/service-alibabacloud-ai-search.asciidoc b/docs/reference/inference/service-alibabacloud-ai-search.asciidoc new file mode 100644 index 0000000000000..1f04ea6c2f242 --- /dev/null +++ b/docs/reference/inference/service-alibabacloud-ai-search.asciidoc @@ -0,0 +1,193 @@ +[[infer-service-alibabacloud-ai-search]] +=== AlibabaCloud AI Search {infer} service + +Creates an {infer} endpoint to perform an {infer} task with the `alibabacloud-ai-search` service. + +[discrete] +[[infer-service-alibabacloud-ai-search-api-request]] +==== {api-request-title} + +`PUT /_inference//` + +[discrete] +[[infer-service-alibabacloud-ai-search-api-path-params]] +==== {api-path-parms-title} + +``:: +(Required, string) +include::inference-shared.asciidoc[tag=inference-id] + +``:: +(Required, string) +include::inference-shared.asciidoc[tag=task-type] ++ +-- +Available task types: + +* `text_embedding`, +* `sparse_embedding`. +* `rerank`. +-- + +[discrete] +[[infer-service-alibabacloud-ai-search-api-request-body]] +==== {api-request-body-title} + +`service`:: +(Required, string) The type of service supported for the specified task type. +In this case, +`alibabacloud-ai-search`. + +`service_settings`:: +(Required, object) +include::inference-shared.asciidoc[tag=service-settings] ++ +-- +These settings are specific to the `alibabacloud-ai-search` service. +-- + +`api_key`::: +(Required, string) +A valid API key for the AlibabaCloud AI Search API. + +`service_id`::: +(Required, string) +The name of the model service to use for the {infer} task. + +The service_id available for the `text_embedding` task are: + +* `ops-text-embedding-001` +* `ops-text-embedding-zh-001` +* `ops-text-embedding-en-001` +* `ops-text-embedding-002` + +You can find the supported `text_embedding` service_id at https://help.aliyun.com/zh/open-search/search-platform/developer-reference/text-embedding-api-details[embedding detail] + +for the `sparse_embedding` task are: + +* `ops-text-sparse-embedding-001` + +You can find the supported `sparse_embedding` service_id at https://help.aliyun.com/zh/open-search/search-platform/developer-reference/text-sparse-embedding-api-details[sparse embedding detail] + +for the `rerank` task are: + +* `ops-bge-reranker-larger` + +You can find the supported `rerank` service_id at https://help.aliyun.com/zh/open-search/search-platform/developer-reference/ranker-api-details[rerank detail] + +`host`::: +(Required, string) +The name of the host address use for the {infer} task. You can find the host address at https://opensearch.console.aliyun.com/cn-shanghai/rag/api-key[API keys section] + +`workspace`::: +(Required, string) +The name of the workspace use for the {infer} task. + +`rate_limit`::: +(Optional, object) +By default, the `alibabacloud-ai-search` service sets the number of requests allowed per minute to `1000`. +This helps to minimize the number of rate limit errors returned from Amazon Bedrock. +To modify this, set the `requests_per_minute` setting of this object in your service settings: ++ +-- +include::inference-shared.asciidoc[tag=request-per-minute-example] +-- + +`task_settings`:: +(Optional, object) +include::inference-shared.asciidoc[tag=task-settings] ++ +.`task_settings` for the `text_embedding` task type +[%collapsible%closed] +===== +`input_type`::: +(Optional, string) +Specifies the type of input passed to the model. +Valid values are: +* `ingest`: use it for storing document embeddings in a vector database. +* `search`: use it for storing embeddings of search queries run against a vector database to find relevant documents. ++ + +===== ++ +.`task_settings` for the `sparse_embedding` task type +[%collapsible%closed] +===== +`input_type`::: +(Optional, string) +Specifies the type of input passed to the model. +Valid values are: +* `ingest`: use it for storing document embeddings in a vector database. +* `search`: use it for storing embeddings of search queries run against a vector database to find relevant documents. ++ + +`return_token`::: +(Optional, boolean) +Specify Whether to return the token name, the default value is false, it means that it will return the token id. + +===== ++ +.`task_settings` for the `rerank` task type +[%collapsible%closed] +===== + +There are no `task_settings` available for the `rerank` task type. + +===== + +[discrete] +[[inference-example-alibabacloud-ai-search]] +==== AlibabaCloud AI Search service example + +The following example shows how to create an {infer} endpoint called `alibabacloud_ai_search_embeddings` to perform a `text_embedding` task type. + +[source,console] +------------------------------------------------------------ +PUT _inference/text_embedding/alibabacloud_ai_search_embeddings +{ + "service": "alibabacloud-ai-search", + "service_settings": { + "api_key": "", + "service_id": "ops-text-embedding-001", + "host": "default-j01.platform-cn-shanghai.opensearch.aliyuncs.com", + "workspace": "default" + } +} +------------------------------------------------------------ +// TEST[skip:TBD] + +The following example shows how to create an {infer} endpoint called +`alibabacloud_ai_search_sparse` to perform a `sparse_embedding` task type. + +[source,console] +------------------------------------------------------------ +PUT _inference/sparse_embedding/alibabacloud_ai_search_sparse +{ + "service": "alibabacloud-ai-search", + "service_settings": { + "api_key": "", + "service_id": "ops-text-sparse-embedding-001", + "host": "default-j01.platform-cn-shanghai.opensearch.aliyuncs.com", + "workspace": "default" + } +} +------------------------------------------------------------ +// TEST[skip:TBD] + +The next example shows how to create an {infer} endpoint called +`alibabacloud_ai_search_rerank` to perform a `rerank` task type. + +[source,console] +------------------------------------------------------------ +PUT _inference/rerank/alibabacloud_ai_search_rerank +{ + "service": "alibabacloud-ai-search", + "service_settings": { + "api_key": "", + "service_id": "ops-bge-reranker-larger", + "host": "default-j01.platform-cn-shanghai.opensearch.aliyuncs.com", + "workspace": "default" + } +} +------------------------------------------------------------ +// TEST[skip:TBD] diff --git a/docs/reference/search/search-your-data/semantic-search-inference.asciidoc b/docs/reference/search/search-your-data/semantic-search-inference.asciidoc index f74bc65e31bf0..719aeb070fc7c 100644 --- a/docs/reference/search/search-your-data/semantic-search-inference.asciidoc +++ b/docs/reference/search/search-your-data/semantic-search-inference.asciidoc @@ -17,6 +17,7 @@ Azure based examples use models available through https://ai.azure.com/explore/m or https://learn.microsoft.com/en-us/azure/ai-services/openai/concepts/models[Azure OpenAI]. Mistral examples use the `mistral-embed` model from https://docs.mistral.ai/getting-started/models/[the Mistral API]. Amazon Bedrock examples use the `amazon.titan-embed-text-v1` model from https://docs.aws.amazon.com/bedrock/latest/userguide/model-ids.html[the Amazon Bedrock base models]. +AlibabaCloud AI Search examples use the `ops-text-embedding-zh-001` model from https://help.aliyun.com/zh/open-search/search-platform/developer-reference/text-embedding-api-details[the AlibabaCloud AI Search base models]. Click the name of the service you want to use on any of the widgets below to review the corresponding instructions. diff --git a/docs/reference/tab-widgets/inference-api/infer-api-ingest-pipeline-widget.asciidoc b/docs/reference/tab-widgets/inference-api/infer-api-ingest-pipeline-widget.asciidoc index 997dbbe8a20e6..3a686e27cf580 100644 --- a/docs/reference/tab-widgets/inference-api/infer-api-ingest-pipeline-widget.asciidoc +++ b/docs/reference/tab-widgets/inference-api/infer-api-ingest-pipeline-widget.asciidoc @@ -49,6 +49,12 @@ id="infer-api-ingest-amazon-bedrock"> Amazon Bedrock +
+
diff --git a/docs/reference/tab-widgets/inference-api/infer-api-ingest-pipeline.asciidoc b/docs/reference/tab-widgets/inference-api/infer-api-ingest-pipeline.asciidoc index 6adf3d2ebbf46..6678b60fabc40 100644 --- a/docs/reference/tab-widgets/inference-api/infer-api-ingest-pipeline.asciidoc +++ b/docs/reference/tab-widgets/inference-api/infer-api-ingest-pipeline.asciidoc @@ -216,3 +216,29 @@ PUT _ingest/pipeline/amazon_bedrock_embeddings and the `output_field` that will contain the {infer} results. // end::amazon-bedrock[] + +// tag::alibabacloud-ai-search[] + +[source,console] +-------------------------------------------------- +PUT _ingest/pipeline/alibabacloud_ai_search_embeddings +{ + "processors": [ + { + "inference": { + "model_id": "alibabacloud_ai_search_embeddings", <1> + "input_output": { <2> + "input_field": "content", + "output_field": "content_embedding" + } + } + } + ] +} +-------------------------------------------------- +<1> The name of the inference endpoint you created by using the +<>, it's referred to as `inference_id` in that step. +<2> Configuration object that defines the `input_field` for the {infer} process +and the `output_field` that will contain the {infer} results. + +// end::alibabacloud-ai-search[] diff --git a/docs/reference/tab-widgets/inference-api/infer-api-mapping-widget.asciidoc b/docs/reference/tab-widgets/inference-api/infer-api-mapping-widget.asciidoc index 4e3a453a7bbea..66b790bdd57a5 100644 --- a/docs/reference/tab-widgets/inference-api/infer-api-mapping-widget.asciidoc +++ b/docs/reference/tab-widgets/inference-api/infer-api-mapping-widget.asciidoc @@ -49,6 +49,12 @@ id="infer-api-mapping-amazon-bedrock"> Amazon Bedrock +
+
diff --git a/docs/reference/tab-widgets/inference-api/infer-api-mapping.asciidoc b/docs/reference/tab-widgets/inference-api/infer-api-mapping.asciidoc index abeeb87f03e75..c86538ceb9c87 100644 --- a/docs/reference/tab-widgets/inference-api/infer-api-mapping.asciidoc +++ b/docs/reference/tab-widgets/inference-api/infer-api-mapping.asciidoc @@ -270,3 +270,35 @@ the {infer} pipeline configuration in the next step. <6> The field type which is text in this example. // end::amazon-bedrock[] + +// tag::alibabacloud-ai-search[] + +[source,console] +-------------------------------------------------- +PUT alibabacloud-ai-search-embeddings +{ + "mappings": { + "properties": { + "content_embedding": { <1> + "type": "dense_vector", <2> + "dims": 1024, <3> + "element_type": "float" + }, + "content": { <4> + "type": "text" <5> + } + } + } +} +-------------------------------------------------- +<1> The name of the field to contain the generated tokens. It must be referenced +in the {infer} pipeline configuration in the next step. +<2> The field to contain the tokens is a `dense_vector` field. +<3> The output dimensions of the model. This value may be different depending on the underlying model used. +See the https://help.aliyun.com/zh/open-search/search-platform/developer-reference/text-embedding-api-details[AlibabaCloud AI Search embedding model] documentation. +<4> The name of the field from which to create the dense vector representation. +In this example, the name of the field is `content`. It must be referenced in +the {infer} pipeline configuration in the next step. +<5> The field type which is text in this example. + +// end::alibabacloud-ai-search[] diff --git a/docs/reference/tab-widgets/inference-api/infer-api-reindex-widget.asciidoc b/docs/reference/tab-widgets/inference-api/infer-api-reindex-widget.asciidoc index 45cb9fc51b9f1..86f52fee2063c 100644 --- a/docs/reference/tab-widgets/inference-api/infer-api-reindex-widget.asciidoc +++ b/docs/reference/tab-widgets/inference-api/infer-api-reindex-widget.asciidoc @@ -49,6 +49,12 @@ id="infer-api-reindex-amazon-bedrock"> Amazon Bedrock +
+
diff --git a/docs/reference/tab-widgets/inference-api/infer-api-reindex.asciidoc b/docs/reference/tab-widgets/inference-api/infer-api-reindex.asciidoc index d961ec8bd39bd..25d4023c650c0 100644 --- a/docs/reference/tab-widgets/inference-api/infer-api-reindex.asciidoc +++ b/docs/reference/tab-widgets/inference-api/infer-api-reindex.asciidoc @@ -200,3 +200,26 @@ number makes the update of the reindexing process quicker which enables you to follow the progress closely and detect errors early. // end::amazon-bedrock[] + +// tag::alibabacloud-ai-search[] + +[source,console] +---- +POST _reindex?wait_for_completion=false +{ + "source": { + "index": "test-data", + "size": 50 <1> + }, + "dest": { + "index": "alibabacloud-ai-search-embeddings", + "pipeline": "alibabacloud_ai_search_embeddings" + } +} +---- +// TEST[skip:TBD] +<1> The default batch size for reindexing is 1000. Reducing `size` to a smaller +number makes the update of the reindexing process quicker which enables you to +follow the progress closely and detect errors early. + +// end::alibabacloud-ai-search[] diff --git a/docs/reference/tab-widgets/inference-api/infer-api-requirements-widget.asciidoc b/docs/reference/tab-widgets/inference-api/infer-api-requirements-widget.asciidoc index c867b39b88e3b..fb686a2d8be12 100644 --- a/docs/reference/tab-widgets/inference-api/infer-api-requirements-widget.asciidoc +++ b/docs/reference/tab-widgets/inference-api/infer-api-requirements-widget.asciidoc @@ -49,6 +49,12 @@ id="infer-api-requirements-amazon-bedrock"> Amazon Bedrock +
+
diff --git a/docs/reference/tab-widgets/inference-api/infer-api-requirements.asciidoc b/docs/reference/tab-widgets/inference-api/infer-api-requirements.asciidoc index 603cd85a8f93d..38907ee0e27be 100644 --- a/docs/reference/tab-widgets/inference-api/infer-api-requirements.asciidoc +++ b/docs/reference/tab-widgets/inference-api/infer-api-requirements.asciidoc @@ -52,3 +52,9 @@ You can apply for access to Azure OpenAI by completing the form at https://aka.m * A pair of access and secret keys used to access Amazon Bedrock // end::amazon-bedrock[] + +// tag::alibabacloud-ai-search[] +* An AlibabaCloud Account with https://console.aliyun.com[AlibabaCloud] access +* An API key generated for your account from https://opensearch.console.aliyun.com/cn-shanghai/rag/api-key[API keys section] + +// end::alibabacloud-ai-search[] diff --git a/docs/reference/tab-widgets/inference-api/infer-api-search-widget.asciidoc b/docs/reference/tab-widgets/inference-api/infer-api-search-widget.asciidoc index fa4a11c59a158..996148d80a4bd 100644 --- a/docs/reference/tab-widgets/inference-api/infer-api-search-widget.asciidoc +++ b/docs/reference/tab-widgets/inference-api/infer-api-search-widget.asciidoc @@ -49,6 +49,12 @@ id="infer-api-search-amazon-bedrock"> Amazon Bedrock +
+
diff --git a/docs/reference/tab-widgets/inference-api/infer-api-search.asciidoc b/docs/reference/tab-widgets/inference-api/infer-api-search.asciidoc index f23ed1dfef05d..fe1f58b6bd1a9 100644 --- a/docs/reference/tab-widgets/inference-api/infer-api-search.asciidoc +++ b/docs/reference/tab-widgets/inference-api/infer-api-search.asciidoc @@ -531,3 +531,68 @@ query from the `amazon-bedrock-embeddings` index sorted by their proximity to th // NOTCONSOLE // end::amazon-bedrock[] + +// tag::alibabacloud-ai-search[] + +[source,console] +-------------------------------------------------- +GET alibabacloud-ai-search-embeddings/_search +{ + "knn": { + "field": "content_embedding", + "query_vector_builder": { + "text_embedding": { + "model_id": "alibabacloud_ai_search_embeddings", + "model_text": "Calculate fuel cost" + } + }, + "k": 10, + "num_candidates": 100 + }, + "_source": [ + "id", + "content" + ] +} +-------------------------------------------------- +// TEST[skip:TBD] + +As a result, you receive the top 10 documents that are closest in meaning to the +query from the `alibabacloud-ai-search-embeddings` index sorted by their proximity to the query: + +[source,consol-result] +-------------------------------------------------- +"hits": [ + { + "_index": "alibabacloud-ai-search-embeddings", + "_id": "DDd5OowBHxQKHyc3TDSC", + "_score": 0.83704096, + "_source": { + "id": 862114, + "body": "How to calculate fuel cost for a road trip. By Tara Baukus Mello • Bankrate.com. Dear Driving for Dollars, My family is considering taking a long road trip to finish off the end of the summer, but I'm a little worried about gas prices and our overall fuel cost.It doesn't seem easy to calculate since we'll be traveling through many states and we are considering several routes.y family is considering taking a long road trip to finish off the end of the summer, but I'm a little worried about gas prices and our overall fuel cost. It doesn't seem easy to calculate since we'll be traveling through many states and we are considering several routes." + } + }, + { + "_index": "alibabacloud-ai-search-embeddings", + "_id": "ajd5OowBHxQKHyc3TDSC", + "_score": 0.8345704, + "_source": { + "id": 820622, + "body": "Home Heating Calculator. Typically, approximately 50% of the energy consumed in a home annually is for space heating. When deciding on a heating system, many factors will come into play: cost of fuel, installation cost, convenience and life style are all important.This calculator can help you estimate the cost of fuel for different heating appliances.hen deciding on a heating system, many factors will come into play: cost of fuel, installation cost, convenience and life style are all important. This calculator can help you estimate the cost of fuel for different heating appliances." + } + }, + { + "_index": "alibabacloud-ai-search-embeddings", + "_id": "Djd5OowBHxQKHyc3TDSC", + "_score": 0.8327426, + "_source": { + "id": 8202683, + "body": "Fuel is another important cost. This cost will depend on your boat, how far you travel, and how fast you travel. A 33-foot sailboat traveling at 7 knots should be able to travel 300 miles on 50 gallons of diesel fuel.If you are paying $4 per gallon, the trip would cost you $200.Most boats have much larger gas tanks than cars.uel is another important cost. This cost will depend on your boat, how far you travel, and how fast you travel. A 33-foot sailboat traveling at 7 knots should be able to travel 300 miles on 50 gallons of diesel fuel." + } + }, + (...) + ] +-------------------------------------------------- +// NOTCONSOLE + +// end::alibabacloud-ai-search[] diff --git a/docs/reference/tab-widgets/inference-api/infer-api-task-widget.asciidoc b/docs/reference/tab-widgets/inference-api/infer-api-task-widget.asciidoc index f12be341d866d..1dfa6077553fe 100644 --- a/docs/reference/tab-widgets/inference-api/infer-api-task-widget.asciidoc +++ b/docs/reference/tab-widgets/inference-api/infer-api-task-widget.asciidoc @@ -49,6 +49,12 @@ id="infer-api-task-amazon-bedrock"> Amazon Bedrock +
+
diff --git a/docs/reference/tab-widgets/inference-api/infer-api-task.asciidoc b/docs/reference/tab-widgets/inference-api/infer-api-task.asciidoc index b186b2c58ccc5..2b4aa1a200102 100644 --- a/docs/reference/tab-widgets/inference-api/infer-api-task.asciidoc +++ b/docs/reference/tab-widgets/inference-api/infer-api-task.asciidoc @@ -223,3 +223,32 @@ PUT _inference/text_embedding/amazon_bedrock_embeddings <1> <6> The model ID or ARN of the model to use. // end::amazon-bedrock[] + +// tag::alibabacloud-ai-search[] + +[source,console] +------------------------------------------------------------ +PUT _inference/text_embedding/alibabacloud_ai_search_embeddings <1> +{ + "service": "alibabacloud-ai-search", + "service_settings": { + "api_key": "", <2> + "service_id": "", <3> + "host": "", <4> + "workspace": "" <5> + } +} +------------------------------------------------------------ +// TEST[skip:TBD] +<1> The task type is `text_embedding` in the path and the `inference_id` which is the unique identifier of the {infer} endpoint is `alibabacloud_ai_search_embeddings`. +<2> The API key for accessing the AlibabaCloud AI Search API. You can find your API keys in +your AlibabaCloud account under the +https://opensearch.console.aliyun.com/cn-shanghai/rag/api-key[API keys section]. You need to provide +your API key only once. The <> does not return your API +key. +<3> The AlibabaCloud AI Search embeddings model name, for example `ops-text-embedding-zh-001`. +<4> The name our your AlibabaCloud AI Search host address. +<5> The name our your AlibabaCloud AI Search workspace. + +// end::alibabacloud-ai-search[] + From ed88bd93db2e92d8ea221a08251a279edf042f37 Mon Sep 17 00:00:00 2001 From: weizijun Date: Wed, 28 Aug 2024 17:26:43 +0800 Subject: [PATCH 02/20] fixup --- .../reference/inference/service-alibabacloud-ai-search.asciidoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/reference/inference/service-alibabacloud-ai-search.asciidoc b/docs/reference/inference/service-alibabacloud-ai-search.asciidoc index 1f04ea6c2f242..a88618a415c84 100644 --- a/docs/reference/inference/service-alibabacloud-ai-search.asciidoc +++ b/docs/reference/inference/service-alibabacloud-ai-search.asciidoc @@ -86,7 +86,7 @@ The name of the workspace use for the {infer} task. `rate_limit`::: (Optional, object) By default, the `alibabacloud-ai-search` service sets the number of requests allowed per minute to `1000`. -This helps to minimize the number of rate limit errors returned from Amazon Bedrock. +This helps to minimize the number of rate limit errors returned from AlibabaCloud AI Search. To modify this, set the `requests_per_minute` setting of this object in your service settings: + -- From b3fdcec0c8d3a2e084541628065f541843a6fdf7 Mon Sep 17 00:00:00 2001 From: weizijun Date: Wed, 28 Aug 2024 17:38:54 +0800 Subject: [PATCH 03/20] changelog --- docs/changelog/112273.yaml | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 docs/changelog/112273.yaml diff --git a/docs/changelog/112273.yaml b/docs/changelog/112273.yaml new file mode 100644 index 0000000000000..3182a1884a145 --- /dev/null +++ b/docs/changelog/112273.yaml @@ -0,0 +1,5 @@ +pr: 111181 +summary: "[Inference API] Add Docs for AlibabaCloud AI Search Support for the Inference API" +area: Machine Learning +type: enhancement +issues: [ ] From 7e9906efa0e6de98f68e350fdf8787fda5bbca1c Mon Sep 17 00:00:00 2001 From: weizijun Date: Wed, 28 Aug 2024 22:47:52 +0800 Subject: [PATCH 04/20] Update docs/reference/tab-widgets/inference-api/infer-api-requirements.asciidoc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: István Zoltán Szabó --- .../tab-widgets/inference-api/infer-api-requirements.asciidoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/reference/tab-widgets/inference-api/infer-api-requirements.asciidoc b/docs/reference/tab-widgets/inference-api/infer-api-requirements.asciidoc index 38907ee0e27be..c9e7ca8b80ba6 100644 --- a/docs/reference/tab-widgets/inference-api/infer-api-requirements.asciidoc +++ b/docs/reference/tab-widgets/inference-api/infer-api-requirements.asciidoc @@ -55,6 +55,6 @@ You can apply for access to Azure OpenAI by completing the form at https://aka.m // tag::alibabacloud-ai-search[] * An AlibabaCloud Account with https://console.aliyun.com[AlibabaCloud] access -* An API key generated for your account from https://opensearch.console.aliyun.com/cn-shanghai/rag/api-key[API keys section] +* An API key generated for your account from the https://opensearch.console.aliyun.com/cn-shanghai/rag/api-key[API keys section] // end::alibabacloud-ai-search[] From 14bacad46b50c774fdff05e060cae3edb48890b0 Mon Sep 17 00:00:00 2001 From: weizijun Date: Wed, 28 Aug 2024 22:48:16 +0800 Subject: [PATCH 05/20] Update docs/reference/inference/service-alibabacloud-ai-search.asciidoc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: István Zoltán Szabó --- .../reference/inference/service-alibabacloud-ai-search.asciidoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/reference/inference/service-alibabacloud-ai-search.asciidoc b/docs/reference/inference/service-alibabacloud-ai-search.asciidoc index a88618a415c84..28162e395b581 100644 --- a/docs/reference/inference/service-alibabacloud-ai-search.asciidoc +++ b/docs/reference/inference/service-alibabacloud-ai-search.asciidoc @@ -137,7 +137,7 @@ There are no `task_settings` available for the `rerank` task type. [discrete] [[inference-example-alibabacloud-ai-search]] -==== AlibabaCloud AI Search service example +==== AlibabaCloud AI Search service examples The following example shows how to create an {infer} endpoint called `alibabacloud_ai_search_embeddings` to perform a `text_embedding` task type. From d93f329ae89e9eb52517fa4da2a278444b33819b Mon Sep 17 00:00:00 2001 From: weizijun Date: Wed, 28 Aug 2024 22:48:26 +0800 Subject: [PATCH 06/20] Update docs/reference/inference/service-alibabacloud-ai-search.asciidoc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: István Zoltán Szabó --- .../inference/service-alibabacloud-ai-search.asciidoc | 8 -------- 1 file changed, 8 deletions(-) diff --git a/docs/reference/inference/service-alibabacloud-ai-search.asciidoc b/docs/reference/inference/service-alibabacloud-ai-search.asciidoc index 28162e395b581..3c508859994cb 100644 --- a/docs/reference/inference/service-alibabacloud-ai-search.asciidoc +++ b/docs/reference/inference/service-alibabacloud-ai-search.asciidoc @@ -125,14 +125,6 @@ Valid values are: (Optional, boolean) Specify Whether to return the token name, the default value is false, it means that it will return the token id. -===== -+ -.`task_settings` for the `rerank` task type -[%collapsible%closed] -===== - -There are no `task_settings` available for the `rerank` task type. - ===== [discrete] From 74a96f898c3233330066968c617c08df267e90ad Mon Sep 17 00:00:00 2001 From: weizijun Date: Wed, 28 Aug 2024 22:48:36 +0800 Subject: [PATCH 07/20] Update docs/reference/inference/service-alibabacloud-ai-search.asciidoc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: István Zoltán Szabó --- docs/reference/inference/service-alibabacloud-ai-search.asciidoc | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/reference/inference/service-alibabacloud-ai-search.asciidoc b/docs/reference/inference/service-alibabacloud-ai-search.asciidoc index 3c508859994cb..5eaca4708b487 100644 --- a/docs/reference/inference/service-alibabacloud-ai-search.asciidoc +++ b/docs/reference/inference/service-alibabacloud-ai-search.asciidoc @@ -124,7 +124,6 @@ Valid values are: `return_token`::: (Optional, boolean) Specify Whether to return the token name, the default value is false, it means that it will return the token id. - ===== [discrete] From 2a0fa1494b9bac70d677b5c1b71ddd09e913c7b0 Mon Sep 17 00:00:00 2001 From: weizijun Date: Wed, 28 Aug 2024 22:48:42 +0800 Subject: [PATCH 08/20] Update docs/reference/inference/service-alibabacloud-ai-search.asciidoc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: István Zoltán Szabó --- .../reference/inference/service-alibabacloud-ai-search.asciidoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/reference/inference/service-alibabacloud-ai-search.asciidoc b/docs/reference/inference/service-alibabacloud-ai-search.asciidoc index 5eaca4708b487..bd501c032bff8 100644 --- a/docs/reference/inference/service-alibabacloud-ai-search.asciidoc +++ b/docs/reference/inference/service-alibabacloud-ai-search.asciidoc @@ -123,7 +123,7 @@ Valid values are: `return_token`::: (Optional, boolean) -Specify Whether to return the token name, the default value is false, it means that it will return the token id. +If `true`, the token name will be returned in the response. Defaults to `false` which means only the token ID will be returned in the response. ===== [discrete] From 963e6976f689e244bca5df5ab64d064c91835014 Mon Sep 17 00:00:00 2001 From: weizijun Date: Wed, 28 Aug 2024 22:48:49 +0800 Subject: [PATCH 09/20] Update docs/reference/inference/service-alibabacloud-ai-search.asciidoc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: István Zoltán Szabó --- .../reference/inference/service-alibabacloud-ai-search.asciidoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/reference/inference/service-alibabacloud-ai-search.asciidoc b/docs/reference/inference/service-alibabacloud-ai-search.asciidoc index bd501c032bff8..d3a088555b811 100644 --- a/docs/reference/inference/service-alibabacloud-ai-search.asciidoc +++ b/docs/reference/inference/service-alibabacloud-ai-search.asciidoc @@ -73,7 +73,7 @@ for the `rerank` task are: * `ops-bge-reranker-larger` -You can find the supported `rerank` service_id at https://help.aliyun.com/zh/open-search/search-platform/developer-reference/ranker-api-details[rerank detail] +For the supported `rerank` service_id, refer to the https://help.aliyun.com/zh/open-search/search-platform/developer-reference/ranker-api-details[documentation]. `host`::: (Required, string) From 324909e899f567166ad1fe2dbf0fd4ecef4aa83c Mon Sep 17 00:00:00 2001 From: weizijun Date: Wed, 28 Aug 2024 22:48:55 +0800 Subject: [PATCH 10/20] Update docs/reference/inference/service-alibabacloud-ai-search.asciidoc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: István Zoltán Szabó --- .../reference/inference/service-alibabacloud-ai-search.asciidoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/reference/inference/service-alibabacloud-ai-search.asciidoc b/docs/reference/inference/service-alibabacloud-ai-search.asciidoc index d3a088555b811..039895b30b7e4 100644 --- a/docs/reference/inference/service-alibabacloud-ai-search.asciidoc +++ b/docs/reference/inference/service-alibabacloud-ai-search.asciidoc @@ -69,7 +69,7 @@ for the `sparse_embedding` task are: You can find the supported `sparse_embedding` service_id at https://help.aliyun.com/zh/open-search/search-platform/developer-reference/text-sparse-embedding-api-details[sparse embedding detail] -for the `rerank` task are: +The service_id available for the `rerank` task is: * `ops-bge-reranker-larger` From 6d5e490ff595e08bdf6b53c6b0ef252d0efb8b14 Mon Sep 17 00:00:00 2001 From: weizijun Date: Wed, 28 Aug 2024 22:49:01 +0800 Subject: [PATCH 11/20] Update docs/reference/inference/service-alibabacloud-ai-search.asciidoc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: István Zoltán Szabó --- .../reference/inference/service-alibabacloud-ai-search.asciidoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/reference/inference/service-alibabacloud-ai-search.asciidoc b/docs/reference/inference/service-alibabacloud-ai-search.asciidoc index 039895b30b7e4..c925fd701f5a6 100644 --- a/docs/reference/inference/service-alibabacloud-ai-search.asciidoc +++ b/docs/reference/inference/service-alibabacloud-ai-search.asciidoc @@ -67,7 +67,7 @@ for the `sparse_embedding` task are: * `ops-text-sparse-embedding-001` -You can find the supported `sparse_embedding` service_id at https://help.aliyun.com/zh/open-search/search-platform/developer-reference/text-sparse-embedding-api-details[sparse embedding detail] +For the supported `sparse_embedding` service_id, refer to the https://help.aliyun.com/zh/open-search/search-platform/developer-reference/text-sparse-embedding-api-details[documentation]. The service_id available for the `rerank` task is: From 254816d2c734d744cb472bb12adf1b9800dd4455 Mon Sep 17 00:00:00 2001 From: weizijun Date: Wed, 28 Aug 2024 22:49:07 +0800 Subject: [PATCH 12/20] Update docs/reference/inference/service-alibabacloud-ai-search.asciidoc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: István Zoltán Szabó --- .../reference/inference/service-alibabacloud-ai-search.asciidoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/reference/inference/service-alibabacloud-ai-search.asciidoc b/docs/reference/inference/service-alibabacloud-ai-search.asciidoc index c925fd701f5a6..1e5120c5941df 100644 --- a/docs/reference/inference/service-alibabacloud-ai-search.asciidoc +++ b/docs/reference/inference/service-alibabacloud-ai-search.asciidoc @@ -63,7 +63,7 @@ The service_id available for the `text_embedding` task are: You can find the supported `text_embedding` service_id at https://help.aliyun.com/zh/open-search/search-platform/developer-reference/text-embedding-api-details[embedding detail] -for the `sparse_embedding` task are: +The service_id available for the `sparse_embedding` task is: * `ops-text-sparse-embedding-001` From eb7fb0c770a8bf35b36ded3af18e9d2870cf3882 Mon Sep 17 00:00:00 2001 From: weizijun Date: Wed, 28 Aug 2024 22:49:14 +0800 Subject: [PATCH 13/20] Update docs/reference/inference/service-alibabacloud-ai-search.asciidoc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: István Zoltán Szabó --- .../reference/inference/service-alibabacloud-ai-search.asciidoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/reference/inference/service-alibabacloud-ai-search.asciidoc b/docs/reference/inference/service-alibabacloud-ai-search.asciidoc index 1e5120c5941df..bc8583d59203b 100644 --- a/docs/reference/inference/service-alibabacloud-ai-search.asciidoc +++ b/docs/reference/inference/service-alibabacloud-ai-search.asciidoc @@ -61,7 +61,7 @@ The service_id available for the `text_embedding` task are: * `ops-text-embedding-en-001` * `ops-text-embedding-002` -You can find the supported `text_embedding` service_id at https://help.aliyun.com/zh/open-search/search-platform/developer-reference/text-embedding-api-details[embedding detail] +For the supported `text_embedding` service_id, refer to the https://help.aliyun.com/zh/open-search/search-platform/developer-reference/text-embedding-api-details[documentation]. The service_id available for the `sparse_embedding` task is: From e25a57a1b67db14048cb3cff4bcf68965d6c24e2 Mon Sep 17 00:00:00 2001 From: weizijun Date: Wed, 28 Aug 2024 22:49:24 +0800 Subject: [PATCH 14/20] Update docs/reference/inference/service-alibabacloud-ai-search.asciidoc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: István Zoltán Szabó --- .../reference/inference/service-alibabacloud-ai-search.asciidoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/reference/inference/service-alibabacloud-ai-search.asciidoc b/docs/reference/inference/service-alibabacloud-ai-search.asciidoc index bc8583d59203b..b7f82a373ae32 100644 --- a/docs/reference/inference/service-alibabacloud-ai-search.asciidoc +++ b/docs/reference/inference/service-alibabacloud-ai-search.asciidoc @@ -77,7 +77,7 @@ For the supported `rerank` service_id, refer to the https://help.aliyun.com/zh/o `host`::: (Required, string) -The name of the host address use for the {infer} task. You can find the host address at https://opensearch.console.aliyun.com/cn-shanghai/rag/api-key[API keys section] +The name of the host address used for the {infer} task. You can find the host address at https://opensearch.console.aliyun.com/cn-shanghai/rag/api-key[ the API keys section] of the documentation. `workspace`::: (Required, string) From 877ed95002f2c3218debf008aaf1635790d33834 Mon Sep 17 00:00:00 2001 From: weizijun Date: Wed, 28 Aug 2024 22:49:34 +0800 Subject: [PATCH 15/20] Update docs/reference/inference/service-alibabacloud-ai-search.asciidoc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: István Zoltán Szabó --- .../reference/inference/service-alibabacloud-ai-search.asciidoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/reference/inference/service-alibabacloud-ai-search.asciidoc b/docs/reference/inference/service-alibabacloud-ai-search.asciidoc index b7f82a373ae32..154a85620353c 100644 --- a/docs/reference/inference/service-alibabacloud-ai-search.asciidoc +++ b/docs/reference/inference/service-alibabacloud-ai-search.asciidoc @@ -81,7 +81,7 @@ The name of the host address used for the {infer} task. You can find the host ad `workspace`::: (Required, string) -The name of the workspace use for the {infer} task. +The name of the workspace used for the {infer} task. `rate_limit`::: (Optional, object) From d480eb0f5fb1e23afe9a336339140c94ed87bc7b Mon Sep 17 00:00:00 2001 From: weizijun Date: Wed, 28 Aug 2024 22:49:44 +0800 Subject: [PATCH 16/20] Update docs/reference/inference/service-alibabacloud-ai-search.asciidoc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: István Zoltán Szabó --- .../inference/service-alibabacloud-ai-search.asciidoc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/reference/inference/service-alibabacloud-ai-search.asciidoc b/docs/reference/inference/service-alibabacloud-ai-search.asciidoc index 154a85620353c..678561024785b 100644 --- a/docs/reference/inference/service-alibabacloud-ai-search.asciidoc +++ b/docs/reference/inference/service-alibabacloud-ai-search.asciidoc @@ -104,8 +104,8 @@ include::inference-shared.asciidoc[tag=task-settings] (Optional, string) Specifies the type of input passed to the model. Valid values are: -* `ingest`: use it for storing document embeddings in a vector database. -* `search`: use it for storing embeddings of search queries run against a vector database to find relevant documents. +* `ingest`: for storing document embeddings in a vector database. +* `search`: for storing embeddings of search queries run against a vector database to find relevant documents. + ===== From 294db2978ef7454586f803d31f166060483c6467 Mon Sep 17 00:00:00 2001 From: weizijun Date: Wed, 28 Aug 2024 22:49:55 +0800 Subject: [PATCH 17/20] Update docs/reference/inference/service-alibabacloud-ai-search.asciidoc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: István Zoltán Szabó --- .../reference/inference/service-alibabacloud-ai-search.asciidoc | 2 -- 1 file changed, 2 deletions(-) diff --git a/docs/reference/inference/service-alibabacloud-ai-search.asciidoc b/docs/reference/inference/service-alibabacloud-ai-search.asciidoc index 678561024785b..0e421e2f1be9d 100644 --- a/docs/reference/inference/service-alibabacloud-ai-search.asciidoc +++ b/docs/reference/inference/service-alibabacloud-ai-search.asciidoc @@ -106,8 +106,6 @@ Specifies the type of input passed to the model. Valid values are: * `ingest`: for storing document embeddings in a vector database. * `search`: for storing embeddings of search queries run against a vector database to find relevant documents. -+ - ===== + .`task_settings` for the `sparse_embedding` task type From b671b3dec464ed8c665a62cd542748aaad9a877b Mon Sep 17 00:00:00 2001 From: weizijun Date: Wed, 28 Aug 2024 22:50:04 +0800 Subject: [PATCH 18/20] Update docs/reference/inference/service-alibabacloud-ai-search.asciidoc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: István Zoltán Szabó --- docs/reference/inference/service-alibabacloud-ai-search.asciidoc | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/reference/inference/service-alibabacloud-ai-search.asciidoc b/docs/reference/inference/service-alibabacloud-ai-search.asciidoc index 0e421e2f1be9d..35608e0f64672 100644 --- a/docs/reference/inference/service-alibabacloud-ai-search.asciidoc +++ b/docs/reference/inference/service-alibabacloud-ai-search.asciidoc @@ -117,7 +117,6 @@ Specifies the type of input passed to the model. Valid values are: * `ingest`: use it for storing document embeddings in a vector database. * `search`: use it for storing embeddings of search queries run against a vector database to find relevant documents. -+ `return_token`::: (Optional, boolean) From 0d0f6b85232f280e79a80305e0e2482c14305be6 Mon Sep 17 00:00:00 2001 From: weizijun Date: Wed, 28 Aug 2024 22:50:15 +0800 Subject: [PATCH 19/20] Update docs/reference/inference/service-alibabacloud-ai-search.asciidoc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: István Zoltán Szabó --- .../inference/service-alibabacloud-ai-search.asciidoc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/reference/inference/service-alibabacloud-ai-search.asciidoc b/docs/reference/inference/service-alibabacloud-ai-search.asciidoc index 35608e0f64672..554eca2b25ad0 100644 --- a/docs/reference/inference/service-alibabacloud-ai-search.asciidoc +++ b/docs/reference/inference/service-alibabacloud-ai-search.asciidoc @@ -115,8 +115,8 @@ Valid values are: (Optional, string) Specifies the type of input passed to the model. Valid values are: -* `ingest`: use it for storing document embeddings in a vector database. -* `search`: use it for storing embeddings of search queries run against a vector database to find relevant documents. +* `ingest`: for storing document embeddings in a vector database. +* `search`: for storing embeddings of search queries run against a vector database to find relevant documents. `return_token`::: (Optional, boolean) From c591269f21a936ce4318d14ef7e5c4fd3b6ba8cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Istv=C3=A1n=20Zolt=C3=A1n=20Szab=C3=B3?= Date: Wed, 28 Aug 2024 17:28:16 +0200 Subject: [PATCH 20/20] [DOCS] Fixes indentation. --- .../service-alibabacloud-ai-search.asciidoc | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/docs/reference/inference/service-alibabacloud-ai-search.asciidoc b/docs/reference/inference/service-alibabacloud-ai-search.asciidoc index 554eca2b25ad0..df5220573d9e4 100644 --- a/docs/reference/inference/service-alibabacloud-ai-search.asciidoc +++ b/docs/reference/inference/service-alibabacloud-ai-search.asciidoc @@ -53,27 +53,29 @@ A valid API key for the AlibabaCloud AI Search API. `service_id`::: (Required, string) The name of the model service to use for the {infer} task. - -The service_id available for the `text_embedding` task are: ++ +-- +Available service_ids for the `text_embedding` task: * `ops-text-embedding-001` * `ops-text-embedding-zh-001` * `ops-text-embedding-en-001` * `ops-text-embedding-002` -For the supported `text_embedding` service_id, refer to the https://help.aliyun.com/zh/open-search/search-platform/developer-reference/text-embedding-api-details[documentation]. +For the supported `text_embedding` service_ids, refer to the https://help.aliyun.com/zh/open-search/search-platform/developer-reference/text-embedding-api-details[documentation]. -The service_id available for the `sparse_embedding` task is: +Available service_id for the `sparse_embedding` task: * `ops-text-sparse-embedding-001` For the supported `sparse_embedding` service_id, refer to the https://help.aliyun.com/zh/open-search/search-platform/developer-reference/text-sparse-embedding-api-details[documentation]. -The service_id available for the `rerank` task is: +Available service_id for the `rerank` task is: * `ops-bge-reranker-larger` For the supported `rerank` service_id, refer to the https://help.aliyun.com/zh/open-search/search-platform/developer-reference/ranker-api-details[documentation]. +-- `host`::: (Required, string) @@ -93,6 +95,7 @@ To modify this, set the `requests_per_minute` setting of this object in your ser include::inference-shared.asciidoc[tag=request-per-minute-example] -- + `task_settings`:: (Optional, object) include::inference-shared.asciidoc[tag=task-settings]