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=142&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 1568 results for "openai"(789ms)

gpt4main.tsx1 match

@rlimit•Updated 1 year ago
3
4/**
5 * OpenAI text completion. https://platform.openai.com/docs/api-reference/completions
6 *
7 * val.town and rlimit.com has generously provided a free daily quota. Until the quota is met, no need to provide an API key.

getOpenapiEmbeddingmain.tsx1 match

@wilt•Updated 1 year ago
9 query: string;
10}): Promise<number[]> =>
11 fetchJSON("https://api.openai.com/v1/embeddings", {
12 method: "POST",
13 headers: {

questionsWithGuidelinesChainmain.tsx6 matches

@jacoblee93•Updated 1 year ago
2
3export const questionsWithGuidelinesChain = (async () => {
4 const { ChatOpenAI } = await import(
5 "https://esm.sh/langchain@0.0.150/chat_models/openai"
6 );
7 const { LLMChain } = await import("https://esm.sh/langchain@0.0.150/chains");
19 ]);
20 const questionChain = questionPrompt
21 .pipe(new ChatOpenAI({
22 openAIApiKey: process.env.OPENAI_API_KEY,
23 })
24 .pipe(new StringOutputParser()));
31 const styleChain = stylePrompt
32 .pipe(
33 new ChatOpenAI({
34 openAIApiKey: process.env.OPENAI_API_KEY,
35 }),
36 )

askLeximain.tsx6 matches

@thomasatflexos•Updated 1 year ago
15 );
16 const { SupabaseVectorStore } = await import("npm:langchain/vectorstores");
17 const { ChatOpenAI } = await import("npm:langchain/chat_models");
18 const { OpenAIEmbeddings } = await import("npm:langchain/embeddings");
19 const { createClient } = await import(
20 "https://esm.sh/@supabase/supabase-js@2"
25 );
26 let streamedResponse = "";
27 const chat = new ChatOpenAI({
28 modelName: "gpt-3.5-turbo",
29 openAIApiKey: process.env.OPEN_API_KEY,
30 streaming: true,
31 callbacks: [{
35 });
36 const vectorStore = await SupabaseVectorStore.fromExistingIndex(
37 new OpenAIEmbeddings({
38 openAIApiKey: process.env.OPEN_API_KEY,
39 }),
40 {

generateValCodeAPImain.tsx1 match

@andreterron•Updated 1 year ago
4export let generateValCodeAPI = (description: string) =>
5 generateValCode(
6 process.env.VT_OPENAI_KEY,
7 description,
8 );

big_stories_ranksmain.tsx3 matches

@tmcw•Updated 1 year ago
61 "ranks": [[1689676050115, 8], [1689679650435, 9], [1689683250422, 9], [1689686850141, 9], [1689690449649, 9], [1689694050066, 10]]
62 },
63 "https://www.nytimes.com/2023/07/18/technology/openai-chatgpt-facial-recognition.html": {
64 "title": "OpenAI Worries About What Its Chatbot Will Say About People’s Faces",
65 "url": "https://www.nytimes.com/2023/07/18/technology/openai-chatgpt-facial-recognition.html",
66 "section": "technology",
67 "ranks": [[1689676050115, 9], [1689679650435, 10], [1689683250422, 10], [1689686850141, 10], [1689690449649, 10], [1689694050066, 11]]

unserializeableLogExmain.tsx4 matches

@stevekrouse•Updated 1 year ago
2
3export let unserializeableLogEx = (async () => {
4 const { Configuration, OpenAIApi } = await import("npm:openai");
5 const configuration = new Configuration({
6 apiKey: process.env.openai,
7 });
8 const openai = new OpenAIApi(configuration);
9 console.log(openai);
10})();

unserializeableLogExmain.tsx4 matches

@stevekrouse•Updated 1 year ago
2
3export let unserializeableLogEx = (async () => {
4 const { Configuration, OpenAIApi } = await import("npm:openai");
5 const configuration = new Configuration({
6 apiKey: process.env.openai,
7 });
8 const openai = new OpenAIApi(configuration);
9 console.log(openai);
10})();

kindnessmain.tsx1 match

@nate•Updated 1 year ago
4export let kindness = async () => {
5 return await gpt3({
6 openAiKey: process.env.OPENAI_API_KEY,
7 prompt:
8 "Speaking as universal consciousness, say something short, true, uplifting, loving, and kind.",

generateValCodemain.tsx3 matches

@andreterron•Updated 1 year ago
1import { openaiChatCompletion } from "https://esm.town/v/andreterron/openaiChatCompletion";
2
3export const generateValCode = async (
16 \`\`\`
17 `;
18 const response = await openaiChatCompletion({
19 openaiKey: key,
20 organization: org,
21 body: {

testOpenAI1 file match

@shouser•Updated 1 day ago

testOpenAI1 file match

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