docs: alibaba cloud (#14772)

The [provider
page](https://python.langchain.com/docs/integrations/providers/alibabacloud_opensearch)
holds the vector store information. The [Chat
example](https://python.langchain.com/docs/integrations/chat/pai_eas_chat_endpoint)
was incorrectly sorted in the navbar because of the wrong file name.
- Recreated a provide page
- Added missed links and descriptions
- Compound information about vector store from two pages into one
- Fixed file name
This commit is contained in:
Leonid Ganeline 2023-12-20 12:32:33 -08:00 committed by GitHub
parent 99f839d6f3
commit 65a9193db2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 121 additions and 53 deletions

View File

@ -5,7 +5,7 @@
"metadata": {}, "metadata": {},
"source": [ "source": [
"---\n", "---\n",
"sidebar_label: AliCloud PAI EAS\n", "sidebar_label: Alibaba Cloud PAI EAS\n",
"---" "---"
] ]
}, },
@ -13,23 +13,29 @@
"cell_type": "markdown", "cell_type": "markdown",
"metadata": {}, "metadata": {},
"source": [ "source": [
"# PaiEasChatEndpoint\n", "# Alibaba Cloud PAI EAS\n",
"Machine Learning Platform for AI of Alibaba Cloud is a machine learning or deep learning engineering platform intended for enterprises and developers. It provides easy-to-use, cost-effective, high-performance, and easy-to-scale plug-ins that can be applied to various industry scenarios. With over 140 built-in optimization algorithms, Machine Learning Platform for AI provides whole-process AI engineering capabilities including data labeling (PAI-iTAG), model building (PAI-Designer and PAI-DSW), model training (PAI-DLC), compilation optimization, and inference deployment (PAI-EAS). PAI-EAS supports different types of hardware resources, including CPUs and GPUs, and features high throughput and low latency. It allows you to deploy large-scale complex models with a few clicks and perform elastic scale-ins and scale-outs in real time. It also provides a comprehensive O&M and monitoring system." "\n",
">[Alibaba Cloud PAI (Platform for AI)](https://www.alibabacloud.com/help/en/pai/?spm=a2c63.p38356.0.0.c26a426ckrxUwZ) is a lightweight and cost-efficient machine learning platform that uses cloud-native technologies. It provides you with an end-to-end modelling service. It accelerates model training based on tens of billions of features and hundreds of billions of samples in more than 100 scenarios.\n",
"\n",
">[Machine Learning Platform for AI of Alibaba Cloud](https://www.alibabacloud.com/help/en/machine-learning-platform-for-ai/latest/what-is-machine-learning-pai) is a machine learning or deep learning engineering platform intended for enterprises and developers. It provides easy-to-use, cost-effective, high-performance, and easy-to-scale plug-ins that can be applied to various industry scenarios. With over 140 built-in optimization algorithms, `Machine Learning Platform for AI` provides whole-process AI engineering capabilities including data labelling (`PAI-iTAG`), model building (`PAI-Designer` and `PAI-DSW`), model training (`PAI-DLC`), compilation optimization, and inference deployment (`PAI-EAS`).\n",
">\n",
">`PAI-EAS` supports different types of hardware resources, including CPUs and GPUs, and features high throughput and low latency. It allows you to deploy large-scale complex models with a few clicks and perform elastic scale-ins and scale-outs in real-time. It also provides a comprehensive O&M and monitoring system."
] ]
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"metadata": {}, "metadata": {},
"source": [ "source": [
"## Setup Eas Service\n", "## Setup EAS Service\n",
"\n", "\n",
"One who want to use eas llms must set up eas service first. When the eas service is launched, eas_service_rul and eas_service token can be got. Users can refer to https://www.alibabacloud.com/help/en/pai/user-guide/service-deployment/ for more information. Try to set environment variables to init eas service url and token:\n", "Set up environment variables to init EAS service URL and token.\n",
"Use [this document](https://www.alibabacloud.com/help/en/pai/user-guide/service-deployment/) for more information.\n",
"\n", "\n",
"```base\n", "```bash\n",
"export EAS_SERVICE_URL=XXX\n", "export EAS_SERVICE_URL=XXX\n",
"export EAS_SERVICE_TOKEN=XXX\n", "export EAS_SERVICE_TOKEN=XXX\n",
"```\n", "```\n",
"or run as follow codes:" "Another option is to use this code:"
] ]
}, },
{ {
@ -56,7 +62,8 @@
"metadata": {}, "metadata": {},
"source": [ "source": [
"## Run Chat Model\n", "## Run Chat Model\n",
"You can use the default settings to call eas service as follows:" "\n",
"You can use the default settings to call EAS service as follows:"
] ]
}, },
{ {
@ -73,7 +80,7 @@
"cell_type": "markdown", "cell_type": "markdown",
"metadata": {}, "metadata": {},
"source": [ "source": [
"Or, call eas service with new inference params:" "Or, call EAS service with new inference params:"
] ]
}, },
{ {
@ -108,7 +115,7 @@
], ],
"metadata": { "metadata": {
"kernelspec": { "kernelspec": {
"display_name": "Python 3", "display_name": "Python 3 (ipykernel)",
"language": "python", "language": "python",
"name": "python3" "name": "python3"
}, },
@ -122,10 +129,9 @@
"name": "python", "name": "python",
"nbconvert_exporter": "python", "nbconvert_exporter": "python",
"pygments_lexer": "ipython3", "pygments_lexer": "ipython3",
"version": "3.10.11" "version": "3.10.12"
}, }
"orig_nbformat": 4
}, },
"nbformat": 4, "nbformat": 4,
"nbformat_minor": 2 "nbformat_minor": 4
} }

View File

@ -0,0 +1,35 @@
# Alibaba Cloud
>[Alibaba Group Holding Limited (Wikipedia)](https://en.wikipedia.org/wiki/Alibaba_Group), or `Alibaba`
> (Chinese: 阿里巴巴), is a Chinese multinational technology company specializing in e-commerce, retail,
> Internet, and technology.
>
> [Alibaba Cloud (Wikipedia)](https://en.wikipedia.org/wiki/Alibaba_Cloud), also known as `Aliyun`
> (Chinese: 阿里云; pinyin: Ālǐyún; lit. 'Ali Cloud'), is a cloud computing company, a subsidiary
> of `Alibaba Group`. `Alibaba Cloud` provides cloud computing services to online businesses and
> Alibaba's own e-commerce ecosystem.
## Chat Model
See [installation instructions and a usage example](/docs/integrations/chat/alibaba_cloud_pai_eas).
```python
from langchain.chat_models import PaiEasChatEndpoint
```
## Vectorstore
See [installation instructions and a usage example](/docs/integrations/vectorstores/alibabacloud_opensearch).
```python
from langchain.vectorstores import AlibabaCloudOpenSearch, AlibabaCloudOpenSearchSettings
```
## Document Loader
See [installation instructions and a usage example](/docs/integrations/document_loaders/alibaba_cloud_maxcompute).
```python
from langchain.document_loaders import MaxComputeLoader
```

View File

@ -1,30 +0,0 @@
# Alibaba Cloud Opensearch
[Alibaba Cloud Opensearch](https://www.alibabacloud.com/product/opensearch) OpenSearch is a one-stop platform to develop intelligent search services. OpenSearch was built based on the large-scale distributed search engine developed by Alibaba. OpenSearch serves more than 500 business cases in Alibaba Group and thousands of Alibaba Cloud customers. OpenSearch helps develop search services in different search scenarios, including e-commerce, O2O, multimedia, the content industry, communities and forums, and big data query in enterprises.
OpenSearch helps you develop high quality, maintenance-free, and high performance intelligent search services to provide your users with high search efficiency and accuracy.
OpenSearch provides the vector search feature. In specific scenarios,especially in question retrieval and image search scenarios, you can use the vector search feature together with the multimodal search feature to improve the accuracy of search results.
## Purchase an instance and configure it
- Purchase OpenSearch Vector Search Edition from [Alibaba Cloud](https://opensearch.console.aliyun.com) and configure the instance according to the help [documentation](https://help.aliyun.com/document_detail/463198.html?spm=a2c4g.465092.0.0.2cd15002hdwavO).
## Alibaba Cloud Opensearch Vector Store Wrappers
supported functions:
- `add_texts`
- `add_documents`
- `from_texts`
- `from_documents`
- `similarity_search`
- `asimilarity_search`
- `similarity_search_by_vector`
- `asimilarity_search_by_vector`
- `similarity_search_with_relevance_scores`
- `delete_doc_by_texts`
For a more detailed walk through of the Alibaba Cloud OpenSearch wrapper, see [this notebook](/docs/integrations/vectorstores/alibabacloud_opensearch)
If you encounter any problems during use, please feel free to contact [xingshaomin.xsm@alibaba-inc.com](xingshaomin.xsm@alibaba-inc.com) , and we will do our best to provide you with assistance and support.

View File

@ -8,20 +8,53 @@
"\n", "\n",
">[Alibaba Cloud Opensearch](https://www.alibabacloud.com/product/opensearch) is a one-stop platform to develop intelligent search services. `OpenSearch` was built on the large-scale distributed search engine developed by `Alibaba`. `OpenSearch` serves more than 500 business cases in Alibaba Group and thousands of Alibaba Cloud customers. `OpenSearch` helps develop search services in different search scenarios, including e-commerce, O2O, multimedia, the content industry, communities and forums, and big data query in enterprises.\n", ">[Alibaba Cloud Opensearch](https://www.alibabacloud.com/product/opensearch) is a one-stop platform to develop intelligent search services. `OpenSearch` was built on the large-scale distributed search engine developed by `Alibaba`. `OpenSearch` serves more than 500 business cases in Alibaba Group and thousands of Alibaba Cloud customers. `OpenSearch` helps develop search services in different search scenarios, including e-commerce, O2O, multimedia, the content industry, communities and forums, and big data query in enterprises.\n",
"\n", "\n",
">`OpenSearch` helps you develop high quality, maintenance-free, and high performance intelligent search services to provide your users with high search efficiency and accuracy.\n", ">`OpenSearch` helps you develop high-quality, maintenance-free, and high-performance intelligent search services to provide your users with high search efficiency and accuracy.\n",
"\n", "\n",
">`OpenSearch` provides the vector search feature. In specific scenarios, especially test question search and image search scenarios, you can use the vector search feature together with the multimodal search feature to improve the accuracy of search results.\n", ">`OpenSearch` provides the vector search feature. In specific scenarios, especially test question search and image search scenarios, you can use the vector search feature together with the multimodal search feature to improve the accuracy of search results.\n",
"\n", "\n",
"This notebook shows how to use functionality related to the `Alibaba Cloud OpenSearch Vector Search Edition`.\n", "This notebook shows how to use functionality related to the `Alibaba Cloud OpenSearch Vector Search Edition`."
"To run, you should have an [OpenSearch Vector Search Edition](https://opensearch.console.aliyun.com) instance up and running:\n", ]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Setting up\n",
"\n", "\n",
"Read the [help document](https://www.alibabacloud.com/help/en/opensearch/latest/vector-search) to quickly familiarize and configure OpenSearch Vector Search Edition instance." "\n",
"### Purchase an instance and configure it\n",
"\n",
"Purchase OpenSearch Vector Search Edition from [Alibaba Cloud](https://opensearch.console.aliyun.com) and configure the instance according to the help [documentation](https://help.aliyun.com/document_detail/463198.html?spm=a2c4g.465092.0.0.2cd15002hdwavO).\n",
"\n",
"To run, you should have an [OpenSearch Vector Search Edition](https://opensearch.console.aliyun.com) instance up and running.\n",
"\n",
" \n",
"### Alibaba Cloud OpenSearch Vector Store class\n",
" `AlibabaCloudOpenSearch` class supports functions:\n",
"- `add_texts`\n",
"- `add_documents`\n",
"- `from_texts`\n",
"- `from_documents`\n",
"- `similarity_search`\n",
"- `asimilarity_search`\n",
"- `similarity_search_by_vector`\n",
"- `asimilarity_search_by_vector`\n",
"- `similarity_search_with_relevance_scores`\n",
"- `delete_doc_by_texts`\n",
"\n",
"\n",
"Read the [help document](https://www.alibabacloud.com/help/en/opensearch/latest/vector-search) to quickly familiarize and configure OpenSearch Vector Search Edition instance.\n",
"\n",
"If you encounter any problems during use, please feel free to contact [xingshaomin.xsm@alibaba-inc.com](xingshaomin.xsm@alibaba-inc.com), and we will do our best to provide you with assistance and support."
] ]
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"metadata": { "metadata": {
"collapsed": false "collapsed": false,
"jupyter": {
"outputs_hidden": false
}
}, },
"source": [ "source": [
"After the instance is up and running, follow these steps to split documents, get embeddings, connect to the alibaba cloud opensearch instance, index documents, and perform vector retrieval." "After the instance is up and running, follow these steps to split documents, get embeddings, connect to the alibaba cloud opensearch instance, index documents, and perform vector retrieval."
@ -30,7 +63,10 @@
{ {
"cell_type": "markdown", "cell_type": "markdown",
"metadata": { "metadata": {
"collapsed": false "collapsed": false,
"jupyter": {
"outputs_hidden": false
}
}, },
"source": [ "source": [
"We need to install the following Python packages first." "We need to install the following Python packages first."
@ -48,7 +84,10 @@
{ {
"cell_type": "markdown", "cell_type": "markdown",
"metadata": { "metadata": {
"collapsed": false "collapsed": false,
"jupyter": {
"outputs_hidden": false
}
}, },
"source": [ "source": [
"We want to use `OpenAIEmbeddings` so we have to get the OpenAI API Key." "We want to use `OpenAIEmbeddings` so we have to get the OpenAI API Key."
@ -59,6 +98,9 @@
"execution_count": null, "execution_count": null,
"metadata": { "metadata": {
"collapsed": false, "collapsed": false,
"jupyter": {
"outputs_hidden": false
},
"pycharm": { "pycharm": {
"name": "#%%\n" "name": "#%%\n"
} }
@ -71,6 +113,13 @@
"os.environ[\"OPENAI_API_KEY\"] = getpass.getpass(\"OpenAI API Key:\")" "os.environ[\"OPENAI_API_KEY\"] = getpass.getpass(\"OpenAI API Key:\")"
] ]
}, },
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example"
]
},
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
@ -359,7 +408,7 @@
"name": "python", "name": "python",
"nbconvert_exporter": "python", "nbconvert_exporter": "python",
"pygments_lexer": "ipython3", "pygments_lexer": "ipython3",
"version": "3.10.6" "version": "3.10.12"
} }
}, },
"nbformat": 4, "nbformat": 4,

View File

@ -1,5 +1,13 @@
{ {
"redirects": [ "redirects": [
{
"source": "docs/docs/integrations/providers/alibabacloud_opensearch",
"destination": "docs/docs/integrations/providers/alibaba_cloud"
},
{
"source": "/docs/integrations/chat/pai_eas_chat_endpoint",
"destination": "/docs/integrations/chat/alibaba_cloud_pai_eas"
},
{ {
"source": "/docs/integrations/providers/tencentvectordb", "source": "/docs/integrations/providers/tencentvectordb",
"destination": "/docs/integrations/providers/tencent" "destination": "/docs/integrations/providers/tencent"