Skip to content

Commit

Permalink
docs: cloudflare update (#14779)
Browse files Browse the repository at this point in the history
Added provider page.
Added links, descriptions
  • Loading branch information
leo-gan authored Dec 15, 2023
1 parent 132be82 commit 1075e7d
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 12 deletions.
18 changes: 18 additions & 0 deletions docs/docs/integrations/providers/cloudflare.mdx
Original file line number Diff line number Diff line change
@@ -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
```
38 changes: 26 additions & 12 deletions docs/docs/integrations/text_embedding/cloudflare_workersai.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -6,34 +6,48 @@
"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",
"execution_count": 2,
"id": "f60023b8",
"metadata": {},
"outputs": [],
"source": [
"from langchain.embeddings.cloudflare_workersai import CloudflareWorkersAIEmbeddings"
"import getpass\n",
"\n",
"my_account_id = getpass.getpass(\"Enter your Cloudflare account ID:\\n\\n\")\n",
"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": 2,
"id": "f60023b8",
"execution_count": 1,
"id": "92c5b61e",
"metadata": {},
"outputs": [],
"source": [
"import getpass\n",
"\n",
"my_account_id = getpass.getpass(\"Enter your Cloudflare account ID:\\n\\n\")\n",
"my_api_token = getpass.getpass(\"Enter your Cloudflare API token:\\n\\n\")"
"from langchain.embeddings.cloudflare_workersai import CloudflareWorkersAIEmbeddings"
]
},
{
Expand Down Expand Up @@ -112,7 +126,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.18"
"version": "3.10.12"
},
"vscode": {
"interpreter": {
Expand Down

0 comments on commit 1075e7d

Please sign in to comment.