This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//imports | |
import { Langfuse } from "langfuse" | |
import { CallbackHandler } from "langfuse-langchain" | |
//initialization | |
const langfuseParams = { | |
publicKey: process.env.LANGFUSE_PUBLIC_KEY, | |
secretKey: process.env.LANGFUSE_SECRET_KEY, | |
baseUrl: process.env.LANGFUSE_URL | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//filter an qdrant retriever for specific metadata (here: userid) | |
const retriever = vectorStore.asRetriever(4, { | |
"must": [ | |
{ | |
"key": "metadata.userid", | |
"match": { | |
"any": [ | |
m.user, | |
"shared" | |
] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<button @click="subscribe">Subscribe & beim Server registrieren</button> | |
<script> | |
const { publicKey } = await fetch("/vapidPublicKey").then(r=>r.json()); | |
const reg = await navigator.serviceWorker.ready; | |
const subscription = await reg.pushManager.subscribe({ | |
userVisibleOnly: true, | |
applicationServerKey: urlBase64ToUint8Array(publicKey) | |
}); | |
await fetch("/subscribe", { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// sonar-radar.mjs | |
// Node >= 18 (fetch), ESM. Schlank, verständlich, mit dd.mm-Labels und relativen LOC. | |
import { writeFileSync, mkdirSync } from "node:fs"; | |
import { dirname } from "node:path"; | |
/* ========= Konfiguration (ENV) ========= */ | |
const SONAR_BASE = process.env.SONAR_BASE || "https://sonarcloud.io"; | |
const SONAR_TOKEN = process.env.SONAR_TOKEN; // erforderlich | |
const PROJECT_KEY = process.env.SONAR_PROJECT_KEY; // erforderlich |