Public
Script
Val Town is a social website to write and deploy JavaScript.
Build APIs and schedule functions from your browser.
Readme

Anthropic Claude

Claude 3.5 Sonnet

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import Anthropic from "npm:@anthropic-ai/sdk";
const anthropic = new Anthropic();
const msg = await anthropic.messages.create({
model: "claude-3-5-sonnet-20240620",
max_tokens: 1000,
temperature: 0,
system: "Respond only with short poems.",
messages: [
{
"role": "user",
"content": [
{
"type": "text",
"text": "Why is the ocean salty?",
},
],
},
],
});
console.log(msg);
July 26, 2024