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=144&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"(1043ms)

langchainExmain.tsx4 matches

@jacoblee93•Updated 1 year ago
2
3export const langchainEx = (async () => {
4 const { ChatOpenAI } = await import(
5 "https://esm.sh/langchain/chat_models/openai"
6 );
7 const { PromptTemplate } = await import("https://esm.sh/langchain/prompts");
8 const { LLMChain } = await import("https://esm.sh/langchain/chains");
9 const model = new ChatOpenAI({
10 temperature: 0.9,
11 openAIApiKey: process.env.OPENAI_API_KEY,
12 verbose: true,
13 });

chatAgentWithCustomPromptmain.tsx4 matches

@jacoblee93•Updated 1 year ago
2
3export const chatAgentWithCustomPrompt = (async () => {
4 const { ChatOpenAI } = await import(
5 "https://esm.sh/langchain/chat_models/openai"
6 );
7 const { initializeAgentExecutorWithOptions } = await import(
11 "https://esm.sh/langchain/tools/calculator"
12 );
13 const model = new ChatOpenAI({
14 temperature: 0,
15 openAIApiKey: process.env.OPENAI_API_KEY,
16 });
17 const tools = [

createRelevantCommentmain.tsx2 matches

@thomasatflexos•Updated 1 year ago
1import { getOpenAiResponse } from "https://esm.town/v/thomasatflexos/getOpenAiResponse";
2import { getRelevantContent } from "https://esm.town/v/thomasatflexos/getRelevantContent";
3import process from "node:process";
57 \n IF you think that the Linkedin post is about new job opportunities, just respond with the text "N/A" and stop immediately. Do not respond any further.
58 \n ELSE IF you think the Linkdedin post is not about new job opportunities, please proceed to a meaningful comment to the provided Linkedin post based on the provided context and include ${link} in the post in a clever and relevant way, (don't be too blatant).`;
59 let finalResponse = await getOpenAiResponse(PROMPT);
60 const { data1, error1 } = await supabase
61 .from("linkedin_seedings")

generateEmbeddingsmain.tsx3 matches

@thomasatflexos•Updated 1 year ago
13 });
14 }
15 const { OpenAIEmbeddings } = await import("npm:langchain/embeddings");
16 const { createClient } = await import(
17 "https://esm.sh/@supabase/supabase-js@2"
39 const vectorStore = await SupabaseVectorStore.fromDocuments(
40 splittedDocs,
41 new OpenAIEmbeddings({
42 openAIApiKey: process.env.OPEN_API_KEY,
43 }),
44 {

chatGPTPluginmain.tsx2 matches

@stevekrouse•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
2import { openaiOpenAPI } from "https://esm.town/v/stevekrouse/openaiOpenAPI";
3
4// https://stevekrouse-chatgptplugin.express.val.run/.well-known/ai-plugin.json
38 // OpenAPI Spec
39 // only POST /v1/eval for now
40 res.send(openaiOpenAPI);
41 }
42 else if (req.path === "/v1/eval") {

openaiFineTunemain.tsx2 matches

@stevekrouse•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
2
3export function openaiFineTune({ key, model, trainingFile }: {
4 key: string;
5 model?: string;
7}) {
8 return fetchJSON(
9 "https://api.openai.com/v1/fine_tuning/jobs",
10 {
11 method: "POST",

autoGPT_Test2main.tsx4 matches

@stevekrouse•Updated 1 year ago
3
4export let autoGPT_Test2 = (async () => {
5 const { Configuration, OpenAIApi } = await import("npm:openai");
6 const configuration = new Configuration({
7 apiKey: process.env.openai,
8 });
9 const openai = new OpenAIApi(configuration);
10 const completion = await openai.createChatCompletion({
11 model: "gpt-3.5-turbo",
12 messages: [

imagesmain.tsx2 matches

@ale_annini•Updated 1 year ago
1import { openaiImages } from "https://esm.town/v/ale_annini/openaiImages";
2
3export const images = openaiImages({ prompt: "a dog", n: 2 });

chatmain.tsx5 matches

@chatgpt•Updated 1 year ago
5 options = {},
6) => {
7 // Initialize OpenAI API stub
8 const { Configuration, OpenAIApi } = await import("https://esm.sh/openai");
9 const configuration = new Configuration({
10 apiKey: process.env.OPENAI,
11 });
12 const openai = new OpenAIApi(configuration);
13 // Request chat completion
14 const messages = typeof prompt === "string"
15 ? [{ role: "user", content: prompt }]
16 : prompt;
17 const { data } = await openai.createChatCompletion({
18 model: "gpt-3.5-turbo-0613",
19 messages,

ListenTomain.tsx1 match

@zzz•Updated 1 year ago
4// https://api.val.town/v1/express/zzz.ListenTo?val=stevekrouse.whatIsValTown
5export async function ListenTo(req, res) {
6 const { val = "zzz.demoOpenAIGPT4Summary" } = req.query;
7 const url = `https://api.val.town/v1/run/${val.replace("@", "")}`
8 const resp = await fetch(url);

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": "*",