2// It uses the Hono web framework to serve a Single-Page Application (SPA).
34import { OpenAI } from "https://esm.town/v/std/openai";
5import { Hono } from "npm:hono@4.4.12";
6import type { Context } from "npm:hono@4.4.12";
815if (!industry) return c.json({ error: "Industry is a required field." }, 400);
816try {
817const openai = new OpenAI();
818const completion = await openai.chat.completions.create({
819model: "gpt-4o",
820messages: [{ role: "system", content: DYNAMIC_LIST_GENERATOR_PROMPT }, {
836if (!occupation) return c.json({ error: "Occupation is a required field." }, 400);
837try {
838const openai = new OpenAI();
839const completion = await openai.chat.completions.create({
840model: "gpt-4o",
841messages: [{ role: "system", content: DYNAMIC_LIST_GENERATOR_PROMPT }, {
862863try {
864const openai = new OpenAI();
865const completion = await openai.chat.completions.create({
866model: "gpt-4o",
867messages: [{ role: "system", content: PROMPT_REFINER_SYSTEM_PROMPT }, { role: "user", content: userInput }],
880if (!refined_prompt) return c.json({ error: "refined_prompt is required" }, 400);
881try {
882const openai = new OpenAI();
883const completion = await openai.chat.completions.create({
884model: "gpt-4o",
885messages: [{ role: "system", content: INPUT_EXTRACTOR_SYSTEM_PROMPT }, {
901if (!refined_prompt) return c.json({ error: "refined_prompt is required" }, 400);
902try {
903const openai = new OpenAI();
904const completion = await openai.chat.completions.create({
905model: "gpt-4o",
906messages: [{ role: "system", content: CLARIFICATION_AGENT_SYSTEM_PROMPT }, {
956957try {
958const openai = new OpenAI();
959const agentCompletion = await openai.chat.completions.create({
960model: "gpt-4o",
961messages: [{ role: "system", content: systemPromptWithContext }, {
968if (!agentOutput) throw new Error("The agent returned no content.");
969970const htmlCompletion = await openai.chat.completions.create({
971model: "gpt-4o",
972messages: [{ role: "system", content: HTML_FORMATTER_SYSTEM_PROMPT }, { role: "user", content: agentOutput }],
blogget-old-posts.ts5 matches
198},
199{
200"title": "An Introduction to OpenAI fine-tuning",
201"slug": "an-introduction-to-openai-fine-tuning",
202"link": "/blog/an-introduction-to-openai-fine-tuning",
203"description": "How to customize OpenAI to your liking",
204"pubDate": "Fri, 25 Aug 2023 00:00:00 GMT",
205"author": "Steve Krouse",
417"slug": "val-town-newsletter-16",
418"link": "/blog/val-town-newsletter-16",
419"description": "Our seed round, growing team, Codeium completions, @std/openai, and more",
420"pubDate": "Mon, 22 Apr 2024 00:00:00 GMT",
421"author": "Steve Krouse",
167- [**We at Val Town**](https://www.val.town/u/valdottown) made [door](https://www.val.town/x/valdottown/door) for Val Town office guests to open the door through their phone, like [this](https://www.val.town/x/valdottown/door/pull/ef854848-34b0-11f0-9887-9e149126039e)!
168- [**Joey Hiller**](https://www.val.town/u/jhiller) made [ValTown-Package-Tracker](https://www.val.town/x/jhiller/ValTown-Package-Tracker) to track a package of sensors he was sending from Oakland to us in Downtown Brooklyn!
169- [**dinavinter**](https://www.val.town/u/dinavinter) made [slack](https://www.val.town/x/dinavinter/slack), a Slack bot that uses OpenAI to generate responses.
170- [**prashamtrivedi**](https://www.val.town/u/prashamtrivedi) made [hn-remote-ts-genai-jobs](https://www.val.town/x/prashamtrivedi/hn-remote-ts-genai-jobs), to track Hacker News' Who's Hiring filter for remote TypeScript + GenAI-related jobs.
171- [**dcm31**](https://www.val.town/u/dcm31) made [rotrank](https://www.val.town/x/dcm31/rotrank), an ELO ranking system for popular Italian Brainrot characters.
fib-bonusindex-running.html2 matches
412target="_blank"
413rel="noopener noreferrer"
414>OpenAI</a
415>
416both achieved
417<a
418href="https://www.axios.com/2025/07/21/openai-deepmind-math-olympiad-ai"
419class="text-blue-600 underline hover:text-gray-500"
420target="_blank"
fib-bonusindex.html1 match
225<p class="text-gray-700 mb-4 text-lg leading-relaxed">
226We hope you enjoyed celebrating the historic achievements in
227mathematical AI with us. Both Google and OpenAI's gold medal
228performances at the International Mathematical Olympiad marked a
229significant milestone in artificial intelligence.
1// @ts-ignore
2import { OpenAI } from "https://esm.town/v/std/openai?v=4";
34// --- AI BEHAVIORAL GUIDELINES ---
529const url = new URL(req.url);
530const action = url.searchParams.get("action");
531const openai = new OpenAI({ apiKey: process.env.openai });
532533if (req.method === "POST") {
538if (!difficulty) throw new Error("Difficulty level is required.");
539const dynamicNewGamePrompt = getNewGamePrompt(difficulty);
540const completion = await openai.chat.completions.create({
541model: "gpt-4o",
542messages: [{ role: "system", content: dynamicNewGamePrompt }],
550const { guess, secretWord } = await req.json();
551if (!guess || !secretWord) throw new Error("Guess and secretWord are required.");
552const completion = await openai.chat.completions.create({
553model: "gpt-4o",
554messages: [{ role: "system", content: CHECK_GUESS_PROMPT }, {
family-gpt-chatindex.ts6 matches
1import { Hono } from "https://esm.sh/hono";
2import { OpenAI } from "https://esm.town/v/std/openai";
3import { serveFile } from "https://esm.town/v/std/utils/index.ts";
4import type { ChatRequest, ChatResponse } from "../shared/types.ts";
25}
2627// Build conversation context for OpenAI
28const messages = [
29{
44];
4546// Call OpenAI API
47const openai = new OpenAI();
48const completion = await openai.chat.completions.create({
49model: "gpt-3.5-turbo",
50messages,
5657if (!assistantMessage) {
58throw new Error("No response from OpenAI");
59}
60
family-gpt-chatREADME.md4 matches
23A ChatGPT-like chat application built for Val Town using React and Hono with
4OpenAI integration.
56## Features
78- 💬 Real-time chat interface with ChatGPT-like styling
9- 🤖 OpenAI GPT-3.5-turbo integration via Val Town's standard library
10- 📱 Responsive design with Tailwind CSS
11- âš¡ Fast TypeScript development with Deno
3637- `GET /` - Serves the React frontend
38- `POST /api/chat` - Chat with OpenAI (requires message and optional
39conversation history)
40- `GET /api/health` - Health check endpoint
79- **Frontend**: React with TypeScript
80- **Styling**: Tailwind CSS (via CDN)
81- **AI**: OpenAI GPT-3.5-turbo via Val Town's standard library
82- **Runtime**: Deno
83- **Platform**: Val Town
1// @ts-ignore
2import { OpenAI } from "https://esm.town/v/std/openai?v=4";
34// --- AI BEHAVIORAL GUIDELINES ---
402(async () => {
403try {
404const openai = new OpenAI();
405const body = await req.json();
406const text = body.text;
415];
416417const completion = await openai.chat.completions.create({
418model: "gpt-4o",
419messages: messages,
4import { cors } from "npm:hono@4.4.12/cors";
5// @ts-ignore
6import { OpenAI } from "https://esm.town/v/std/openai?v=4";
7// @ts-ignore
8import { sqlite } from "https://esm.town/v/std/sqlite?v=4";
80}
8182const openai = new OpenAI({
83apiKey: Deno.env.get("OPENAI_API_KEY"),
84});
8589`;
9091const completion = await openai.chat.completions.create({
92model: "gpt-4o",
93messages: [