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/$2?q=openai&page=190&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 2085 results for "openai"(2435ms)

welcomeEmailmain.tsx1 match

@rodrigotello•Updated 1 year ago
23 <li style="margin-bottom:6px">Reference your vals: <div style="${CSScodeStyling};">@me.fizz.split('buzz').length</div></li>
24 <li style="margin-bottom:6px">Reference others' vals: <div style="${CSScodeStyling};">@stevekrouse.moreBuzz()</div></li>
25 <li style="margin-bottom:6px">Reference personal secrets: <div style="${CSScodeStyling};">@me.secrets.openai</div></li>
26 <li style="margin-bottom:6px">Import from npm: <div style="${CSScodeStyling};">const _ = await import("npm:lodash-es")</div></li>
27 <li>Run keyboard shortcut: <div style="${CSScodeStyling};">cmd+enter</div></li>

openaiCompletionmain.tsx4 matches

@fgeierst•Updated 1 year ago
1import process from "node:process";
2
3export const openaiCompletion = async (prompt) => {
4 const { OpenAI } = await import("https://deno.land/x/openai/mod.ts");
5 const openAI = new OpenAI(process.env.OPENAI_API_KEY);
6 const completion = openAI.createCompletion({
7 model: "text-davinci-003",
8 prompt: prompt,

demoOpenAIGPTSummarymain.tsx2 matches

@zzz•Updated 1 year ago
2import { runVal } from "https://esm.town/v/std/runVal";
3
4export let demoOpenAIGPTSummary = await runVal(
5 "zzz.OpenAISummary",
6 confession,
7 {

gpt3main.tsx4 matches

@yuval_dikerman•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export let gpt3 = async (prompt: string, openAiApiKey: string): Promise<string> => {
4 if (!prompt || !openAiApiKey) {
5 let cat = await fetch("https://catfact.ninja/fact");
6 let { fact } = await cat.json();
9 );
10 }
11 const content = await fetch("https://api.openai.com/v1/chat/completions", {
12 method: "POST",
13 body: JSON.stringify({
17 }),
18 headers: {
19 "Authorization": `Bearer ${openAiApiKey}`,
20 "Content-Type": "application/json",
21 },

streamingTestmain.tsx3 matches

@jacoblee93•Updated 1 year ago
2
3export const streamingTest = (async () => {
4 const { OpenAI } = await import("https://esm.sh/langchain/llms/openai");
5 // To enable streaming, we pass in `streaming: true` to the LLM constructor.
6 // Additionally, we pass in a handler for the `handleLLMNewToken` event.
7 const chat = new OpenAI({
8 maxTokens: 25,
9 streaming: true,
10 openAIApiKey: process.env.OPENAI_API_KEY,
11 });
12 const response = await chat.call("Tell me a joke.", undefined, [

annoymain.tsx2 matches

@ajax•Updated 1 year ago
50 `;
51 console.log({ prompt });
52 const response = await fetch("https://api.openai.com/v1/completions", {
53 method: "POST",
54 headers: {
55 "Content-Type": "application/json",
56 "Authorization": "Bearer " + process.env.OPENAI_API_KEY, // Replace with your OpenAI API Key
57 },
58 body: JSON.stringify({

openAiFreeQuotaExceededmain.tsx3 matches

@patrickjm•Updated 1 year ago
1import { openAiFreeUsage } from "https://esm.town/v/patrickjm/openAiFreeUsage";
2
3export let openAiFreeQuotaExceeded = () =>
4 openAiFreeUsage.exceeded;

demoOpenAIGPT4Summarymain.tsx2 matches

@zzz•Updated 1 year ago
2import { runVal } from "https://esm.town/v/std/runVal";
3
4export let demoOpenAIGPT4Summary = await runVal(
5 "zzz.OpenAISummary",
6 confession,
7);

TokenizerDemomain.tsx1 match

@zzz•Updated 1 year ago
1import { Tokenizer } from "https://esm.town/v/zzz/Tokenizer";
2
3// Demo of tokenizer to mimic behavior of https://platform.openai.com/tokenizer
4// Tokenizer uses "gpt-3.5-turbo" model by default but this demo uses davinci to match the playground
5export const TokenizerDemo = (async () => {

weatherTomorrowGpt3Examplemain.tsx1 match

@patrickjm•Updated 1 year ago
4export let weatherTomorrowGpt3Example = weatherTomorrowGpt3({
5 city: "New York City",
6 openAiKey: process.env.openai_key,
7});

openai_enrichment6 file matches

@stevekrouse•Updated 5 hours ago

openai_enrichment1 file match

@charmaine•Updated 17 hours ago
reconsumeralization
import { OpenAI } from "https://esm.town/v/std/openai"; import { sqlite } from "https://esm.town/v/stevekrouse/sqlite"; /** * Practical Implementation of Collective Content Intelligence * Bridging advanced AI with collaborative content creation */ exp
kwhinnery_openai