@bp-growth/bot-testing
v1.2.2
Published
TypeScript library for testing bot conversations using Zai
Readme
Bot Testing Library
A TypeScript library for testing Botpress bot conversations using AI-powered evaluation with Zai.
Installation
npm install @bp-growth/bot-testingQuick Start
import {
testConversations,
BotConfiguration,
ConversationWithTests,
} from "@bp-growth/bot-testing";
const conversationsWithTests: ConversationWithTests[] = [
{
conversation: [
{ source: "user", message: "Hello" },
{ source: "user", message: "Can you compare product A with product B?" },
],
tests: [
{ type: "accuracy", test: "should mention product A features" },
{ type: "completeness", test: "should compare both products" },
],
},
];
const config: BotConfiguration = {
botId: "your_bot_id",
token: "your_token",
workspaceId: "your_workspace_id",
};
const results = await testConversations({ conversationsWithTests, config });
console.log(results.summary);