@babav/knowledge-core-client 0.57.0 → 0.58.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -672,6 +672,28 @@ export interface VisualComparison {
672
672
  note: string | null;
673
673
  arms: VisualArm[];
674
674
  }
675
+ /** One citation configuration measured in the citation benchmark. */
676
+ export interface CitationArm {
677
+ arm: string;
678
+ generation_model: string | null;
679
+ citation_model: string | null;
680
+ mechanism: string | null;
681
+ precision: number | null;
682
+ avg_citations_per_answer: number | null;
683
+ zero_citation_rate: number | null;
684
+ avg_cost_per_query_usd: number | null;
685
+ p50_ms: number | null;
686
+ n_questions: number | null;
687
+ note: string | null;
688
+ }
689
+ /** Citation-benchmark leaderboard (GET /v1/benchmark/citations) — per configuration: citation
690
+ * precision + yield + cost + latency. Native citations (~1.0 by construction) vs post-hoc (lower
691
+ * ceiling); each arm's `mechanism` says which. `arms` empty if no citation benchmark has run. */
692
+ export interface CitationComparison {
693
+ eval_version: string;
694
+ note: string | null;
695
+ arms: CitationArm[];
696
+ }
675
697
  export interface Tenant {
676
698
  id: UUID;
677
699
  name: string;
@@ -1154,6 +1176,14 @@ export declare class KnowledgeCoreClient extends HttpBase {
1154
1176
  visuals: (q?: {
1155
1177
  eval_version?: string;
1156
1178
  }) => Promise<VisualComparison>;
1179
+ /** Citation-benchmark leaderboard — per configuration (arm): citation precision, yield
1180
+ * (citations/answer, zero-citation rate), cost, latency. NATIVE-citation arms (Anthropic gen)
1181
+ * score ~1.0 by construction (verbatim inline quotes); POST-HOC arms (non-native gen + an
1182
+ * attributor) have a much lower ceiling regardless of attributor — see each arm's `mechanism`
1183
+ * and `note`. Read-only, tenant-anonymous. `arms` empty when no citation benchmark has run. */
1184
+ citations: (q?: {
1185
+ eval_version?: string;
1186
+ }) => Promise<CitationComparison>;
1157
1187
  /** Kick the sweep as the BENCHMARK TENANT (this client's own key — no admin key). The benchmark
1158
1188
  * tenant owns the bench corpora + eval-set; the sweep FULL-scores the sensible config set and
1159
1189
  * populates the leaderboard. Runs in the background — returns 202 immediately. */
package/dist/index.js CHANGED
@@ -493,6 +493,12 @@ export class KnowledgeCoreClient extends HttpBase {
493
493
  * vision judge — a Gemini-family concept model (Flash) may be self-flattered, so cross-family arms
494
494
  * (Opus) are the cleaner quality figure (see each arm's `quality_caveat`). */
495
495
  visuals: (q) => this.request("GET", "/v1/benchmark/visuals", { query: q }),
496
+ /** Citation-benchmark leaderboard — per configuration (arm): citation precision, yield
497
+ * (citations/answer, zero-citation rate), cost, latency. NATIVE-citation arms (Anthropic gen)
498
+ * score ~1.0 by construction (verbatim inline quotes); POST-HOC arms (non-native gen + an
499
+ * attributor) have a much lower ceiling regardless of attributor — see each arm's `mechanism`
500
+ * and `note`. Read-only, tenant-anonymous. `arms` empty when no citation benchmark has run. */
501
+ citations: (q) => this.request("GET", "/v1/benchmark/citations", { query: q }),
496
502
  /** Kick the sweep as the BENCHMARK TENANT (this client's own key — no admin key). The benchmark
497
503
  * tenant owns the bench corpora + eval-set; the sweep FULL-scores the sensible config set and
498
504
  * populates the leaderboard. Runs in the background — returns 202 immediately. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@babav/knowledge-core-client",
3
- "version": "0.57.0",
3
+ "version": "0.58.0",
4
4
  "description": "TypeScript client for the Babav Knowledge Core API (Deno + Node 18+, zero deps). Includes the babav.visual grammar TYPES at the ./visual subpath (types only; all visual rendering is server-side).",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
package/src/index.ts CHANGED
@@ -637,6 +637,28 @@ export interface VisualComparison {
637
637
  note: string | null;
638
638
  arms: VisualArm[];
639
639
  }
640
+ /** One citation configuration measured in the citation benchmark. */
641
+ export interface CitationArm {
642
+ arm: string; // e.g. "opus_native" | "flash_self" | "flash_opus"
643
+ generation_model: string | null;
644
+ citation_model: string | null; // post-hoc attributor; null/native for Anthropic gen
645
+ mechanism: string | null; // "native" (inline, verbatim) | "posthoc" (attributor pass)
646
+ precision: number | null; // 0..1 — cited source actually supports the claim
647
+ avg_citations_per_answer: number | null;
648
+ zero_citation_rate: number | null; // fraction of answers with no citation
649
+ avg_cost_per_query_usd: number | null;
650
+ p50_ms: number | null;
651
+ n_questions: number | null;
652
+ note: string | null;
653
+ }
654
+ /** Citation-benchmark leaderboard (GET /v1/benchmark/citations) — per configuration: citation
655
+ * precision + yield + cost + latency. Native citations (~1.0 by construction) vs post-hoc (lower
656
+ * ceiling); each arm's `mechanism` says which. `arms` empty if no citation benchmark has run. */
657
+ export interface CitationComparison {
658
+ eval_version: string;
659
+ note: string | null;
660
+ arms: CitationArm[];
661
+ }
640
662
 
641
663
  export interface Tenant {
642
664
  id: UUID;
@@ -1290,6 +1312,13 @@ export class KnowledgeCoreClient extends HttpBase {
1290
1312
  * (Opus) are the cleaner quality figure (see each arm's `quality_caveat`). */
1291
1313
  visuals: (q?: { eval_version?: string }) =>
1292
1314
  this.request<VisualComparison>("GET", "/v1/benchmark/visuals", { query: q }),
1315
+ /** Citation-benchmark leaderboard — per configuration (arm): citation precision, yield
1316
+ * (citations/answer, zero-citation rate), cost, latency. NATIVE-citation arms (Anthropic gen)
1317
+ * score ~1.0 by construction (verbatim inline quotes); POST-HOC arms (non-native gen + an
1318
+ * attributor) have a much lower ceiling regardless of attributor — see each arm's `mechanism`
1319
+ * and `note`. Read-only, tenant-anonymous. `arms` empty when no citation benchmark has run. */
1320
+ citations: (q?: { eval_version?: string }) =>
1321
+ this.request<CitationComparison>("GET", "/v1/benchmark/citations", { query: q }),
1293
1322
  /** Kick the sweep as the BENCHMARK TENANT (this client's own key — no admin key). The benchmark
1294
1323
  * tenant owns the bench corpora + eval-set; the sweep FULL-scores the sensible config set and
1295
1324
  * populates the leaderboard. Runs in the background — returns 202 immediately. */