forked from elastic/elasticsearch
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add alibaba cloud ai search inference docs
- Loading branch information
Showing
16 changed files
with
479 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
193 changes: 193 additions & 0 deletions
193
docs/reference/inference/service-alibabacloud-ai-search.asciidoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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/<task_type>/<inference_id>` | ||
|
||
[discrete] | ||
[[infer-service-alibabacloud-ai-search-api-path-params]] | ||
==== {api-path-parms-title} | ||
|
||
`<inference_id>`:: | ||
(Required, string) | ||
include::inference-shared.asciidoc[tag=inference-id] | ||
|
||
`<task_type>`:: | ||
(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": "<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": "<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": "<api_key>", | ||
"service_id": "ops-bge-reranker-larger", | ||
"host": "default-j01.platform-cn-shanghai.opensearch.aliyuncs.com", | ||
"workspace": "default" | ||
} | ||
} | ||
------------------------------------------------------------ | ||
// TEST[skip:TBD] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.