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/image-url.jpg%20%22Optional%20title%22?q=openai&page=132&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 1606 results for "openai"(563ms)

cronpromptmain.tsx3 matches

@stevekrouse•Updated 1 year ago
1import { OpenAI } from "https://esm.town/v/std/openai";
2
3export async function cronprompt(prompt: string) {
4 const openai = new OpenAI();
5
6 const functionExpression = await openai.chat.completions.create({
7 messages: [
8 {

langchainExmain.tsx3 matches

@weaverwhale•Updated 1 year ago
2
3export const langchainEx = (async () => {
4 const { OpenAI } = await import("https://esm.sh/langchain/llms/openai");
5 const { PromptTemplate } = await import("https://esm.sh/langchain/prompts");
6 const { LLMChain } = await import("https://esm.sh/langchain/chains");
7 const model = new OpenAI({
8 temperature: 0.9,
9 openAIApiKey: process.env.openai,
10 maxTokens: 100,
11 }, {});

apricotTurkeymain.tsx3 matches

@stevekrouse•Updated 1 year ago
1import { OpenAI } from "https://esm.town/v/std/openai?v=2";
2
3const openai = new OpenAI();
4const functionExpression = await openai.chat.completions.create({
5 "messages": [
6 { "role": "user", "content": "whats the weather in sf" },

openAiHelloWorldREADME.md1 match

@yawnxyz•Updated 1 year ago
1Migrated from folder: Libraries/ai/OpenAI/openAiHelloWorld

openAiHelloWorldmain.tsx4 matches

@yawnxyz•Updated 1 year ago
1import { OpenAI } from "npm:openai";
2
3// Create a secret named OPENAI_API_KEY at https://www.val.town/settings/environment-variables
4
5const openai = new OpenAI();
6const functionExpression = await openai.chat.completions.create({
7 "messages": [
8 { "role": "user", "content": "Say hello in a creative way" },

openAIHonoChatStreamExampleREADME.md2 matches

@yawnxyz•Updated 1 year ago
1Example of using Hono to stream OpenAI's streamed chat responses!
2
3Migrated from folder: Utils/ai/examples/openAIHonoChatStreamExample

GistGPTmain.tsx3 matches

@weaverwhale•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2import { Hono } from "npm:hono";
3import { OpenAI } from "npm:openai";
4
5const gistGPT = async (input: string, about?: boolean) => {
8 const chatInput = about ? input : await (await fetch(input)).text();
9
10 const openai = new OpenAI();
11 let chatCompletion = await openai.chat.completions.create({
12 messages: [
13 {

valwritermain.tsx1 match

@yawnxyz•Updated 1 year ago
1/** @jsxImportSource npm:hono@3/jsx */
2import { fetchText } from "https://esm.town/v/stevekrouse/fetchText";
3import { chat } from "https://esm.town/v/stevekrouse/openai";
4import cronstrue from "npm:cronstrue";
5import { Hono } from "npm:hono@3";

PriestGPTmain.tsx3 matches

@mjweaver01•Updated 1 year ago
1import { Hono } from "npm:hono";
2import { OpenAI } from "npm:openai";
3
4const priestGPT = async (verse: string, about?: boolean) => {
5 const openai = new OpenAI();
6 let chatCompletion = await openai.chat.completions.create({
7 messages: [
8 {

PriestGPTREADME.md1 match

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

translateToEnglishWithOpenAI1 file match

@shlmt•Updated 2 days ago

testOpenAI1 file match

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