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=101&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 1603 results for "openai"(1419ms)

VALLEREADME.md1 match

@kate•Updated 6 months ago
6* Fork this val to your own profile.
7* Make a folder for the temporary vals that get generated, take the ID from the URL, and put it in `tempValsParentFolderId`.
8* If you want to use OpenAI models you need to set the `OPENAI_API_KEY` [env var](https://www.val.town/settings/environment-variables).
9* If you want to use Anthropic models you need to set the `ANTHROPIC_API_KEY` [env var](https://www.val.town/settings/environment-variables).
10* Create a [Val Town API token](https://www.val.town/settings/api), open the browser preview of this val, and use the API token as the password to log in.

GDI_AITranslatorREADME.md1 match

@rozek_at_hft•Updated 6 months ago
8It contains a simple web page which allows users to enter some german (or other
9non-english) text and send it to a preconfigured server. That server translates
10the text with the help of OpenAI and sends the result back to this app where it
11is finally presented to the user.
12
80
81 const API_CONFIG = {
82 url: "https://willthereader-openaidefiner.web.val.run",
83 method: "POST",
84 mode: "cors",

healthtech4africamain.tsx3 matches

@thomaskangah•Updated 7 months ago
159
160export default async function server(request: Request): Promise<Response> {
161 const { OpenAI } = await import("https://esm.town/v/std/openai");
162 const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
163 const openai = new OpenAI();
164
165 const SCHEMA_VERSION = 2;
230 }
231
232 const completion = await openai.chat.completions.create({
233 messages: [
234 { role: "system", content: systemMessage },

email_channelREADME.md1 match

@campsite•Updated 7 months ago
3This val creates an email address that posts forwarded emails to a [Campsite](https://campsite.com) channel.
4
5It uses GPT-4 to extract a readable version of the forwarded email from the raw body. If you don't want to use GPT-4, omit the `OPENAI_API_KEY` and the raw body will be included in the post. Other providers are available via [Vercel's AI SDK](https://sdk.vercel.ai/docs/introduction#model-providers).
6
7For help with creating integrations, check out the [Campsite API docs](https://app.campsite.com/campsite/p/notes/campsite-api-docs-l07d7gm5n5rm). You'll need to create an integration and get an API key.

weatherGPTmain.tsx3 matches

@kevinforrestconnors•Updated 7 months 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",

GDI_AIChatCompletionServicemain.tsx3 matches

@rozek•Updated 7 months ago
1import { OpenAI } from "https://esm.town/v/std/openai";
2
3export default async function (req: Request): Promise<Response> {
19 }
20
21 const openai = new OpenAI();
22 const completion = await openai.chat.completions.create({
23 model: "gpt-4o-mini",
24 messages: [

GDI_AIChatCompletionServiceREADME.md1 match

@rozek•Updated 7 months ago
8It contains a simple HTTP end point which expects a POST request with a JSON
9structure containing the properties "SystemMessage" and "UserMessage". These
10message are then used to run an OpenAI chat completion and produce an "assistant
11message" which is sent back to the client as plain text.
12

GDI_AITranslatorREADME.md1 match

@rozek•Updated 7 months ago
8It contains a simple web page which allows users to enter some german (or other
9non-english) text and send it to a preconfigured server. That server translates
10the text with the help of OpenAI and sends the result back to this app where it
11is finally presented to the user.
12

GDI_AITranslatorServicemain.tsx5 matches

@rozek•Updated 7 months ago
1import { OpenAI } from "https://esm.town/v/std/openai";
2
3export default async function (req: Request): Promise<Response> {
16 }
17
18 // Initialize OpenAI
19 const openai = new OpenAI();
20
21 // Translate the text using OpenAI
22 const completion = await openai.chat.completions.create({
23 messages: [
24 { role: "system", content: "You are a German to English translator. Translate the following text to English:" },

translateToEnglishWithOpenAI1 file match

@shlmt•Updated 1 day ago

testOpenAI1 file match

@stevekrouse•Updated 3 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": "*",