From 2861766d0db9d0cb47ee85aa37f3a9c19a22fac1 Mon Sep 17 00:00:00 2001 From: Leonid Ganeline Date: Mon, 18 Dec 2023 18:21:39 -0800 Subject: [PATCH] Docs `tencent` pages update (#14879) - updated `Tencent` provider page: added a chat model and document loader references; company description - updated Chat model and Document loader pages with descriptions, links - renamed files to consistent formats; redirected file names Note: I was getting this linting error on code that **was not changed in my PR**! > Error: docs/docs/guides/safety/hugging_face_prompt_injection.ipynb:1:1: I001 Import block is un-sorted or un-formatted > make: *** [Makefile:47: lint_package] Error 1 I've fixed this error in the notebook --- .../hugging_face_prompt_injection.ipynb | 2 +- .../{hunyuan.ipynb => tencent_hunyuan.ipynb} | 38 ++++++--- .../tencent_cos_directory.ipynb | 11 ++- .../document_loaders/tencent_cos_file.ipynb | 10 ++- docs/docs/integrations/providers/tencent.mdx | 82 +++++++++++++++++++ .../providers/tencentvectordb.mdx | 15 ---- docs/vercel.json | 8 ++ 7 files changed, 138 insertions(+), 28 deletions(-) rename docs/docs/integrations/chat/{hunyuan.ipynb => tencent_hunyuan.ipynb} (78%) create mode 100644 docs/docs/integrations/providers/tencent.mdx delete mode 100644 docs/docs/integrations/providers/tencentvectordb.mdx diff --git a/docs/docs/guides/safety/hugging_face_prompt_injection.ipynb b/docs/docs/guides/safety/hugging_face_prompt_injection.ipynb index 040f7ff2428e4..be41c203346b2 100644 --- a/docs/docs/guides/safety/hugging_face_prompt_injection.ipynb +++ b/docs/docs/guides/safety/hugging_face_prompt_injection.ipynb @@ -49,8 +49,8 @@ }, "outputs": [], "source": [ - "from transformers import pipeline, AutoTokenizer\n", "from optimum.onnxruntime import ORTModelForSequenceClassification\n", + "from transformers import AutoTokenizer, pipeline\n", "\n", "# Using https://huggingface.co/laiyer/deberta-v3-base-prompt-injection\n", "model_path = \"laiyer/deberta-v3-base-prompt-injection\"\n", diff --git a/docs/docs/integrations/chat/hunyuan.ipynb b/docs/docs/integrations/chat/tencent_hunyuan.ipynb similarity index 78% rename from docs/docs/integrations/chat/hunyuan.ipynb rename to docs/docs/integrations/chat/tencent_hunyuan.ipynb index 2cb334bfb937a..3c6a9ef342553 100644 --- a/docs/docs/integrations/chat/hunyuan.ipynb +++ b/docs/docs/integrations/chat/tencent_hunyuan.ipynb @@ -13,9 +13,16 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "# ChatHunyuan\n", + "# Tencent Hunyuan\n", "\n", - "Hunyuan chat model API by Tencent. For more information, see [https://cloud.tencent.com/document/product/1729](https://cloud.tencent.com/document/product/1729)" + ">[Tencent's hybrid model API](https://cloud.tencent.com/document/product/1729) (`Hunyuan API`) \n", + "> implements dialogue communication, content generation, \n", + "> analysis and understanding, and can be widely used in various scenarios such as intelligent \n", + "> customer service, intelligent marketing, role playing, advertising copywriting, product description,\n", + "> script creation, resume generation, article writing, code generation, data analysis, and content\n", + "> analysis.\n", + "\n", + "See for [more information](https://cloud.tencent.com/document/product/1729)." ] }, { @@ -85,7 +92,10 @@ { "cell_type": "markdown", "metadata": { - "collapsed": false + "collapsed": false, + "jupyter": { + "outputs_hidden": false + } }, "source": [ "## For ChatHunyuan with Streaming" @@ -99,7 +109,10 @@ "end_time": "2023-10-19T10:20:41.507720Z", "start_time": "2023-10-19T10:20:41.496456Z" }, - "collapsed": false + "collapsed": false, + "jupyter": { + "outputs_hidden": false + } }, "outputs": [], "source": [ @@ -119,7 +132,10 @@ "end_time": "2023-10-19T10:20:46.275673Z", "start_time": "2023-10-19T10:20:44.241097Z" }, - "collapsed": false + "collapsed": false, + "jupyter": { + "outputs_hidden": false + } }, "outputs": [ { @@ -150,7 +166,10 @@ "ExecuteTime": { "start_time": "2023-10-19T10:19:56.233477Z" }, - "collapsed": false + "collapsed": false, + "jupyter": { + "outputs_hidden": false + } }, "outputs": [], "source": [] @@ -172,10 +191,9 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.11.4" - }, - "orig_nbformat": 4 + "version": "3.10.12" + } }, "nbformat": 4, - "nbformat_minor": 2 + "nbformat_minor": 4 } diff --git a/docs/docs/integrations/document_loaders/tencent_cos_directory.ipynb b/docs/docs/integrations/document_loaders/tencent_cos_directory.ipynb index 95dcdb0bc688e..1640322949054 100644 --- a/docs/docs/integrations/document_loaders/tencent_cos_directory.ipynb +++ b/docs/docs/integrations/document_loaders/tencent_cos_directory.ipynb @@ -7,6 +7,15 @@ "source": [ "# Tencent COS Directory\n", "\n", + ">[Tencent Cloud Object Storage (COS)](https://www.tencentcloud.com/products/cos) is a distributed \n", + "> storage service that enables you to store any amount of data from anywhere via HTTP/HTTPS protocols. \n", + "> `COS` has no restrictions on data structure or format. It also has no bucket size limit and \n", + "> partition management, making it suitable for virtually any use case, such as data delivery, \n", + "> data processing, and data lakes. `COS` provides a web-based console, multi-language SDKs and APIs, \n", + "> command line tool, and graphical tools. It works well with Amazon S3 APIs, allowing you to quickly \n", + "> access community tools and plugins.\n", + "\n", + "\n", "This covers how to load document objects from a `Tencent COS Directory`." ] }, @@ -108,7 +117,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.6" + "version": "3.10.12" } }, "nbformat": 4, diff --git a/docs/docs/integrations/document_loaders/tencent_cos_file.ipynb b/docs/docs/integrations/document_loaders/tencent_cos_file.ipynb index c06e67588993c..b86f1a5a80309 100644 --- a/docs/docs/integrations/document_loaders/tencent_cos_file.ipynb +++ b/docs/docs/integrations/document_loaders/tencent_cos_file.ipynb @@ -7,6 +7,14 @@ "source": [ "# Tencent COS File\n", "\n", + ">[Tencent Cloud Object Storage (COS)](https://www.tencentcloud.com/products/cos) is a distributed \n", + "> storage service that enables you to store any amount of data from anywhere via HTTP/HTTPS protocols. \n", + "> `COS` has no restrictions on data structure or format. It also has no bucket size limit and \n", + "> partition management, making it suitable for virtually any use case, such as data delivery, \n", + "> data processing, and data lakes. `COS` provides a web-based console, multi-language SDKs and APIs, \n", + "> command line tool, and graphical tools. It works well with Amazon S3 APIs, allowing you to quickly \n", + "> access community tools and plugins.\n", + "\n", "This covers how to load document object from a `Tencent COS File`." ] }, @@ -83,7 +91,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.6" + "version": "3.10.12" } }, "nbformat": 4, diff --git a/docs/docs/integrations/providers/tencent.mdx b/docs/docs/integrations/providers/tencent.mdx new file mode 100644 index 0000000000000..1d75b4e1f450d --- /dev/null +++ b/docs/docs/integrations/providers/tencent.mdx @@ -0,0 +1,82 @@ +# Tencent + +>[Tencent Holdings Ltd. (Wikipedia)](https://en.wikipedia.org/wiki/Tencent) (Chinese: 腾讯; pinyin: Téngxùn) +> is a Chinese multinational technology conglomerate and holding company headquartered +> in Shenzhen. `Tencent` is one of the highest grossing multimedia companies in the +> world based on revenue. It is also the world's largest company in the video game industry +> based on its equity investments. + + +## Chat model + +>[Tencent's hybrid model API](https://cloud.tencent.com/document/product/1729) (`Hunyuan API`) +> implements dialogue communication, content generation, +> analysis and understanding, and can be widely used in various scenarios such as intelligent +> customer service, intelligent marketing, role playing, advertising, copyrighting, product description, +> script creation, resume generation, article writing, code generation, data analysis, and content +> analysis. + + +For more information, see [this notebook](/docs/integrations/chat/tencent_hunyuan) + +```python +from langchain.chat_models import ChatHunyuan +``` + +## Vector Store + +>[Tencent Cloud VectorDB](https://www.tencentcloud.com/products/vdb) is a fully managed, +> self-developed enterprise-level distributed database service +>dedicated to storing, retrieving, and analyzing multidimensional vector data. The database supports a variety of index +>types and similarity calculation methods, and a single index supports 1 billion vectors, millions of QPS, and +>millisecond query latency. `Tencent Cloud Vector Database` can not only provide an external knowledge base for large +>models and improve the accuracy of large models' answers, but also be widely used in AI fields such as +>recommendation systems, NLP services, computer vision, and intelligent customer service. + +Install the Python SDK: + +```bash +pip install tcvectordb +``` + +For more information, see [this notebook](/docs/integrations/vectorstores/tencentvectordb) + +```python +from langchain.vectorstores import TencentVectorDB +``` + +## Document Loaders + +### Tencent COS + +>[Tencent Cloud Object Storage (COS)](https://www.tencentcloud.com/products/cos) is a distributed +> storage service that enables you to store any amount of data from anywhere via HTTP/HTTPS protocols. +> `COS` has no restrictions on data structure or format. It also has no bucket size limit and +> partition management, making it suitable for virtually any use case, such as data delivery, +> data processing, and data lakes. COS provides a web-based console, multi-language SDKs and APIs, +> command line tool, and graphical tools. It works well with Amazon S3 APIs, allowing you to quickly +> access community tools and plugins. + +Install the Python SDK: + +```bash +pip install cos-python-sdk-v5 +``` + +#### Tencent COS Directory + +For more information, see [this notebook](/docs/integrations/document_loaders/tencent_cos_directory) + +```python +from langchain.document_loaders import TencentCOSDirectoryLoader +from qcloud_cos import CosConfig +``` + +#### Tencent COS File + +For more information, see [this notebook](/docs/integrations/document_loaders/tencent_cos_file) + +```python +from langchain.document_loaders import TencentCOSFileLoader +from qcloud_cos import CosConfig +``` \ No newline at end of file diff --git a/docs/docs/integrations/providers/tencentvectordb.mdx b/docs/docs/integrations/providers/tencentvectordb.mdx deleted file mode 100644 index e1db644f471ae..0000000000000 --- a/docs/docs/integrations/providers/tencentvectordb.mdx +++ /dev/null @@ -1,15 +0,0 @@ -# TencentVectorDB - -This page covers how to use the TencentVectorDB ecosystem within LangChain. - -### VectorStore - -There exists a wrapper around TencentVectorDB, allowing you to use it as a vectorstore, -whether for semantic search or example selection. - -To import this vectorstore: -```python -from langchain.vectorstores import TencentVectorDB -``` - -For a more detailed walkthrough of the TencentVectorDB wrapper, see [this notebook](/docs/integrations/vectorstores/tencentvectordb) diff --git a/docs/vercel.json b/docs/vercel.json index 9da85a91d91a1..56b05d1fdbe57 100644 --- a/docs/vercel.json +++ b/docs/vercel.json @@ -1,5 +1,13 @@ { "redirects": [ + { + "source": "/docs/integrations/providers/tencentvectordb", + "destination": "/docs/integrations/providers/tencent" + }, + { + "source": "/docs/integrations/chat/hunyuan", + "destination": "/docs/integrations/chat/tencent_hunyuan" + }, { "source": "/docs/integrations/providers/aws_dynamodb", "destination": "/docs/integrations/platforms/aws#aws-dynamodb"