daily-advice-app1 file match
Random advice app using Advice Slip API
You can access search results via JSON API by adding format=json
to your query:
https://codesearch.val.run/$%7Bart_info.art.src%7D?q=api&page=1&format=json
For typeahead suggestions, use the /typeahead
endpoint:
https://codesearch.val.run/typeahead?q=api
Returns an array of strings in format "username" or "username/projectName"
Found 11380 results for "api"(807ms)
9293/**
94* Format chat history for Anthropic API
95*/
96function formatChatHistoryForAI(history) {
321bot.on("message", async (ctx) => {
322try {
323// Get Anthropic API key from environment
324const apiKey = Deno.env.get("ANTHROPIC_API_KEY");
325if (!apiKey) {
326console.error("Anthropic API key is not configured.");
327ctx.reply(
328"I apologize, but I'm not properly configured at the moment. Please inform the household administrator."
332333// Initialize Anthropic client
334const anthropic = new Anthropic({ apiKey });
335336// Get message text and user info
502// Set webhook if it is not set yet
503if (!isEndpointSet) {
504await bot.api.setWebhook(req.url, {
505secret_token: SECRET_TOKEN,
506});
18});
1920// --- API Routes for Memories ---
2122// GET /api/memories - Retrieve all memories
23app.get("/api/memories", async (c) => {
24const memories = await getAllMemories();
25return c.json(memories);
26});
2728// POST /api/memories - Create a new memory
29app.post("/api/memories", async (c) => {
30const body = await c.req.json<Omit<Memory, "id">>();
31if (!body.text) {
36});
3738// PUT /api/memories/:id - Update an existing memory
39app.put("/api/memories/:id", async (c) => {
40const id = c.req.param("id");
41const body = await c.req.json<Partial<Omit<Memory, "id">>>();
58});
5960// DELETE /api/memories/:id - Delete a memory
61app.delete("/api/memories/:id", async (c) => {
62const id = c.req.param("id");
63try {
75// --- Blob Image Serving Routes ---
7677// GET /api/images/:filename - Serve images from blob storage
78app.get("/api/images/:filename", async (c) => {
79const filename = c.req.param("filename");
80