From 1075e7d6e8c9a84466bb5fece27b5b82ecc8e9ca Mon Sep 17 00:00:00 2001 From: Leonid Ganeline Date: Fri, 15 Dec 2023 14:39:41 -0800 Subject: [PATCH] docs: `cloudflare` update (#14779) Added provider page. Added links, descriptions --- .../integrations/providers/cloudflare.mdx | 18 +++++++++ .../text_embedding/cloudflare_workersai.ipynb | 40 +++++++++++++------ 2 files changed, 45 insertions(+), 13 deletions(-) create mode 100644 docs/docs/integrations/providers/cloudflare.mdx diff --git a/docs/docs/integrations/providers/cloudflare.mdx b/docs/docs/integrations/providers/cloudflare.mdx new file mode 100644 index 0000000000..bbc124bb0f --- /dev/null +++ b/docs/docs/integrations/providers/cloudflare.mdx @@ -0,0 +1,18 @@ +# Cloudflare + +>[Cloudflare, Inc. (Wikipedia)](https://en.wikipedia.org/wiki/Cloudflare) is an American company that provides +> content delivery network services, cloud cybersecurity, DDoS mitigation, and ICANN-accredited +> domain registration services. + +>[Cloudflare Workers AI](https://developers.cloudflare.com/workers-ai/) allows you to run machine +> learning models, on the `Cloudflare` network, from your code via REST API. + + + +## Embedding models + +See [installation instructions and usage example](/docs/integrations/text_embedding/cloudflare_workersai). + +```python +from langchain.embeddings.cloudflare_workersai import CloudflareWorkersAIEmbeddings +``` diff --git a/docs/docs/integrations/text_embedding/cloudflare_workersai.ipynb b/docs/docs/integrations/text_embedding/cloudflare_workersai.ipynb index 25c6ce9601..603ab1f381 100644 --- a/docs/docs/integrations/text_embedding/cloudflare_workersai.ipynb +++ b/docs/docs/integrations/text_embedding/cloudflare_workersai.ipynb @@ -6,23 +6,19 @@ "id": "59428e05", "metadata": {}, "source": [ - "# Text Embeddings on Cloudflare Workers AI\n", + "# Cloudflare Workers AI\n", "\n", - "[Cloudflare AI document](https://developers.cloudflare.com/workers-ai/models/text-embeddings/) listed all text embeddings models available.\n", + ">[Cloudflare, Inc. (Wikipedia)](https://en.wikipedia.org/wiki/Cloudflare) is an American company that provides content delivery network services, cloud cybersecurity, DDoS mitigation, and ICANN-accredited domain registration services.\n", + "\n", + ">[Cloudflare Workers AI](https://developers.cloudflare.com/workers-ai/) allows you to run machine learning models, on the `Cloudflare` network, from your code via REST API.\n", + "\n", + ">[Cloudflare AI document](https://developers.cloudflare.com/workers-ai/models/text-embeddings/) listed all text embeddings models available.\n", + "\n", + "## Setting up\n", "\n", "Both Cloudflare account ID and API token are required. Find how to obtain them from [this document](https://developers.cloudflare.com/workers-ai/get-started/rest-api/).\n" ] }, - { - "cell_type": "code", - "execution_count": 1, - "id": "92c5b61e", - "metadata": {}, - "outputs": [], - "source": [ - "from langchain.embeddings.cloudflare_workersai import CloudflareWorkersAIEmbeddings" - ] - }, { "cell_type": "code", "execution_count": 2, @@ -36,6 +32,24 @@ "my_api_token = getpass.getpass(\"Enter your Cloudflare API token:\\n\\n\")" ] }, + { + "cell_type": "markdown", + "id": "1c94b531-f5a6-4eea-9f08-a85e9d3bff28", + "metadata": {}, + "source": [ + "## Example" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "id": "92c5b61e", + "metadata": {}, + "outputs": [], + "source": [ + "from langchain.embeddings.cloudflare_workersai import CloudflareWorkersAIEmbeddings" + ] + }, { "cell_type": "code", "execution_count": 3, @@ -112,7 +126,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.18" + "version": "3.10.12" }, "vscode": { "interpreter": {