Skip to content

Commit 54faa1b

Browse files
fix(example): update demo example (#231)
* fix(example): update demo example * use environment variable for Account ID Co-authored-by: Alex Rattray <[email protected]> * move demo to workers/ai --------- Co-authored-by: Alex Rattray <[email protected]>
1 parent 7c20260 commit 54faa1b

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

examples/demo.ts renamed to examples/workers/ai/demo.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,8 @@ import Cloudflare from 'cloudflare';
66
const client = new Cloudflare();
77

88
async function main() {
9-
const accountId = '<your accound ID>';
10-
11-
const response = await client.ai.run(accountId, '@cf/meta/llama-2-7b-chat-int8', {
9+
const response = await client.workers.ai.run('@cf/meta/llama-2-7b-chat-int8', {
10+
account_id: process.env['CLOUDFLARE_ACCOUNT_ID']!,
1211
prompt: 'Tell me about Workers AI',
1312
});
1413
console.log(response);

0 commit comments

Comments
 (0)