fix(obsidian-kb): restore files and shorten description

This commit is contained in:
OpenClaw Agent
2026-02-07 05:32:26 +08:00
parent 8bce4ac23b
commit a0e43a5136
97 changed files with 1024 additions and 9216 deletions
-29
View File
@@ -1,29 +0,0 @@
import OpenAI from "openai";
const openai = new OpenAI();
export async function generateWebhook(eventDescription: string, framework: string = "express"): Promise<string> {
const response = await openai.chat.completions.create({
model: "gpt-4o-mini",
messages: [
{
role: "system",
content: `You generate production-ready webhook handler code.
Rules:
- Include signature verification
- Add exponential backoff retry logic
- Handle idempotency (dedup by event ID)
- Proper error handling and logging
- Type-safe where possible
- Framework: ${framework}
- Include both the handler and a retry utility
- Return ONLY the code, no explanations`
},
{ role: "user", content: `Generate a webhook handler for: ${eventDescription}` }
],
temperature: 0.3,
});
const result = response.choices[0].message.content?.trim() || "";
return result.replace(/^```[\w]*\n?/, "").replace(/\n?```$/, "");
}