本文へスキップ
記事中級

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.

さらに学ぶ