@babav/knowledge-core-client 0.11.0 → 0.12.1

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
@@ -56,6 +56,7 @@ export interface QueryOverrides {
56
56
  max_hops?: number;
57
57
  groundedness_threshold?: number;
58
58
  grounding_enabled?: boolean;
59
+ citations_enabled?: boolean;
59
60
  }
60
61
  export interface QueryRequest {
61
62
  corpus_ids: UUID[];
@@ -87,8 +88,11 @@ export interface Citation {
87
88
  source_url: string | null;
88
89
  }
89
90
  export interface GroundednessSentence {
90
- /** Char span IN THE ANSWER of this sentence. */
91
+ /** Char span into the RAW answer (concatenated tokens / `final.answer`). */
91
92
  text_span: [number, number];
93
+ /** The exact sentence text — highlight by matching this in the rendered output
94
+ * (robust to markdown rendering + inserted citation markers) rather than offsets. */
95
+ text: string;
92
96
  score: number;
93
97
  passed: boolean | null;
94
98
  }
@@ -192,6 +196,7 @@ export interface Agent {
192
196
  max_hops: number | null;
193
197
  groundedness_threshold: number | null;
194
198
  grounding_enabled: boolean | null;
199
+ citations_enabled: boolean | null;
195
200
  }
196
201
  export interface Tenant {
197
202
  id: UUID;
@@ -492,6 +497,7 @@ export declare class AdminClient extends HttpBase {
492
497
  max_hops?: number;
493
498
  groundedness_threshold?: number;
494
499
  grounding_enabled?: boolean;
500
+ citations_enabled?: boolean;
495
501
  }) => Promise<Agent>;
496
502
  update: (id: UUID, b: Partial<Omit<Agent, "id">>) => Promise<Agent>;
497
503
  delete: (id: UUID) => Promise<void>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@babav/knowledge-core-client",
3
- "version": "0.11.0",
3
+ "version": "0.12.1",
4
4
  "description": "TypeScript client for the Babav Knowledge Core API (Deno + Node 18+, zero deps).",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
package/src/index.ts CHANGED
@@ -65,7 +65,8 @@ export interface QueryOverrides {
65
65
  rerank_instruction?: string;
66
66
  max_hops?: number;
67
67
  groundedness_threshold?: number;
68
- grounding_enabled?: boolean;
68
+ grounding_enabled?: boolean; // HHEM groundedness score (default off)
69
+ citations_enabled?: boolean; // source attribution (default on)
69
70
  }
70
71
 
71
72
  export interface QueryRequest {
@@ -102,8 +103,11 @@ export interface Citation {
102
103
  }
103
104
 
104
105
  export interface GroundednessSentence {
105
- /** Char span IN THE ANSWER of this sentence. */
106
+ /** Char span into the RAW answer (concatenated tokens / `final.answer`). */
106
107
  text_span: [number, number];
108
+ /** The exact sentence text — highlight by matching this in the rendered output
109
+ * (robust to markdown rendering + inserted citation markers) rather than offsets. */
110
+ text: string;
107
111
  score: number;
108
112
  passed: boolean | null;
109
113
  }
@@ -205,6 +209,7 @@ export interface Agent {
205
209
  max_hops: number | null;
206
210
  groundedness_threshold: number | null;
207
211
  grounding_enabled: boolean | null;
212
+ citations_enabled: boolean | null;
208
213
  }
209
214
  export interface Tenant {
210
215
  id: UUID;
@@ -623,7 +628,7 @@ export class AdminClient extends HttpBase {
623
628
 
624
629
  // Agents are query agents, global for now.
625
630
  agents = {
626
- create: (b: { name: string; identity_prompt?: string; response_prompt?: string; generation_model?: string; top_k?: number; rerank_instruction?: string; max_hops?: number; groundedness_threshold?: number; grounding_enabled?: boolean }) =>
631
+ create: (b: { name: string; identity_prompt?: string; response_prompt?: string; generation_model?: string; top_k?: number; rerank_instruction?: string; max_hops?: number; groundedness_threshold?: number; grounding_enabled?: boolean; citations_enabled?: boolean }) =>
627
632
  this.request<Agent>("POST", "/v1/agents", { json: b }),
628
633
  update: (id: UUID, b: Partial<Omit<Agent, "id">>) =>
629
634
  this.request<Agent>("PATCH", `/v1/agents/${id}`, { json: b }),