Chat-style AI messages
For richer prompts, pass a messages array with role and content fields — the same shape used by chat-completion APIs. Optionally set useKnowledgeBase: true to ground answers in your indexed documents.
When to use chat-style vs simple text
Simple text
{ text: "..." }
Quick one-liners
Chat-style
{ messages: [{ role, content }] }
System prompts, few-shot examples, multi-role context
Chat + RAG
{ useKnowledgeBase: true, messages: [...] }
Support bots grounded in your knowledge base
Message roles
system
Persona, rules, output format
user
End-user question or input
assistant
Prior model turns (for replay or few-shot)
message: {
useKnowledgeBase: false,
messages: [
{ role: "system", content: "You are a helpful support agent. Be concise." },
{ role: "user", content: "How do I reset my password?" },
],
}useKnowledgeBase
When true, DNotifier retrieves relevant knowledge-base chunks and injects them into the prompt before calling the model.
saveHistory
Default is true. Set false for classification, routing, or workflow steps you do not want in user-visible history.
Transport
Use transport: "http" for all sendAI calls.
Language guides
JavaScript / TypeScript
Dart / Flutter
Next steps
Knowledge base overview — Index documents for RAG
Sessions — Continue the same conversation with
sessionIdExample: RAG bot — Full Q&A flow
Last updated