4// https://api.val.town/v1/express/zzz.ListenTo?val=stevekrouse.whatIsValTown
5export async function ListenTo(req, res) {
6 const { val = "zzz.demoOpenAIGPT4Summary" } = req.query;
7 const url = `https://api.val.town/v1/run/${val.replace("@", "")}`
8 const resp = await fetch(url);
1Migrated from folder: openai/scoreAndCombineArticles
1Migrated from folder: openai_function_calling/counterfeitPrompt
1Migrated from folder: External_APIs/openai/openaiFineTuneData
1null
2
3Migrated from folder: External_APIs/openai/fineTuningJob1
1Migrated from folder: External_APIs/openai/openaiFineTune
1Migrated from folder: External_APIs/openai/openaiUploadFile
1Migrated from folder: OpenAI/images
1# Use GPT to generate vals on your account!
2
3Describe the val that you need, call this function, and you'll get a new val on your workspace generated by OpenAI's API!
4
5First, ensure you have a [Val Town API Token](https://www.val.town/settings/api), then call `@andreterron.createGeneratedVal({...})` like this [example](https://www.val.town/v/andreterron.untitled_tomatoKiwi):
155. Message @ValTownBot the express endpoint you copied
16
176. You'll also need an `openai` key in [your secrets](/settings/secrets) for this particular DallE bot to work
18
19Migrated from folder: Archive/telegramBotHandler