68 <p>
69 <small>
70 Powered by Web Speech API • <a href={import.meta.url.replace("esm.town", "val.town")} target="_top">View Source</a>
71 </small>
72 </p>
279 const url = new URL(request.url);
280
281 // Handle the API endpoint to generate speech from text
282 if (url.pathname === '/generate-speech' && request.method === 'POST') {
283 try {
23## Voice Options
24
25The app uses OpenAI's Text-to-Speech API with these voices:
26
27- Alloy - Neutral, versatile voice
218 const url = new URL(request.url);
219
220 // Handle the API endpoint to generate speech from text
221 if (url.pathname === '/generate-speech' && request.method === 'POST') {
222 try {
1// List of available voices for OpenAI TTS API
2export const voices = [
3 { id: "alloy", name: "Alloy", description: "Neutral, versatile voice" },
185 const url = new URL(request.url);
186
187 // Handle the API endpoint to generate speech from text
188 if (url.pathname === '/generate-speech' && request.method === 'POST') {
189 try {
2
3export default async function(interval: Interval) {
4 // fetch random article from wikipedia api
5 const randomArticle = await fetch(
6 "https://en.wikipedia.org/w/api.php?action=query&format=json&prop=extracts&meta=&generator=random&formatversion=2&exsentences=1&explaintext=1&grnnamespace=0",
7 );
8 const articleJson = await randomArticle.json();
12 },
13 {
14 "prompt": "weather dashboard for nyc using open-meteo API for NYC with icons",
15 "title": "Weather App",
16 "code":
8
91. Sign up for [Cerebras](https://cloud.cerebras.ai/)
102. Get a Cerebras API Key
113. Save it in your project env variable called `CEREBRAS_API_KEY`
211 } catch (error) {
212 Toastify({
213 text: "We may have hit our Cerebras Usage limits. Try again later or fork this and use your own API key.",
214 position: "center",
215 duration: 3000,