internshipapi.ts4 matches
1import { Hono } from "https://esm.sh/hono@3.11.7";
2import { OpenAI } from "https://esm.town/v/std/openai";
3import { getAllTools, getToolsByCategory, getToolById, searchTools } from "../database/queries";
4import { AITool, SearchRequest, ToolCategory } from "../../shared/types";
56const api = new Hono();
7const openai = new OpenAI();
89// Get all tools
65const allTools = await getAllTools();
66
67// Use OpenAI to analyze the query and recommend tools
68const aiResponse = await openai.chat.completions.create({
69model: "gpt-4o-mini",
70messages: [
internshipREADME.md1 match
46- Frontend: React with Tailwind CSS
47- Backend: Hono API framework
48- AI: OpenAI for query understanding and tool recommendations
49- Database: SQLite for tool information storage
2import React, { useState, useEffect, useCallback } from "https://esm.sh/react@18.2.0";
3import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
4import { OpenAI } from "https://esm.town/v/std/openai";
56// Enhanced subjects with more detailed metadata
394395export default async function server(request: Request): Promise<Response> {
396const { OpenAI } = await import("https://esm.town/v/std/openai");
397const openai = new OpenAI();
398399if (request.method === 'POST') {
402if (request.url.includes('/generate-question')) {
403try {
404const completion = await openai.chat.completions.create({
405messages: [
406{
Twilionew-file-5038.tsx3 matches
3const incomingMsg = formData.get("Body")?.toString();
45// Send the SMS text to OpenAI
6const response = await fetch("https://api.openai.com/v1/chat/completions", {
7method: "POST",
8headers: {
9Authorization: `Bearer ${Deno.env.get("OPENAI_API_KEY")}`,
10"Content-Type": "application/json",
11},
Towniesystem_prompt.txt4 matches
88Note: When changing a SQLite table's schema, change the table's name (e.g., add _2 or _3) to create a fresh table.
8990### OpenAI
9192```ts
93import { OpenAI } from "https://esm.town/v/std/openai";
94const openai = new OpenAI();
95const completion = await openai.chat.completions.create({
96messages: [
97{ role: "user", content: "Say hello in a creative way" },
Townie.cursorrules4 matches
94Note: When changing a SQLite table's schema, change the table's name (e.g., add _2 or _3) to create a fresh table.
9596### OpenAI
9798```ts
99import { OpenAI } from "https://esm.town/v/std/openai";
100const openai = new OpenAI();
101const completion = await openai.chat.completions.create({
102messages: [
103{ role: "user", content: "Say hello in a creative way" },
Towniesystem_prompt.txt4 matches
88Note: When changing a SQLite table's schema, change the table's name (e.g., add _2 or _3) to create a fresh table.
8990### OpenAI
9192```ts
93import { OpenAI } from "https://esm.town/v/std/openai";
94const openai = new OpenAI();
95const completion = await openai.chat.completions.create({
96messages: [
97{ role: "user", content: "Say hello in a creative way" },
Townie.cursorrules4 matches
94Note: When changing a SQLite table's schema, change the table's name (e.g., add _2 or _3) to create a fresh table.
9596### OpenAI
9798```ts
99import { OpenAI } from "https://esm.town/v/std/openai";
100const openai = new OpenAI();
101const completion = await openai.chat.completions.create({
102messages: [
103{ role: "user", content: "Say hello in a creative way" },
GPUNIONai-service.ts12 matches
1import { OpenAI } from "https://esm.town/v/std/openai";
2import { Video, ClipSuggestion, KeyframeInfo, TranscriptSegment } from '../../shared/types.ts';
34// Initialize OpenAI client
5const openai = new OpenAI();
67/**
25
26// In a real implementation, we would analyze the actual video content
27// For this demo, we'll simulate video analysis using OpenAI
28
29// First, check if we have transcript data
70async function simulateTranscriptGeneration(video: Video): Promise<TranscriptSegment[]> {
71// In a real implementation, we would use a speech-to-text service
72// For this demo, we'll generate a fake transcript using OpenAI
73
74const prompt = `Generate a realistic transcript for a ${video.duration || 300} second video titled "${video.title}".
78Format the response as a JSON array of objects with 'start', 'end', and 'text' properties.`;
7980const completion = await openai.chat.completions.create({
81model: "gpt-4o-mini",
82messages: [{ role: "user", content: prompt }],
114): Promise<KeyframeInfo[]> {
115// In a real implementation, we would analyze video frames and audio
116// For this demo, we'll use OpenAI to identify potential key moments from the transcript
117
118const transcriptText = transcript.map(segment => segment.text).join(" ");
129Format the response as a JSON array of objects with 'time', 'confidence', and 'description' properties.`;
130131const completion = await openai.chat.completions.create({
132model: "gpt-4o-mini",
133messages: [{ role: "user", content: prompt }],
254): Promise<string> {
255// In a real implementation, we would use more sophisticated NLP
256// For this demo, we'll use OpenAI to generate a title
257
258const transcriptText = relevantTranscript.map(segment => segment.text).join(" ");
267The title should be attention-grabbing and optimized for social media engagement.`;
268269const completion = await openai.chat.completions.create({
270model: "gpt-4o-mini",
271messages: [{ role: "user", content: prompt }],
286): Promise<string> {
287// In a real implementation, we would use more sophisticated NLP
288// For this demo, we'll use OpenAI to generate a description
289
290const transcriptText = relevantTranscript.map(segment => segment.text).join(" ");
301Include relevant hashtags if appropriate.`;
302303const completion = await openai.chat.completions.create({
304model: "gpt-4o-mini",
305messages: [{ role: "user", content: prompt }],