AI Components / A/B Test
A/B Test
Side-by-side model/prompt comparison with vote buttons.
ai-production v0.5.0
Playground
Examples
Prompt comparison
<ai-ab-test title="Prompt v1 vs v2" variantA="The revenue increased by 18% in Q4 driven by enterprise expansion." variantB="Q4 revenue rose 18%. Key driver: enterprise segment growth (+32%). SMB grew modestly (+8%)."></ai-ab-test> Import
import { AiAbTest } from '@cognivo/components'; // Or tree-shake: import '@cognivo/components/ai-ab-test'; Per-component imports ship only that component (~8 kB gzip).
API Reference
| Prop | Type | Default | Description |
|---|---|---|---|
variantA | string | — | Content A |
variantB | string | — | Content B |
title | string | — | Test title |
Events
| Event | Detail | Description |
|---|---|---|
ai-ab-vote | {winner} | Vote cast |