振り返りのテーマを出すAI Botの作成をやる。

価格 · Cloudflare Workers AI ドキュメント

  • freeプランは10000Neurons/1日まで無料。超えた分は0.011ドル/1,000Neurons
  • 0:00 UTCにリセットされる。

とりあえずチュートリアルをやる:開始方法 - CLI · Cloudflare Workers AI ドキュメント

バインディングにより、ワーカーは Cloudflare 開発者プラットフォーム上のリソースと対話できるようになります。
バインディング (env) · Cloudflare Workers ドキュメント
リソースの紐付け的な感じのやつか。

動いたけど、そんなモデルはないというエラーが出ている。

[wrangler:inf] GET / 500 Internal Server Error (10528ms)
[wrangler:err] AiError: 5007: No such model @cf/meta/llama/3.1.8b-instruct or task

typoっぽい
llama-3.1-8b-instruct · Cloudflare Workers AI docs

{"response":"A fascinating question! The phrase \"Hello, World!\" has a rich history, and its origin is attributed to Brian Kernighan, a Canadian computer scientist.\n\nIn 1978, Kernighan was working at Bell Labs, where he was part of a team that developed the C programming language. He was tasked with writing a tutorial on the language, and he needed a simple program to demonstrate the basic syntax and output of the language.\n\nThe first program he wrote was a simple one that printed \"Hello, World!\" to the screen. This was done to demonstrate how to print a string to the console, and it served as a test case to ensure that the program was working correctly.\n\nThe first line of the program, `main()`, is where the magic happens:\n\n```c\nmain() {\n    printf(\"Hello, World!\\n\");\n}\n```\n\nThis program simply prints the string \"Hello, World!\" to the console, followed by a newline character. The `main()` function is the entry point of the program, and `printf()` is a function that prints its arguments to the console.\n\nKernighan's program was included in the first edition of his book, \"The C Programming Language,\" which was published in 1978. The book became a","usage":{"prompt_tokens":54,"completion_tokens":256,"total_tokens":310}}

そこそこ時間が経ってからなんか返ってきた。

ここでダッシュボードを確認した。Workersとは別にWorkers AIというサイドバーから確認ができる

この1回で 20.62 Neuronsかかったっぽい

![](/var/folders/7s/rhl9qs8n0jv7br4y50b_rlwh0000gn/T/TemporaryItems/NSIRD_screencaptureui_QHLi8H/\ 2025-02-25\ 1.19.56.png)