Public
Script
October 23, 2023
1
2
3
4
5
6
7
8
9
10
11
12
13
import { chatGPT } from "https://esm.town/v/maxdrake/chatGPT";
export let chatGPTExample = async (API_KEY) => {
let repsonse_obj = await chatGPT(
"hello assistant",
[], // this can be an empty list, or if you're using this to continue a conversation, you can pass in someting of the form: https://platform.openai.com/docs/guides/chat/introduction
API_KEY
);
let response_text = repsonse_obj.message;
console.log(response_text);
let transcript = repsonse_obj.transcript;
console.log(transcript);
};
Val Town is a social website to write and deploy JavaScript.
Build APIs and schedule functions from your browser.
Comments
Nobody has commented on this val yet: be the first!
October 23, 2023