Val Town Code SearchReturn to Val Town

API Access

You can access search results via JSON API by adding format=json to your query:

https://codesearch.val.run/$%7Bart_info.art.src%7D?q=openai&page=133&format=json

For typeahead suggestions, use the /typeahead endpoint:

https://codesearch.val.run/typeahead?q=openai

Returns an array of strings in format "username" or "username/projectName"

Found 1576 results for "openai"(1274ms)

webscrapeWikipediaIntromain.tsx1 match

@richardkaplan•Updated 1 year ago
4 const cheerio = await import("npm:cheerio");
5 const html = await fetchText(
6 "https://en.wikipedia.org/wiki/OpenAI",
7 );
8 const $ = cheerio.load(html);

weatherGPTmain.tsx3 matches

@dantaeyoung•Updated 1 year ago
1import { email } from "https://esm.town/v/std/email?v=11";
2import { OpenAI } from "npm:openai";
3
4let location = "brooklyn ny";
8).then(r => r.json());
9
10const openai = new OpenAI();
11let chatCompletion = await openai.chat.completions.create({
12 messages: [{
13 role: "user",

weatherGPTREADME.md1 match

@dantaeyoung•Updated 1 year ago
1If you fork this, you'll need to set `OPENAI_API_KEY` in your [Val Town Secrets](https://www.val.town/settings/secrets).
2
3

instructorExamplemain.tsx3 matches

@inkpotmonkey•Updated 1 year ago
1import Instructor from "https://esm.sh/@instructor-ai/instructor";
2import OpenAI from "https://esm.sh/openai";
3import { z } from "https://esm.sh/zod";
4
5const openAISecrets = {
6 apiKey: getApiKey(),
7 organization: getOrganisationKey(),
8};
9
10const oai = new OpenAI(openAISecrets);
11
12const client = Instructor({

weatherGPTmain.tsx3 matches

@liaolile•Updated 1 year ago
1import { email } from "https://esm.town/v/std/email?v=11";
2import { fetch } from "https://esm.town/v/std/fetch";
3import { OpenAI } from "npm:openai";
4
5let location = "shenzhen";
9).then(r => r.json());
10
11const openai = new OpenAI();
12let chatCompletion = await openai.chat.completions.create({
13 messages: [{
14 role: "user",

weatherGPTREADME.md1 match

@liaolile•Updated 1 year ago
1If you fork this, you'll need to set `OPENAI_API_KEY` in your [Val Town Secrets](https://www.val.town/settings/secrets).
2
3

gpt4Examplemain.tsx4 matches

@kyutarou•Updated 1 year ago
1import { OpenAI } from "npm:openai";
2Deno.env.get("OPENAI_API_KEY");
3
4const openai = new OpenAI();
5let chatCompletion = await openai.chat.completions.create({
6 messages: [{
7 role: "user",

gpt4ExampleREADME.md1 match

@kyutarou•Updated 1 year ago
3This uses the brand new `gpt-4-1106-preview`.
4
5To use this, set `OPENAI_API_KEY` in your [Val Town Secrets](https://www.val.town/settings/secrets).

get_weather_messagemain.tsx1 match

@cosmo•Updated 1 year ago
1import { chat } from "https://esm.town/v/cosmo/chat_openai";
2import { getCurrentWeather } from "https://esm.town/v/cosmo/get_current_weather";
3

chat_openaimain.tsx3 matches

@cosmo•Updated 1 year ago
1const { default: OpenAI } = await import("npm:openai");
2
3export async function chat(apiKey, messages) {
4 const openai = new OpenAI({ apiKey });
5
6 return openai.chat.completions.create({
7 messages,
8 model: "gpt-3.5-turbo",

testOpenAI1 file match

@stevekrouse•Updated 9 hours ago

testOpenAI1 file match

@shouser•Updated 2 days ago
lost1991
import { OpenAI } from "https://esm.town/v/std/openai"; export default async function(req: Request): Promise<Response> { if (req.method === "OPTIONS") { return new Response(null, { headers: { "Access-Control-Allow-Origin": "*",