Skip to content

Commit

Permalink
fix(example): update demo example (#231)
Browse files Browse the repository at this point in the history
* fix(example): update demo example

* use environment variable for Account ID

Co-authored-by: Alex Rattray <rattray.alex@gmail.com>

* move demo to workers/ai

---------

Co-authored-by: Alex Rattray <rattray.alex@gmail.com>
  • Loading branch information
dackerman and rattrayalex authored Apr 3, 2024
1 parent 7c20260 commit 54faa1b
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions examples/demo.ts → examples/workers/ai/demo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@ import Cloudflare from 'cloudflare';
const client = new Cloudflare();

async function main() {
const accountId = '<your accound ID>';

const response = await client.ai.run(accountId, '@cf/meta/llama-2-7b-chat-int8', {
const response = await client.workers.ai.run('@cf/meta/llama-2-7b-chat-int8', {
account_id: process.env['CLOUDFLARE_ACCOUNT_ID']!,
prompt: 'Tell me about Workers AI',
});
console.log(response);
Expand Down

0 comments on commit 54faa1b

Please sign in to comment.