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

stevensDemo.cursorrules4 matches

@Loadelongboard•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

@donncha•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

@ewancameron•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" },

groqAudioChatgroqAudioChat3 matches

@pierremenard•Updated 1 week ago
68 console.log("🎤 Sending request to Groq Whisper API");
69 const start = Date.now();
70 const response = await fetch("https://api.groq.com/openai/v1/audio/transcriptions", {
71 method: "POST",
72 headers: {
158 console.log("🔵 Sending request to Groq API");
159 const start = Date.now();
160 const response = await fetch("https://api.groq.com/openai/v1/chat/completions", {
161 method: "POST",
162 headers: {
216 console.log("🔊 Sending request to Groq Speech API");
217 const start = Date.now();
218 const response = await fetch("https://api.groq.com/openai/v1/audio/speech", {
219 method: "POST",
220 headers: {

groqAudioChattts.ts1 match

@pierremenard•Updated 1 week ago
26 console.log("🔊 Sending request to Groq Speech API");
27 const start = Date.now();
28 const response = await fetch("https://api.groq.com/openai/v1/audio/speech", {
29 method: "POST",
30 headers: {

groqAudioChatchat.ts1 match

@pierremenard•Updated 1 week ago
20 console.log("🔵 Sending request to Groq API");
21 const start = Date.now();
22 const response = await fetch("https://api.groq.com/openai/v1/chat/completions", {
23 method: "POST",
24 headers: {

groqAudioChataudio.ts1 match

@pierremenard•Updated 1 week ago
63 console.log("🎤 Sending request to Groq Whisper API");
64 const start = Date.now();
65 const response = await fetch("https://api.groq.com/openai/v1/audio/transcriptions", {
66 method: "POST",
67 headers: {

recallone.cursorrules4 matches

@nom•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

@velebanet•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" },

gptToolsabstractClass8 matches

@nbbaier•Updated 1 week ago
1import OpenAI, { type ClientOptions } from "npm:openai";
2
3export interface WriterOptions extends ClientOptions {
7export abstract class AbstractWriter {
8 model: string;
9 openai: OpenAI;
10
11 constructor(options: WriterOptions) {
12 const { model, ...openaiOptions } = options;
13
14 this.model = model ? model : "gpt-3.5-turbo";
15 this.openai = new OpenAI(openaiOptions);
16 }
17
18 protected abstract createPrompt(...args: any[]): string;
19
20 protected async performOpenAICall(prompt: string) {
21 try {
22 const response = await this.openai.chat.completions.create({
23 messages: [{ role: "system", content: prompt }],
24 model: this.model,
26
27 if (!response.choices || response.choices.length === 0) {
28 throw new Error("No response from OpenAI");
29 }
30
32
33 if (!output) {
34 throw new Error("No output returned by OpenAI. Try again.");
35 }
36

stevens-openai5 file matches

@yash_ing•Updated 1 day ago

openaiPricing9 file matches

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