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": "*",
You can access search results via JSON API by adding format=json
to your query:
https://codesearch.val.run/$%7Burl%7D?q=openai&page=1&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 1576 results for "openai"(1490ms)
1import { OpenAI } from "https://esm.town/v/std/openai";
23export default async function(req: Request): Promise<Response> {
11});
12}
13const openai = new OpenAI();
1415try {
28}
2930const stream = await openai.chat.completions.create(body);
3132if (!body.stream) {
1import { OpenAI } from "https://esm.town/v/std/openai";
23export default async function(req: Request): Promise<Response> {
11});
12}
13const openai = new OpenAI();
1415try {
28}
2930const stream = await openai.chat.completions.create(body);
3132if (!body.stream) {