Search

3,380 results found for openai (4596ms)

Code
3,285

- **Backend**: Hono API framework
- **Database**: SQLite for user data and engagement tracking
- **AI**: OpenAI for mood-based affirmations
- **Styling**: African-inspired earth tones with cultural patterns
import { Hono } from "https://esm.sh/hono@3.11.7";
import { OpenAI } from "https://esm.town/v/std/openai";
import { createMoodEntry, getUserMoodEntries, getMoodStats, trackEngagement } from "../database/
import type { MoodEntry, APIResponse } from "../../shared/types.ts";
export const moodRoutes = new Hono();
// Initialize OpenAI for affirmations
const openai = new OpenAI();
// Submit mood check-in
: `Generate a gentle, comforting affirmation in English for someone feeling ${mood}. The
const completion = await openai.chat.completions.create({
messages: [
{
try {
const completion = await openai.chat.completions.create({
messages: [
{
- Backend: Hono (TypeScript)
- Frontend: React with TypeScript
- AI: OpenAI GPT for quote generation
- Storage: Val Town Blob for quote history
- Styling: TailwindCSS
- **Frontend**: React with TypeScript
- **Styling**: TailwindCSS with custom glass-morphism effects
- **AI**: OpenAI GPT-4o-mini for personalized wellness advice
- **Fonts**: Inter + Crimson Text for modern + sage-like typography
- **Animations**: CSS keyframes for floating and fade-in effects
import { Hono } from "https://esm.sh/hono@3.11.7";
import { readFile, serveFile } from "https://esm.town/v/std/utils@85-main/index.ts";
import { OpenAI } from "https://esm.town/v/std/openai";
import type { SageResponse, UserPreferences, WellnessChallenge, WellnessTip, UrbanLocation } fro
});
const openai = new OpenAI();
// Serve static files
Respond with helpful, personalized advice in a warm, sage-like tone. Keep responses concise but
const completion = await openai.chat.completions.create({
messages: [
{ role: "system", content: systemPrompt },
- tags: relevant keywords array`;
const completion = await openai.chat.completions.create({
messages: [{ role: "user", content: prompt }],
model: "gpt-4o-mini",
## Twin Name Generator Features
- 🤖 **AI-Powered Generation**: Uses OpenAI GPT-4 to create creative, meaningful name combinatio
- 👫 **Gender Options**: Choose from Boy/Boy, Girl/Girl, or Boy/Girl combinations
- 🎵 **Rhyming Names**: Generates names that sound harmonious together
- React 18.2.0 with TypeScript
- OpenAI GPT-4 for AI name generation
- TailwindCSS for styling
- Hono backend for serving files and API handling
import { Hono } from "https://esm.sh/hono@3.11.7";
import { OpenAI } from "https://esm.town/v/std/openai";
import { readFile, serveFile } from "https://esm.town/v/std/utils@85-main/index.ts";
});
// Generate twin names using OpenAI
app.post("/api/generate-names", async c => {
try {
const { genderCombination, style } = await c.req.json() as TwinNameRequest;
const openai = new OpenAI();
// Create gender-specific prompt
- Make names appropriate and beautiful for twins.`;
const completion = await openai.chat.completions.create({
messages: [
{
## Features
- 🤖 OpenAI-powered name generation
- 👶 Gender preference selection (boy/boy, girl/girl, boy/girl)
- 🎵 Rhyming and similar sounding name suggestions
## Tech Stack
- Backend: Hono + OpenAI API
- Frontend: React + TypeScript + TailwindCSS
- Styling: Modern gradient design with animations
import { Hono } from "https://esm.sh/hono@3.11.7";
import { OpenAI } from "https://esm.town/v/std/openai";
import { readFile, serveFile } from "https://esm.town/v/std/utils@85-main/index.ts";
import type { NameGenerationRequest, NameGenerationResponse, NamePair } from "../shared/types.ts
});
const openai = new OpenAI();
// Serve static files
]`;
const completion = await openai.chat.completions.create({
messages: [
{
if (!responseText) {
throw new Error("No response from OpenAI");
}
namePairs = JSON.parse(responseText);
} catch (parseError) {
console.error("Failed to parse OpenAI response:", responseText);
throw new Error("Invalid response format from AI");
}
import { OpenAI } from "https://esm.town/v/std/openai";
import type { AIGenerationRequest, AIGenerationResponse } from "../../shared/types.ts";
const openai = new OpenAI();
export async function generateContent(request: AIGenerationRequest): Promise<AIGenerationRespons
Generate an improved description:`;
const completion = await openai.chat.completions.create({
messages: [{ role: "user", content: prompt }],
model: "gpt-4o-mini",
const suggestionsPrompt = `Generate 2 alternative short descriptions for the same product. Eac
const suggestionsCompletion = await openai.chat.completions.create({
messages: [
{ role: "user", content: prompt },
Generate a helpful auto-reply response:`;
const completion = await openai.chat.completions.create({
messages: [{ role: "user", content: prompt }],
model: "gpt-4o-mini",