@babav/knowledge-core-client 0.56.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
@@ -648,6 +648,52 @@ export interface RerankerComparison {
648
648
  eval_version: string;
649
649
  heads: RerankerHead[];
650
650
  }
651
+ /** One visual-pipeline arm measured in the visual benchmark (yield + independent graded quality). */
652
+ export interface VisualArm {
653
+ arm: string;
654
+ generation_model: string | null;
655
+ concept_model: string | null;
656
+ concept_mode: string | null;
657
+ visuals_per_query: number | null;
658
+ zero_visual_rate: number | null;
659
+ dropped: number | null;
660
+ avg_quality: number | null;
661
+ n_visuals_judged: number | null;
662
+ quality_judge: string | null;
663
+ quality_caveat: string | null;
664
+ avg_cost_per_query_usd: number | null;
665
+ p50_ms: number | null;
666
+ n_questions: number | null;
667
+ }
668
+ /** Visual-benchmark leaderboard (GET /v1/benchmark/visuals) — per visual-pipeline arm: yield,
669
+ * independent graded quality, cost, latency. `arms` is empty if no visual benchmark has run. */
670
+ export interface VisualComparison {
671
+ eval_version: string;
672
+ note: string | null;
673
+ arms: VisualArm[];
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
+ }
651
697
  export interface Tenant {
652
698
  id: UUID;
653
699
  name: string;
@@ -1122,6 +1168,22 @@ export declare class KnowledgeCoreClient extends HttpBase {
1122
1168
  rerankers: (q?: {
1123
1169
  eval_version?: string;
1124
1170
  }) => Promise<RerankerComparison>;
1171
+ /** Visual-benchmark leaderboard — per visual-pipeline arm (e.g. all-Flash vs all-Opus): yield
1172
+ * (visuals/query, zero-visual rate, drops), independent graded quality, cost, latency. Read-only,
1173
+ * tenant-anonymous. `arms` is empty when no visual benchmark has run. NOTE: quality is a Gemini
1174
+ * vision judge — a Gemini-family concept model (Flash) may be self-flattered, so cross-family arms
1175
+ * (Opus) are the cleaner quality figure (see each arm's `quality_caveat`). */
1176
+ visuals: (q?: {
1177
+ eval_version?: string;
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>;
1125
1187
  /** Kick the sweep as the BENCHMARK TENANT (this client's own key — no admin key). The benchmark
1126
1188
  * tenant owns the bench corpora + eval-set; the sweep FULL-scores the sensible config set and
1127
1189
  * populates the leaderboard. Runs in the background — returns 202 immediately. */
package/dist/index.js CHANGED
@@ -487,6 +487,18 @@ export class KnowledgeCoreClient extends HttpBase {
487
487
  * with quality (full-150 composite_q + delta) and measured end-to-end latency/cost. Read-only,
488
488
  * tenant-anonymous. `heads` is empty when no reranker benchmark has run for the eval version. */
489
489
  rerankers: (q) => this.request("GET", "/v1/benchmark/rerankers", { query: q }),
490
+ /** Visual-benchmark leaderboard — per visual-pipeline arm (e.g. all-Flash vs all-Opus): yield
491
+ * (visuals/query, zero-visual rate, drops), independent graded quality, cost, latency. Read-only,
492
+ * tenant-anonymous. `arms` is empty when no visual benchmark has run. NOTE: quality is a Gemini
493
+ * vision judge — a Gemini-family concept model (Flash) may be self-flattered, so cross-family arms
494
+ * (Opus) are the cleaner quality figure (see each arm's `quality_caveat`). */
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 }),
490
502
  /** Kick the sweep as the BENCHMARK TENANT (this client's own key — no admin key). The benchmark
491
503
  * tenant owns the bench corpora + eval-set; the sweep FULL-scores the sensible config set and
492
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.56.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
@@ -613,6 +613,52 @@ export interface RerankerComparison {
613
613
  eval_version: string;
614
614
  heads: RerankerHead[];
615
615
  }
616
+ /** One visual-pipeline arm measured in the visual benchmark (yield + independent graded quality). */
617
+ export interface VisualArm {
618
+ arm: string; // e.g. "all_flash" | "all_opus"
619
+ generation_model: string | null;
620
+ concept_model: string | null;
621
+ concept_mode: string | null;
622
+ visuals_per_query: number | null; // yield: mean shipped visuals per query
623
+ zero_visual_rate: number | null; // fraction of queries that shipped no visual
624
+ dropped: number | null;
625
+ avg_quality: number | null; // 0..1, independent vision judge
626
+ n_visuals_judged: number | null;
627
+ quality_judge: string | null;
628
+ quality_caveat: string | null; // e.g. same-family-judge self-preference note
629
+ avg_cost_per_query_usd: number | null;
630
+ p50_ms: number | null;
631
+ n_questions: number | null;
632
+ }
633
+ /** Visual-benchmark leaderboard (GET /v1/benchmark/visuals) — per visual-pipeline arm: yield,
634
+ * independent graded quality, cost, latency. `arms` is empty if no visual benchmark has run. */
635
+ export interface VisualComparison {
636
+ eval_version: string;
637
+ note: string | null;
638
+ arms: VisualArm[];
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
+ }
616
662
 
617
663
  export interface Tenant {
618
664
  id: UUID;
@@ -1259,6 +1305,20 @@ export class KnowledgeCoreClient extends HttpBase {
1259
1305
  * tenant-anonymous. `heads` is empty when no reranker benchmark has run for the eval version. */
1260
1306
  rerankers: (q?: { eval_version?: string }) =>
1261
1307
  this.request<RerankerComparison>("GET", "/v1/benchmark/rerankers", { query: q }),
1308
+ /** Visual-benchmark leaderboard — per visual-pipeline arm (e.g. all-Flash vs all-Opus): yield
1309
+ * (visuals/query, zero-visual rate, drops), independent graded quality, cost, latency. Read-only,
1310
+ * tenant-anonymous. `arms` is empty when no visual benchmark has run. NOTE: quality is a Gemini
1311
+ * vision judge — a Gemini-family concept model (Flash) may be self-flattered, so cross-family arms
1312
+ * (Opus) are the cleaner quality figure (see each arm's `quality_caveat`). */
1313
+ visuals: (q?: { eval_version?: string }) =>
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 }),
1262
1322
  /** Kick the sweep as the BENCHMARK TENANT (this client's own key — no admin key). The benchmark
1263
1323
  * tenant owns the bench corpora + eval-set; the sweep FULL-scores the sensible config set and
1264
1324
  * populates the leaderboard. Runs in the background — returns 202 immediately. */