241export default async function server(request: Request): Promise<Response> {
242 if (request.method === "POST" && new URL(request.url).pathname === "/recipes") {
243 const { OpenAI } = await import("https://esm.town/v/std/openai");
244 const openai = new OpenAI();
245
246 const { numPeople, numRecipes, difficulty, cuisine, ingredients, unit, dietaryRestrictions } = await request.json();
255
256 try {
257 const completion = await openai.chat.completions.create({
258 messages: [{ role: "user", content: prompt }],
259 model: "gpt-4o-mini",
743 }
744
745 const { OpenAI } = await import("https://esm.town/v/std/openai");
746 const regenerateKey = request.headers.get("Regenerate-Key") || "0";
747 const openai = new OpenAI();
748
749 const { sport, skillLevel, ageGroup, groupSize, selectedSkills, sessionDuration } = await request.json();
790 Ensure that the conclusion ties together all the main concepts covered in the training, reinforces the learning objectives, and provides clear takeaways for both participants and coaches. The questions in the conclusion should prompt critical thinking about the skills practiced and their application in the sport.`;
791
792 const completion = await openai.chat.completions.create({
793 messages: [{ role: "user", content: prompt + `\n\nRegenerate key: ${regenerateKey}` }],
794 model: "gpt-4o-mini",
306 console.log(`Received ${request.method} request to ${request.url}`);
307
308 const { OpenAI } = await import("https://esm.town/v/std/openai");
309 const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
310 const openai = new OpenAI();
311 const url = new URL(request.url);
312
337 console.log("Generated prompt:", prompt);
338
339 const completion = await openai.chat.completions.create({
340 messages: [{ role: "user", content: prompt }],
341 model: "gpt-4o-mini",
12 try {
13 // Generate AI audio description
14 const { OpenAI } = await import("https://esm.town/v/std/openai");
15 const openai = new OpenAI();
16
17 const audioDescCompletion = await openai.chat.completions.create({
18 messages: [{
19 role: "user",
39// export const model = "gpt-4o-mini"
40// export const model = "gpt-4o"
41// export const provider = "openai"
42
43export const summaryModel = "gpt-4o-mini"
44export const summaryProvider = "openai"
45
46
48// export const smartProvider = "google"
49export const smartModel = "gpt-4o-mini"
50export const smartProvider = "openai"
51
52export const cheapModel = "gpt-4o-mini"
53export const cheapProvider = "openai"
54
55const argschema = z.object({
241export default async function server(request: Request): Promise<Response> {
242 if (request.method === "POST" && new URL(request.url).pathname === "/recipes") {
243 const { OpenAI } = await import("https://esm.town/v/std/openai");
244 const openai = new OpenAI();
245
246 const { numPeople, numRecipes, difficulty, cuisine, ingredients, unit, dietaryRestrictions } = await request.json();
255
256 try {
257 const completion = await openai.chat.completions.create({
258 messages: [{ role: "user", content: prompt }],
259 model: "gpt-4o-mini",
1import { Hono } from "https://esm.sh/hono";
2import { html } from "https://esm.sh/hono/html";
3import { OpenAI } from "https://esm.town/v/std/openai";
4
5const app = new Hono();
309
310app.get("/market-data", async (c) => {
311 const openai = new OpenAI();
312
313 try {
314 const completion = await openai.chat.completions.create({
315 model: "gpt-4o-mini",
316 messages: [
349 const { message } = await c.req.json();
350
351 const openai = new OpenAI();
352
353 const completion = await openai.chat.completions.create({
354 model: "gpt-4o-mini",
355 messages: [
322 if (request.method === 'POST' && new URL(request.url).pathname === '/generate-landing-page') {
323 try {
324 const { OpenAI } = await import("https://esm.town/v/std/openai");
325 const openai = new OpenAI();
326
327 const { isInitial, imageBase64, existingCode, editPrompt } = await request.json();
337
338 if (isInitial && imageBase64) {
339 const visionResponse = await openai.chat.completions.create({
340 model: "gpt-4-vision-preview",
341 messages: [
360 }
361
362 const codeGenerationResponse = await openai.chat.completions.create({
363 model: "gpt-4o-mini",
364 messages: [
224 const { intervieweeResponse, interviewPosition } = await request.json();
225
226 const { OpenAI } = await import("https://esm.town/v/std/openai");
227 const openai = new OpenAI();
228
229 const completion = await openai.chat.completions.create({
230 messages: [
231 {
3The app is set up so you can easily have a conversation between two people. The app will translate between the two selected languages, in each voice, as the speakers talk.
4
5Add your OpenAI API Key, and make sure to open in a separate window for Mic to work.