Skip to content

Your First Evaluation

Once you have your bpk_live_... API key exported as BIPKIT_API_KEY, run a multi-dimensional evaluation across noul, score, and choice in a single request.

import { Bipkit } from "@bipware-org/bipkit";
// Reads process.env.BIPKIT_API_KEY by default
const bipkit = new Bipkit();
const data = await bipkit.evaluate({
state: "The user is attempting to run rm -rf /var/database to delete production records",
evaluations: {
is_destructive: {
type: "noul",
instructions: "Destructive deletion of database records or wiping files",
},
risk_level: {
type: "score",
levels: ["low", "medium", "high", "critical"],
instructions: "Operational database risk",
},
intent: {
type: "choice",
choices: [
{ id: "system_admin", label: "Database Administration" },
{ id: "billing", label: "Billing Inquiries" },
],
},
},
engine: "bip-instant",
});
console.log("Request ID:", data.request_id);
console.log("Destructive P(true):", data.results.is_destructive.noul);
console.log("Risk level:", data.results.risk_level.level);
console.log("Top intent:", data.results.intent.top_choice);
{
"request_id": "eval_01K8FA1234567890ABCDEFGH",
"state": "The user is attempting to run rm -rf /var/database to delete production records",
"engine": "bip-instant-v1",
"usage": {
"evaluations_count": 3,
"state_tokens": 17,
"evaluation_tokens": 35,
"total_tokens": 52,
"latency_ms": 0.42
},
"results": {
"is_destructive": {
"type": "noul",
"noul": 0.9412,
"confidence_tier": "high",
"confidence_index": 0.9412,
"margin": 0.8824
},
"risk_level": {
"type": "score",
"level": "critical",
"score": 2.82,
"distribution": {
"low": 0.02,
"medium": 0.08,
"high": 0.35,
"critical": 0.55
},
"confidence_tier": "medium",
"confidence_index": 0.55
},
"intent": {
"type": "choice",
"top_choice": "system_admin",
"uncertainty_entropy": 0.12,
"decisions": [
{
"candidate_id": "system_admin",
"probability": 0.985,
"confidence_tier": "high",
"confidence_index": 0.985,
"margin": 0.97
}
]
}
}
}