Use the Vercel AI SDK in your Vals.
Note: you must add your OpenAI key to your Val Town Env variables under OPENAI_API_KEY. If you would like to specify a different name for your API Key, you can create a custom OpenAI provider with the createOpenAI function.
OPENAI_API_KEY
createOpenAI
Prefer another AI provider? Use any supported provider by changing just two lines of code!
https://nicoalbanese-tomatominnow.web.val.run
https://esm.town/v/nicoalbanese/tomatoMinnow
<script type="module" src="https://esm.town/v/nicoalbanese/tomatoMinnow"></script>