-
Notifications
You must be signed in to change notification settings - Fork 25.5k
[Inference API] Add Docs for AlibabaCloud AI Search Support for the Inference API #112273
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
szabosteve
merged 20 commits into
elastic:main
from
weizijun:add-alibabacloud-inference-doc
Aug 29, 2024
Merged
Changes from 3 commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
9c1fdca
add alibaba cloud ai search inference docs
weizijun ed88bd9
fixup
weizijun b3fdcec
changelog
weizijun 7e9906e
Update docs/reference/tab-widgets/inference-api/infer-api-requirement…
weizijun 14bacad
Update docs/reference/inference/service-alibabacloud-ai-search.asciidoc
weizijun d93f329
Update docs/reference/inference/service-alibabacloud-ai-search.asciidoc
weizijun 74a96f8
Update docs/reference/inference/service-alibabacloud-ai-search.asciidoc
weizijun 2a0fa14
Update docs/reference/inference/service-alibabacloud-ai-search.asciidoc
weizijun 963e697
Update docs/reference/inference/service-alibabacloud-ai-search.asciidoc
weizijun 324909e
Update docs/reference/inference/service-alibabacloud-ai-search.asciidoc
weizijun 6d5e490
Update docs/reference/inference/service-alibabacloud-ai-search.asciidoc
weizijun 254816d
Update docs/reference/inference/service-alibabacloud-ai-search.asciidoc
weizijun eb7fb0c
Update docs/reference/inference/service-alibabacloud-ai-search.asciidoc
weizijun e25a57a
Update docs/reference/inference/service-alibabacloud-ai-search.asciidoc
weizijun 877ed95
Update docs/reference/inference/service-alibabacloud-ai-search.asciidoc
weizijun d480eb0
Update docs/reference/inference/service-alibabacloud-ai-search.asciidoc
weizijun 294db29
Update docs/reference/inference/service-alibabacloud-ai-search.asciidoc
weizijun b671b3d
Update docs/reference/inference/service-alibabacloud-ai-search.asciidoc
weizijun 0d0f6b8
Update docs/reference/inference/service-alibabacloud-ai-search.asciidoc
weizijun c591269
[DOCS] Fixes indentation.
szabosteve File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,5 @@ | ||
pr: 111181 | ||
summary: "[Inference API] Add Docs for AlibabaCloud AI Search Support for the Inference API" | ||
area: Machine Learning | ||
type: enhancement | ||
issues: [ ] |
This file contains hidden or 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 hidden or 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 hidden or 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: | ||
weizijun marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
* `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] | ||
weizijun marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
for the `rerank` task are: | ||
weizijun marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
* `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] | ||
weizijun marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
`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] | ||
weizijun marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
`workspace`::: | ||
(Required, string) | ||
The name of the workspace use for the {infer} task. | ||
weizijun marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
`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 AlibabaCloud AI Search. | ||
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. | ||
weizijun marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
+ | ||
|
||
weizijun marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
===== | ||
+ | ||
.`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. | ||
weizijun marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
+ | ||
weizijun marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
`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. | ||
weizijun marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
weizijun marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
===== | ||
+ | ||
.`task_settings` for the `rerank` task type | ||
[%collapsible%closed] | ||
===== | ||
|
||
There are no `task_settings` available for the `rerank` task type. | ||
|
||
===== | ||
weizijun marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
[discrete] | ||
[[inference-example-alibabacloud-ai-search]] | ||
==== AlibabaCloud AI Search service example | ||
weizijun marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.