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=187&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 2086 results for "openai"(3624ms)

gpt4ExampleREADME.md1 match

@stevekrouse•Updated 1 year ago
3This uses the brand new `gpt-4-1106-preview`.
4
5To use this, set `OPENAI_API_KEY` in your [Val Town Secrets](https://www.val.town/settings/secrets).
6
7Migrated from folder: Archive/IntroVideo/gpt4Example

gpt4TurboExamplemain.tsx3 matches

@stevekrouse•Updated 1 year ago
1import { OpenAI } from "npm:openai";
2
3const openai = new OpenAI();
4let chatCompletion = await openai.chat.completions.create({
5 messages: [{ role: "user", content: "Teach me a word I don't know" }],
6 model: "gpt-4-1106-preview",

emojiSearchBotmain.tsx3 matches

@stevekrouse•Updated 1 year ago
4import { twitterJSON } from "https://esm.town/v/stevekrouse/twitterJSON";
5import process from "node:process";
6import OpenAI from "npm:openai";
7
8const openai = new OpenAI({ apiKey: process.env.openai });
9
10export async function emojiSearchBot({ lastRunAt }: Interval) {
21 let attachment = result.includes.media.find(m => m.media_key === latestTweet.attachments.media_keys[0]);
22 if (attachment.type !== "photo") return;
23 const response = await openai.chat.completions.create({
24 model: "gpt-4-vision-preview",
25 messages: [

gpt4vDemomain.tsx3 matches

@stevekrouse•Updated 1 year ago
1import process from "node:process";
2import OpenAI from "npm:openai";
3
4const openai = new OpenAI({ apiKey: process.env.openai });
5
6async function main() {
7 const response = await openai.chat.completions.create({
8 model: "gpt-4-vision-preview",
9 messages: [

gptExamplemain.tsx3 matches

@stevekrouse•Updated 1 year ago
1import process from "node:process";
2import { OpenAI } from "npm:openai";
3
4const openai = new OpenAI({ apiKey: process.env.openai });
5let chatCompletion = await openai.chat.completions.create({
6 messages: [{ role: "user", content: "Make a short joke or pun" }],
7 model: "gpt-3.5-turbo",

rateArticleRelevancemain.tsx3 matches

@iakovos•Updated 1 year ago
2
3export const rateArticleRelevance = async (interests: string, article: any) => {
4 const { default: OpenAI } = await import("npm:openai");
5 const openai = new OpenAI({ apiKey: process.env.OPENAI_KEY });
6
7 try {
12 Give a score from 0 to 10. Why did you give this score? Respond with the score only.
13 `;
14 const response = await openai.chat.completions.create({
15 messages: [
16 {

modelInvokemain.tsx3 matches

@stevekrouse•Updated 1 year ago
1import process from "node:process";
2import { ChatOpenAI } from "npm:langchain/chat_models/openai";
3
4const model = new ChatOpenAI({
5 temperature: 0.9,
6 openAIApiKey: process.env.openai,
7});
8

getChatgptmain.tsx2 matches

@bingo16•Updated 1 year ago
17 "Content-Type": "application/json",
18 // Update your token in https://val.town/settings/secrets
19 Authorization: `Bearer ${token || process.env.openaiKey}`,
20 };
21
22 const getCompelitoins = async (data) => {
23 const response = await fetch("https://api.openai.com/v1/completions", {
24 method: "POST",
25 headers: {

catFactmain.tsx2 matches

@yuval_dikerman•Updated 1 year ago
8 "Rewrite this fact about cats as if it was written for 3 year old:\n\n" +
9 fact;
10 const story = await fetch("https://api.openai.com/v1/chat/completions", {
11 method: "POST",
12 body: JSON.stringify({
16 }),
17 headers: {
18 "Authorization": `Bearer ${process.env.OPENAI}`,
19 "Content-Type": "application/json",
20 },

getMemoryBuildermain.tsx4 matches

@webup•Updated 1 year ago
3export async function getMemoryBuilder(spec: {
4 type: "buffer" | "summary" | "vector";
5 provider?: "openai";
6} = { type: "buffer" }, options = {}) {
7 const { cond, matches } = await import("npm:lodash-es");
15 ],
16 [
17 matches({ type: "summary", provider: "openai" }),
18 async () => {
19 const { ConversationSummaryMemory } = await import(
26 ],
27 [
28 matches({ type: "vector", provider: "openai" }),
29 async () => {
30 const { VectorStoreRetrieverMemory } = await import(
36 const builder = await getModelBuilder({
37 type: "embedding",
38 provider: "openai",
39 });
40 const model = await builder();

openai_enrichment6 file matches

@stevekrouse•Updated 6 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