Per app di chat e assistenti IA
Dai al tuo chatbot risposte che si possono vedere
Il tuo LLM è bravissimo a conversare. Per il meteo, una ricetta o le calorie del pranzo, WebKnox passa alla tua app una scheda con fonti, e a tutto il resto pensa il tuo modello.
Only first thing. The overnight rain in Dresden eases off by about 7 am; the rest of Thursday stays mostly dry, between 8 and 12°.
Stessa domanda, due risposte
A medium banana (118 g) has about 105 kcal, mostly from carbohydrates: 27 g, including 14 g of sugars. It also gives you 3.1 g of fiber and 422 mg of potassium.
Dove si inserisce nel tuo backend
Una chiamata in più prima che parta il tuo modello. Niente da migrare, nessuna sessione da gestire.
- L'utente chiedenell'interfaccia della tua chat
- Il tuo serverinvia i messaggi a WebKnox
- matched: truemostra la scheda e salva il suo testo nella cronologia
- matched: falseil tuo LLM risponde come fa già oggi
// server.js: your chat endpoint const res = await fetch('https://api.webknox.com/v2/answers', { method: 'POST', headers: { Authorization: `Bearer ${process.env.WEBKNOX_API_KEY}`, 'Content-Type': 'application/json', }, body: JSON.stringify({ messages }), }); const answer = await res.json(); if (answer.matched) return { type: 'card', answer }; // <webknox-answer> renders it return { type: 'text', text: await myLlm.reply(messages) };
Da sapere per le app di chat
Le domande successive sono chip
«E domani?» arriva come evento webknox-follow-up. Inviala come prossimo messaggio dell'utente.
Salva il testo nella cronologia
Salva il campo text della risposta come turno dell'assistente, così più avanti sia il tuo modello sia WebKnox capiscono a cosa si riferisce «una grande».
Lo stile della tua app
Scegli uno stile, imposta il colore del tuo brand o sovrascrivi qualsiasi proprietà --wk-* dal tuo CSS.