Skip to content

Commit

Permalink
📝 docs: add docs for cloudflare (lobehub#4685)
Browse files Browse the repository at this point in the history
* 📝 docs: update docs for providers

* 📝 docs: update provider doc

* docs: add doc for cloudflare
  • Loading branch information
tcmonster authored Nov 14, 2024
1 parent 771bf87 commit 32630fa
Show file tree
Hide file tree
Showing 2 changed files with 161 additions and 0 deletions.
82 changes: 82 additions & 0 deletions docs/usage/providers/cloudflare.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
---
title: Using Cloudflare Workers AI in LobeChat
description: Learn how to integrate and utilize Cloudflare Workers AI Models in LobeChat.
tags:
- LobeChat
- Cloudflare
- Workers AI
- Provider
- API Key
- Web UI
---

# Using Cloudflare Workers AI in LobeChat

<Image
cover
src={'https://github.com/user-attachments/assets/91fe32a8-e5f0-47ff-b8ae-d036c8a7bff1'}
/>

[Cloudflare Workers AI](https://www.cloudflare.com/developer-platform/products/workers-ai/) is a service that integrates AI capabilities into the Cloudflare Workers serverless computing platform. Its core functionality lies in delivering fast, scalable computing power through Cloudflare's global network, thereby reducing operational overhead.

This document will guide you on how to use Cloudflare Workers AI in LobeChat:

<Steps>

### Step 1: Obtain Your Cloudflare Workers AI API Key

- Visit the [Cloudflare website](https://www.cloudflare.com/) and sign up for an account.
- Log in to the [Cloudflare dashboard](https://dash.cloudflare.com/).
- In the left-hand menu, locate the `AI` > `Workers AI` option.

<Image
alt={'Cloudflare Workers AI'}
inStep
src={'https://github.com/user-attachments/assets/4257e123-9018-4562-ac66-0f39278906f5'}
/>

- In the `Using REST API` section, click the `Create Workers AI API Token` button.
- In the drawer dialog, copy and save your `API token`.
- Also, copy and save your `Account ID`.

<Image
alt={'Cloudflare Workers AI API Token'}
inStep
src={'https://github.com/user-attachments/assets/f54c912d-3ee9-4f85-b8bf-619790e51b49'}
/>

<Callout type={"warning"}>

- Please store your API token securely, as it will only be displayed once. If you accidentally lose it, you will need to create a new token.

</Callout>

### Step 2: Configure Cloudflare Workers AI in LobeChat

- Go to the `Settings` interface in LobeChat.
- Under `Language Model`, find the `Cloudflare` settings.

<Image
alt={'Input API Token'}
inStep
src={'https://github.com/user-attachments/assets/82a7ebe0-69ad-43b6-8767-1316b443fa03'}
/>

- Enter the `API Token` you obtained.
- Input your `Account ID`.
- Choose a Cloudflare Workers AI model for your AI assistant to start the conversation.

<Image
alt={'Choose Cloudflare Workers AI Model and Start Conversation'}
inStep
src={'https://github.com/user-attachments/assets/09be499c-3b04-4dd6-a161-6e8ebe788354'}
/>

<Callout type={'warning'}>
You may incur charges while using the API service, please refer to Cloudflare's pricing policy for
details.
</Callout>

</Steps>

At this point, you can start conversing with the model provided by Cloudflare Workers AI in LobeChat.
79 changes: 79 additions & 0 deletions docs/usage/providers/cloudflare.zh-CN.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
---
title: 在 LobeChat 中使用 Cloudflare Workers AI
description: 学习如何在 LobeChat 中配置和使用 Cloudflare Workers AI 的 API Key,以便开始对话和交互。
tags:
- LobeChat
- Cloudflare
- Workers AI
- 供应商
- API密钥
- Web UI
---

# 在 LobeChat 中使用 Cloudflare Workers AI

<Image
cover
src={'https://github.com/user-attachments/assets/91fe32a8-e5f0-47ff-b8ae-d036c8a7bff1'}
/>

[Cloudflare Workers AI](https://www.cloudflare.com/developer-platform/products/workers-ai/) 是一种将人工智能能力集成到 Cloudflare Workers 无服务器计算平台的服务。其核心功能在于通过 Cloudflare 的全球网络提供快速、可扩展的计算能力,降低运维开销。

本文档将指导你如何在 LobeChat 中使用 Cloudflare Workers AI:

<Steps>

### 步骤一: 获取 Cloudflare Workers AI 的 API Key

- 访问 [Cloudflare 官网](https://www.cloudflare.com/) 并注册一个账号。
- 登录 [Cloudflare 控制台](https://dash.cloudflare.com/).
- 在左侧的菜单中找到 `AI` > `Workers AI` 选项。

<Image
alt={'Cloudflare Workers AI'}
inStep
src={'https://github.com/user-attachments/assets/4257e123-9018-4562-ac66-0f39278906f5'}
/>

-`使用 REST API` 中点击 `创建 Workers AI API 令牌` 按钮
- 在弹出的侧边栏中复制并保存你的 `API 令牌`
- 同时也复制并保存你的 `账户ID`

<Image
alt={'Cloudflare Workers AI API Token'}
inStep
src={'https://github.com/user-attachments/assets/f54c912d-3ee9-4f85-b8bf-619790e51b49'}
/>

<Callout type={'warning'}>
- 请安全地存储 API 令牌,因为它只会出现一次。如果您意外丢失它,您将需要创建一个新令牌。
</Callout>

### 步骤二: 在 LobeChat 中配置 Cloudflare Workers AI

- 访问 LobeChat 的`设置`界面
-`语言模型`下找到 `Cloudflare` 的设置项

<Image
alt={'填入访问令牌'}
inStep
src={'https://github.com/user-attachments/assets/82a7ebe0-69ad-43b6-8767-1316b443fa03'}
/>

- 填入获得的 `API 令牌`
- 填入你的`账户ID`
- 为你的 AI 助手选择一个 Cloudflare Workers AI 的模型即可开始对话

<Image
alt={'选择 Cloudflare Workers AI 模型并开始对话'}
inStep
src={'https://github.com/user-attachments/assets/09be499c-3b04-4dd6-a161-6e8ebe788354'}
/>

<Callout type={'warning'}>
在使用过程中你可能需要向 API 服务提供商付费,请参考 Cloudflare 的相关费用政策。
</Callout>

</Steps>

至此你已经可以在 LobeChat 中使用 Cloudflare Workers AI 提供的模型进行对话了。

0 comments on commit 32630fa

Please sign in to comment.