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/?q=openai&page=9&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 346 results for "openai"(282ms)

openaiPricingcreateDayTotal1 match

@nbbaier•Updated 1 week ago
2import { getImageTotals } from "./getImageTotals";
3import { getTextTotals } from "./getTextTotals";
4import { DayTotal, UsageDB } from "./openAiUsageTypes";
5
6const createDayTotal = async (data, whisper_api_data, dalle_api_data) => {

openaiPricingopenAiPricing2 matches

@nbbaier•Updated 1 week ago
10});
11
12interface OpenAiPricing {
13 textPricing: {
14 [key: string]: {
29}
30
31export const openAiPricing: OpenAiPricing = {
32 textPricing: {
33 "gpt-3.5-turbo-16k-0613": createPricing(3000, 4000),

openaiPricingfetchAndStoreOpenAiUsage24 matches

@nbbaier•Updated 1 week ago
1import { createDayTotal } from "./createDayTotal";
2import { cronEvalLogger as logger } from "https://esm.town/v/nbbaier/cronLogger";
3import { fetchOpenAiUsageData } from "./fetchOpenAiUsageData";
4import { updateBlobUsageDB } from "./updateBlobUsageDB";
5import { blob } from "https://esm.town/v/std/blob?v=11";
7import { DateTime } from "npm:luxon";
8
9const fetchAndStoreOpenAiUsage = async (interval: Interval) => {
10 const timeZone = "America/Chicago";
11 const date = DateTime.now();
15
16 try {
17 const { data, whisper_api_data, dalle_api_data } = await fetchOpenAiUsageData(today);
18
19 const day_total = await createDayTotal(data, whisper_api_data, dalle_api_data);
27};
28
29export default logger(fetchAndStoreOpenAiUsage);
IcarusBot

IcarusBot.cursorrules4 matches

@wittiest•Updated 1 week ago
100Note: When changing a SQLite table's schema, change the table's name (e.g., add _2 or _3) to create a fresh table.
101
102### OpenAI
103```ts
104import { OpenAI } from "https://esm.town/v/std/openai";
105const openai = new OpenAI();
106const completion = await openai.chat.completions.create({
107 messages: [
108 { role: "user", content: "Say hello in a creative way" },

familyAI3 matches

@meltedfire•Updated 1 week ago
1import { OpenAI } from "https://esm.town/v/std/openai";
2
3export default async function anthropicCompletion(
4 prompt: string,
5) {
6 const openai = new OpenAI();
7
8 try {
9 const completion = await openai.chat.completions.create({
10 messages: [
11 { role: "user", content: prompt },

my-first-val04_email.tsx4 matches

@stevetestproj•Updated 1 week ago
3
4import { email } from "https://esm.town/v/std/email";
5import { OpenAI } from "https://esm.town/v/std/OpenAI";
6
7// ------------------------------ Email Address ------------------------------
19 console.log(e);
20
21 // Use OpenAI provided by Val Town to reply to the email
22 const openai = new OpenAI();
23 let chatCompletion = await openai.chat.completions.create({
24 messages: [{
25 role: "user",

my-first-val03_cron.tsx5 matches

@stevetestproj•Updated 1 week ago
5// ---------------- Val Town Standard Library ----------------
6// Val Town provides limited free hosted services, including
7// functions for sending emails and using OpenAI
8import { email } from "https://esm.town/v/std/email";
9import { OpenAI } from "https://esm.town/v/std/OpenAI";
10
11// --------------------- Get weather data --------------------
22
23export default async function() {
24 // Use OpenAI provided by Val Town to get weather reccomendation
25 // Experiment with changing the prompt
26 const openai = new OpenAI();
27 let chatCompletion = await openai.chat.completions.create({
28 messages: [{
29 role: "user",

stevensDemo.cursorrules4 matches

@jed•Updated 1 week ago
100Note: When changing a SQLite table's schema, change the table's name (e.g., add _2 or _3) to create a fresh table.
101
102### OpenAI
103```ts
104import { OpenAI } from "https://esm.town/v/std/openai";
105const openai = new OpenAI();
106const completion = await openai.chat.completions.create({
107 messages: [
108 { role: "user", content: "Say hello in a creative way" },

stevensDemo.cursorrules4 matches

@leroyg•Updated 1 week ago
100Note: When changing a SQLite table's schema, change the table's name (e.g., add _2 or _3) to create a fresh table.
101
102### OpenAI
103```ts
104import { OpenAI } from "https://esm.town/v/std/openai";
105const openai = new OpenAI();
106const completion = await openai.chat.completions.create({
107 messages: [
108 { role: "user", content: "Say hello in a creative way" },

stevensDemo.cursorrules4 matches

@nicnzl•Updated 1 week ago
100Note: When changing a SQLite table's schema, change the table's name (e.g., add _2 or _3) to create a fresh table.
101
102### OpenAI
103```ts
104import { OpenAI } from "https://esm.town/v/std/openai";
105const openai = new OpenAI();
106const completion = await openai.chat.completions.create({
107 messages: [
108 { role: "user", content: "Say hello in a creative way" },

stevens-openai5 file matches

@yash_ing•Updated 1 day ago

openaiPricing9 file matches

@nbbaier•Updated 1 week ago
Project created from val URLs