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/$%7Burl%7D?q=openai&page=135&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 1580 results for "openai"(977ms)

sqliteWriterREADME.md2 matches

@nbbaier•Updated 1 year ago
1# SQLite QueryWriter
2
3The QueryWriter class is a utility for generating and executing SQL queries using natural language and OpenAI. It provides a simplified interface for interacting with your Val Town SQLite database and generating SQL queries based on user inputs.
4
5This val is inspired by [prisma-gpt](https://github.com/aliyeysides/prisma-gpt). PRs welcome! See **Todos** below for some ideas I have.
44- `table`: The name of the database table to operate on.
45- `model` (optional): The model to use for generating SQL queries. Defaults to "gpt-3.5-turbo".
46- `apiKey` (optional): An OpenAI API key. Defaults to `Deno.env.get("OPENAI_API_KEY")`.
47
48

add_to_notion_w_ai_webpagemain.tsx3 matches

@nerdymomocat•Updated 1 year ago
4import Instructor from "npm:@instructor-ai/instructor";
5import { Client } from "npm:@notionhq/client";
6import OpenAI from "npm:openai";
7import { render } from "npm:preact-render-to-string";
8import { z } from "npm:zod";
30};
31
32const oai = new OpenAI({
33 apiKey: process.env.OPENAI_API_KEY ?? undefined,
34});
35

add_to_notion_w_aimain.tsx3 matches

@nerdymomocat•Updated 1 year ago
3import Instructor from "npm:@instructor-ai/instructor";
4import { Client } from "npm:@notionhq/client";
5import OpenAI from "npm:openai";
6import { z } from "npm:zod";
7
26};
27
28const oai = new OpenAI({
29 apiKey: process.env.OPENAI_API_KEY ?? undefined,
30});
31

add_to_notion_w_aiREADME.md1 match

@nerdymomocat•Updated 1 year ago
14Supports: checkbox, date, multi_select, number, rich_text, select, status, title, url, email
15
16- Uses `NOTION_API_KEY`, `OPENAI_API_KEY` stored in env variables and uses [Valtown blob storage](https://esm.town/v/std/blob) to store information about the database.
17- Use `get_notion_db_info` to use the stored blob if exists or create one, use `get_and_save_notion_db_info` to create a new blob (and replace an existing one if exists).
18

gpt3Examplemain.tsx2 matches

@ktodaz•Updated 1 year ago
2
3const gpt3Example = async () => {
4 const response = await fetch("https://api.openai.com/v1/completions", {
5 method: "POST",
6 headers: {
7 "Content-Type": "application/json",
8 "Authorization": "Bearer " + process.env.OPENAI_API_KEY, // Replace with your OpenAI API Key
9 },
10 body: JSON.stringify({

googlesearchmain.tsx1 match

@lolocoo•Updated 1 year ago
25
26 const getSearch = async (data) => {
27 const response = await fetch("https://api.openai.com/v1/completions", {
28 method: "GET",
29 body: JSON.stringify(data),

browserlessScrapeExamplemain.tsx1 match

@fab1an•Updated 1 year ago
8 method: "POST",
9 body: JSON.stringify({
10 "url": "https://en.wikipedia.org/wiki/OpenAI",
11 "elements": [{
12 // The second <p> element on the page

openAiFreeUsagemain.tsx1 match

@patrickjm•Updated 1 year ago
1// set at Sat Dec 09 2023 01:45:57 GMT+0000 (Coordinated Universal Time)
2export let openAiFreeUsage = {"used_quota":12709400,"used_quota_usd":1.27094,"exceeded":false};

weatherGPTmain.tsx3 matches

@treb0r•Updated 1 year ago
1import { email } from "https://esm.town/v/std/email?v=11";
2import { fetch } from "https://esm.town/v/std/fetch";
3import { OpenAI } from "npm:openai";
4
5let location = "Halifax UK";
9).then(r => r.json());
10
11const openai = new OpenAI();
12let chatCompletion = await openai.chat.completions.create({
13 messages: [{
14 role: "user",

weatherGPTREADME.md1 match

@treb0r•Updated 1 year ago
1If you fork this, you'll need to set `OPENAI_API_KEY` in your [Val Town Secrets](https://www.val.town/settings/secrets).
2
3

testOpenAI1 file match

@stevekrouse•Updated 1 day ago

testOpenAI1 file match

@shouser•Updated 3 days 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": "*",