跳到正文
文章中级

构建 AI 代码解释器

让 Workers AI 模型编写 JavaScript,并在无网络访问的 Dynamic Worker 沙箱中运行,再把结果用于回答。

最近更新
2026年10月21日
阅读原文

该介绍目前仅提供英文版本。

Build a Worker that answers questions by running code: a Workers AI model writes JavaScript, a Dynamic Worker executes it with no network access, and the model folds the result into its reply. The finished Worker answers a question about prime numbers and returns the code it ran.

What you’ll learn

  • Run untrusted code safely in a Dynamic Worker
  • Give a Workers AI model a code-execution tool
  • Test locally and deploy

Cloudflare products used

Workers AI, Dynamic Workers, Workers.

Follow the full, step-by-step tutorial in Cloudflare’s documentation.

继续学习