@babav/knowledge-core-client 0.22.1 → 0.22.3
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 +14 -0
- package/dist/index.js +3 -0
- package/package.json +1 -1
- package/src/index.ts +16 -1
package/dist/index.d.ts
CHANGED
|
@@ -51,6 +51,7 @@ export interface RetrievalContent {
|
|
|
51
51
|
}
|
|
52
52
|
export interface QueryOverrides {
|
|
53
53
|
generation_model?: string;
|
|
54
|
+
generation_model_mode?: string;
|
|
54
55
|
max_response_tokens?: number;
|
|
55
56
|
top_k_retrieved_chunks?: number;
|
|
56
57
|
top_k_reranked_chunks?: number;
|
|
@@ -68,6 +69,7 @@ export interface QueryOverrides {
|
|
|
68
69
|
/** Per-request visual overrides (see VisualRequest). */
|
|
69
70
|
export interface VisualOverrides {
|
|
70
71
|
concept_model?: string;
|
|
72
|
+
concept_model_mode?: string;
|
|
71
73
|
concept_vet_model?: string;
|
|
72
74
|
max_revisions?: number;
|
|
73
75
|
claims_check_model?: string;
|
|
@@ -107,6 +109,12 @@ export interface Visual {
|
|
|
107
109
|
height: number;
|
|
108
110
|
};
|
|
109
111
|
}
|
|
112
|
+
/** Visual stage (streaming): generation has started. MAY be emitted twice — first with
|
|
113
|
+
* `pending: null` (started, count unknown), then again with the ACCURATE post-vet count before
|
|
114
|
+
* rendering. Take the LATEST value; `visuals_complete.count` is always authoritative. */
|
|
115
|
+
export interface VisualsPending {
|
|
116
|
+
pending: number | null;
|
|
117
|
+
}
|
|
110
118
|
export interface VisualsMeta {
|
|
111
119
|
count: number;
|
|
112
120
|
dropped: number;
|
|
@@ -251,6 +259,7 @@ export interface Agent {
|
|
|
251
259
|
identity_prompt: string | null;
|
|
252
260
|
response_prompt: string | null;
|
|
253
261
|
generation_model: string | null;
|
|
262
|
+
generation_model_mode: string | null;
|
|
254
263
|
max_response_tokens: number | null;
|
|
255
264
|
top_k_retrieved_chunks: number | null;
|
|
256
265
|
top_k_reranked_chunks: number | null;
|
|
@@ -336,6 +345,10 @@ export interface StreamHandlers {
|
|
|
336
345
|
* (native path). Also present in `final`. May be `{}` if scoring was unavailable. */
|
|
337
346
|
onGroundedness?: (g: Groundedness | Record<string, never>) => void;
|
|
338
347
|
onFinal?: (d: QueryResponse) => void;
|
|
348
|
+
/** First event of the trailing visual stage — visual generation has STARTED (fires after
|
|
349
|
+
* `final`/`groundedness`, before any `visual`). `pending` is how many concepts are about to be
|
|
350
|
+
* rendered (or null when not yet known). Use it to show a "generating visual(s)" state. */
|
|
351
|
+
onVisualsPending?: (p: VisualsPending) => void;
|
|
339
352
|
/** A visual, emitted (out of anchor order) during the trailing visual stage when
|
|
340
353
|
* visual.mode="on". Place by `anchor`, not arrival order. */
|
|
341
354
|
onVisual?: (v: Visual) => void;
|
|
@@ -561,6 +574,7 @@ export declare class AdminClient extends HttpBase {
|
|
|
561
574
|
identity_prompt?: string;
|
|
562
575
|
response_prompt?: string;
|
|
563
576
|
generation_model?: string;
|
|
577
|
+
generation_model_mode?: string;
|
|
564
578
|
max_response_tokens?: number;
|
|
565
579
|
top_k_retrieved_chunks?: number;
|
|
566
580
|
top_k_reranked_chunks?: number;
|
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@babav/knowledge-core-client",
|
|
3
|
-
"version": "0.22.
|
|
3
|
+
"version": "0.22.3",
|
|
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
|
@@ -72,6 +72,7 @@ export interface RetrievalContent {
|
|
|
72
72
|
|
|
73
73
|
export interface QueryOverrides {
|
|
74
74
|
generation_model?: string;
|
|
75
|
+
generation_model_mode?: string; // "reasoning" (adaptive thinking) | "standard" — how the TEXT answer is generated
|
|
75
76
|
max_response_tokens?: number; // max answer tokens
|
|
76
77
|
top_k_retrieved_chunks?: number; // candidate pool pulled from hybrid search (recall net)
|
|
77
78
|
top_k_reranked_chunks?: number; // sections kept after rerank -> the LLM
|
|
@@ -90,6 +91,7 @@ export interface QueryOverrides {
|
|
|
90
91
|
/** Per-request visual overrides (see VisualRequest). */
|
|
91
92
|
export interface VisualOverrides {
|
|
92
93
|
concept_model?: string;
|
|
94
|
+
concept_model_mode?: string; // "reasoning" | "standard" — how visual concepts are generated; OVERRULES generation_model_mode when combining
|
|
93
95
|
concept_vet_model?: string;
|
|
94
96
|
max_revisions?: number;
|
|
95
97
|
claims_check_model?: string;
|
|
@@ -125,6 +127,13 @@ export interface Visual {
|
|
|
125
127
|
image?: { url: string; expires_at: number; width: number; height: number };
|
|
126
128
|
}
|
|
127
129
|
|
|
130
|
+
/** Visual stage (streaming): generation has started. MAY be emitted twice — first with
|
|
131
|
+
* `pending: null` (started, count unknown), then again with the ACCURATE post-vet count before
|
|
132
|
+
* rendering. Take the LATEST value; `visuals_complete.count` is always authoritative. */
|
|
133
|
+
export interface VisualsPending {
|
|
134
|
+
pending: number | null;
|
|
135
|
+
}
|
|
136
|
+
|
|
128
137
|
export interface VisualsMeta {
|
|
129
138
|
count: number;
|
|
130
139
|
dropped: number;
|
|
@@ -268,6 +277,7 @@ export interface Agent {
|
|
|
268
277
|
identity_prompt: string | null; // answer-system: who/purpose (null => server default)
|
|
269
278
|
response_prompt: string | null; // answer-system: output guidelines (null => server default)
|
|
270
279
|
generation_model: string | null;
|
|
280
|
+
generation_model_mode: string | null; // "reasoning" (adaptive thinking) | "standard"; per-agent
|
|
271
281
|
max_response_tokens: number | null;
|
|
272
282
|
top_k_retrieved_chunks: number | null;
|
|
273
283
|
top_k_reranked_chunks: number | null;
|
|
@@ -455,6 +465,10 @@ export interface StreamHandlers {
|
|
|
455
465
|
* (native path). Also present in `final`. May be `{}` if scoring was unavailable. */
|
|
456
466
|
onGroundedness?: (g: Groundedness | Record<string, never>) => void;
|
|
457
467
|
onFinal?: (d: QueryResponse) => void;
|
|
468
|
+
/** First event of the trailing visual stage — visual generation has STARTED (fires after
|
|
469
|
+
* `final`/`groundedness`, before any `visual`). `pending` is how many concepts are about to be
|
|
470
|
+
* rendered (or null when not yet known). Use it to show a "generating visual(s)" state. */
|
|
471
|
+
onVisualsPending?: (p: VisualsPending) => void;
|
|
458
472
|
/** A visual, emitted (out of anchor order) during the trailing visual stage when
|
|
459
473
|
* visual.mode="on". Place by `anchor`, not arrival order. */
|
|
460
474
|
onVisual?: (v: Visual) => void;
|
|
@@ -681,7 +695,7 @@ export class AdminClient extends HttpBase {
|
|
|
681
695
|
|
|
682
696
|
// Agents are query agents, global for now.
|
|
683
697
|
agents = {
|
|
684
|
-
create: (b: { name: string; identity_prompt?: string; response_prompt?: string; generation_model?: string; max_response_tokens?: number; top_k_retrieved_chunks?: number; top_k_reranked_chunks?: number; sibling_window?: number; rerank_instruction?: string; max_subqueries?: number; max_reasoning_rounds?: number; decomposition_model?: string; reasoning_inspect_model?: string; groundedness_verifier_model?: string; groundedness_threshold?: number; grounding_enabled?: boolean; citations_enabled?: boolean }) =>
|
|
698
|
+
create: (b: { name: string; identity_prompt?: string; response_prompt?: string; generation_model?: string; generation_model_mode?: string; max_response_tokens?: number; top_k_retrieved_chunks?: number; top_k_reranked_chunks?: number; sibling_window?: number; rerank_instruction?: string; max_subqueries?: number; max_reasoning_rounds?: number; decomposition_model?: string; reasoning_inspect_model?: string; groundedness_verifier_model?: string; groundedness_threshold?: number; grounding_enabled?: boolean; citations_enabled?: boolean }) =>
|
|
685
699
|
this.request<Agent>("POST", "/v1/agents", { json: b }),
|
|
686
700
|
update: (id: UUID, b: Partial<Omit<Agent, "id">>) =>
|
|
687
701
|
this.request<Agent>("PATCH", `/v1/agents/${id}`, { json: b }),
|
|
@@ -708,6 +722,7 @@ function dispatchSse(frame: string, h: StreamHandlers): void {
|
|
|
708
722
|
case "citation": h.onCitation?.(data as Citation); break;
|
|
709
723
|
case "groundedness": h.onGroundedness?.(data as never); break;
|
|
710
724
|
case "final": h.onFinal?.(data as QueryResponse); break;
|
|
725
|
+
case "visuals_pending": h.onVisualsPending?.(data as VisualsPending); break;
|
|
711
726
|
case "visual": h.onVisual?.(data as Visual); break;
|
|
712
727
|
case "visuals_complete": h.onVisualsComplete?.(data as VisualsMeta); break;
|
|
713
728
|
case "error": h.onError?.(data); break;
|