hallutraceai
v0.1.5
Published
JavaScript/TypeScript SDK for HalluTrace AI - LLM hallucination detection & tracing
Downloads
238
Maintainers
Readme
HalluTrace AI - JavaScript SDK
Detect hallucinations in your LLM applications with HalluTrace AI.
Installation
npm install hallutraceaiQuick Start
import { HalluTrace } from 'hallutraceai';
const ht = new HalluTrace({ apiKey: 'sk_live_your_key' });
await ht.trace({
sessionId: 'chat-123',
type: 'agent',
input: 'What is the capital of France?',
output: 'The capital of France is Paris.',
systemPrompt: 'You are a geography assistant.',
modelName: 'gpt-4',
});Batch Tracing
await ht.traceBatch([
{
sessionId: 'chat-123',
messages: [
{
type: 'agent',
input: 'Hello',
output: 'Hi! How can I help?',
modelName: 'gpt-4',
},
{
type: 'tool',
input: 'search: weather',
output: '{"temp": 72, "condition": "sunny"}',
},
],
},
]);