Skip to content
Cloudflare Docs
非官方翻译 - 此文档为非官方中文翻译版本,仅供参考。如有疑问请以 英文官方文档 为准。

仪表板

请按照本指南使用 Cloudflare 仪表板创建 Workers AI 应用程序。

先决条件

如果您还没有 Cloudflare 帐户,请注册一个。

设置

要创建 Workers AI 应用程序:

  1. 登录 Cloudflare 仪表板并选择您的帐户。
  2. 转到 计算 (Workers)Workers & Pages
  3. 选择创建
  4. 从模板开始下,选择 LLM 应用。选择模板后,将在仪表板中为您创建一个AI 绑定
  5. 查看提供的代码并选择部署
  6. 在其提供的 workers.dev 子域上预览您的 Worker。

开发

Dashboard

Editing in the dashboard is helpful for simpler use cases.

Once you have created your Worker script, you can edit and deploy your Worker using the Cloudflare dashboard:

  1. Log in to the Cloudflare dashboard and select your account.
  2. Select Workers & Pages.
  3. Select your application.
  4. Select Edit Code.
Edit code directly within the Cloudflare dashboard

Wrangler CLI

To develop more advanced applications or implement tests, start working in the Wrangler CLI.

  1. Install npm.
  2. Install Node.js.
  1. Run the following command, replacing the value of [<DIRECTORY>] which the location you want to put your Worker Script.
Terminal window
npm create cloudflare@latest -- [<DIRECTORY>] --type=pre-existing

After you run this command - and work through the prompts - your local changes will not automatically sync with dashboard. So, once you download your script, continue using the CLI.