You can access search results via JSON API by adding format=json
to your query:
https://codesearch.val.run/$%7BsvgDataUrl%7D?q=openai&page=6&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 2240 results for "openai"(2958ms)
1import { OpenAI } from "https://esm.town/v/std/openai";
23interface Project {
691692export default async function(req: Request): Promise<Response> {
693const openai = new OpenAI();
694const url = new URL(req.url);
695const CORS_HEADERS = {
710case "synthesizeProject": {
711const synthesisContent = `Current Date: ${new Date().toISOString().split("T")[0]}\n\nGoal: ${body.goal}`;
712const completion = await openai.chat.completions.create({
713model,
714messages: [{ role: "system", content: PROJECT_SYNTHESIS_PROMPT }, {
726JSON.stringify(body.tasks, null, 2)
727}`;
728const completion = await openai.chat.completions.create({
729model,
730messages: [{ role: "system", content: DAILY_REBALANCE_PROMPT }, {
755}
756757const completion = await openai.chat.completions.create({
758model,
759messages: [systemMessage, ...conversation],
87Note: When changing a SQLite table's schema, change the table's name (e.g., add _2 or_3) to create a fresh table.
8889### OpenAI
9091```ts
92import { OpenAI } from "https://esm.town/v/std/openai";
93const openai = new OpenAI();
94const completion = await openai.chat.completions.create({
95messages: [
96{ role: "user", content: "Say hello in a creative way" },