Public
Edited
Apr 11, 2023
Fork of ChatGPT API
Insert cell
Insert cell
Insert cell
Insert cell
async function askChatGpt(message) {
const configuration = new openai.Configuration({
apiKey: "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", // DO NOT copy-paste your raw API key here!
});
const openAIClient = new openai.OpenAIApi(configuration);
const response = await openAIClient.createChatCompletion({
model: 'gpt-3.5-turbo',
messages: [{
role: 'user',
content: message,
}]
});
return response.data.choices[0].message.content;
}
Insert cell
Insert cell
Insert cell
Insert cell
openai = import('https://cdn.skypack.dev/openai@3.2.1?min')
Insert cell
openai.OpenAIApi

Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more