6 "zod": "https://esm.sh/zod@3.23.8",
7 "ai": "https://esm.sh/ai@3.2.2",
8 "@ai-sdk/openai": "https://esm.sh/@ai-sdk/openai@0.0.36",
9 "@ai-sdk/google": "https://esm.sh/@ai-sdk/google@0.0.23",
10 "std/": "https://deno.land/std@0.224.0/",
88Note: When changing a SQLite table's schema, change the table's name (e.g., add _2 or _3) to create a fresh table.
89
90### OpenAI
91
92```ts
93import { OpenAI } from "https://esm.town/v/std/openai";
94const openai = new OpenAI();
95const completion = await openai.chat.completions.create({
96 messages: [
97 { role: "user", content: "Say hello in a creative way" },
94Note: When changing a SQLite table's schema, change the table's name (e.g., add _2 or _3) to create a fresh table.
95
96### OpenAI
97
98```ts
99import { OpenAI } from "https://esm.town/v/std/openai";
100const openai = new OpenAI();
101const completion = await openai.chat.completions.create({
102 messages: [
103 { role: "user", content: "Say hello in a creative way" },
101_2 or _3) to create a fresh table.
102
103### OpenAI
104
105```ts
106import { OpenAI } from "https://esm.town/v/std/openai";
107const openai = new OpenAI();
108const completion = await openai.chat.completions.create({
109 messages: [
110 { role: "user", content: "Say hello in a creative way" },
14
151. The user submits a question or prompt
162. The bot generates a response using OpenAI
173. The response is split into appropriate chunks based on length
184. Each chunk is rendered as text on a solid-color background
21## Technical Implementation
22
23- **Text Generation**: Uses OpenAI's API to generate informative responses
24- **Text Splitting**: Intelligently splits text at natural breaking points (sentences, spaces)
25- **Image Generation**: Uses Val Town's image generation URL with explicit solid-color background prompts
28## Environment Variables
29
30- `OPENAI_API_KEY`: Your OpenAI API key (required)
31
32## Benefits of Solid-Color Backgrounds
71
72 <footer class="mt-4 text-center text-sm text-gray-500">
73 <p>Powered by OpenAI and Val Town Image Generation</p>
74 </footer>
75 </div>
1import { OpenAI } from "https://esm.town/v/std/openai";
2import { readFile } from "https://esm.town/v/std/utils@85-main/index.ts";
3
4// Initialize OpenAI client
5const openai = new OpenAI();
6
7// Constants
110 }
111
112 // Get response from OpenAI
113 const completion = await openai.chat.completions.create({
114 model: "gpt-4o-mini",
115 messages: [
3## Configuration
4
5Configure the following two environment variables: `OPENAI_API_KEY` and `EXA_API_KEY`
1import { Hono } from "https://esm.sh/hono@3.12.6";
2import { cors } from "https://esm.sh/hono@3.12.6/cors";
3import { OpenAI } from "https://esm.town/v/std/openai";
4import { readFile, serveFile } from "https://esm.town/v/std/utils@85-main/index.ts";
5import { parseProject } from "https://esm.town/v/std/utils@85-main/index.ts";
53 }
54
55 const openai = new OpenAI();
56
57 const completion = await openai.chat.completions.create({
58 messages: [
59 {
34
35- Modern, responsive design using React and Tailwind CSS
36- IDESA virtual design assistant powered by OpenAI
37- Interactive sections showcasing IDES INTERIOR services and portfolio
38- Contact form for client inquiries
42- Frontend: React, Tailwind CSS
43- Backend: Hono (API framework)
44- AI Integration: OpenAI API
45- Deployment: Val Town