@babav/knowledge-core-client 0.53.0 → 0.55.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 +9 -0
- package/dist/index.js +3 -0
- package/package.json +1 -1
- package/src/index.ts +7 -0
package/dist/index.d.ts
CHANGED
|
@@ -53,6 +53,7 @@ export interface RetrievalContent {
|
|
|
53
53
|
export interface QueryOverrides {
|
|
54
54
|
generation_model?: string;
|
|
55
55
|
generation_model_mode?: string;
|
|
56
|
+
rewrite_model?: string;
|
|
56
57
|
max_response_tokens?: number;
|
|
57
58
|
top_k_retrieved_chunks?: number;
|
|
58
59
|
top_k_reranked_chunks?: number;
|
|
@@ -167,6 +168,7 @@ export interface QueryResponse {
|
|
|
167
168
|
standalone_query: string | null;
|
|
168
169
|
visuals?: Visual[];
|
|
169
170
|
visuals_meta?: VisualsMeta | null;
|
|
171
|
+
conversation_title?: string | null;
|
|
170
172
|
}
|
|
171
173
|
export interface Citation {
|
|
172
174
|
/** Char span IN THE ANSWER this citation supports (for highlighting). */
|
|
@@ -516,6 +518,7 @@ export interface QueryProfile {
|
|
|
516
518
|
response_prompt: string | null;
|
|
517
519
|
generation_model: string | null;
|
|
518
520
|
generation_model_mode: string | null;
|
|
521
|
+
rewrite_model: string | null;
|
|
519
522
|
max_response_tokens: number | null;
|
|
520
523
|
top_k_retrieved_chunks: number | null;
|
|
521
524
|
top_k_reranked_chunks: number | null;
|
|
@@ -720,6 +723,12 @@ export interface StreamHandlers {
|
|
|
720
723
|
* (native path). Also present in `final`. May be `{}` if scoring was unavailable. */
|
|
721
724
|
onGroundedness?: (g: Groundedness | Record<string, never>) => void;
|
|
722
725
|
onFinal?: (d: QueryResponse) => void;
|
|
726
|
+
/** Conversation auto-title, refreshed after `final` (conversational turns only). Update the
|
|
727
|
+
* sidebar title live. Fires at most once per turn; absent when locked/one-shot/disabled. */
|
|
728
|
+
onConversationTitle?: (t: {
|
|
729
|
+
conversation_id: UUID;
|
|
730
|
+
title: string;
|
|
731
|
+
}) => void;
|
|
723
732
|
/** First event of the trailing visual stage — visual generation has STARTED (fires after
|
|
724
733
|
* `final`/`groundedness`, before any `visual`). `pending` is how many concepts are about to be
|
|
725
734
|
* rendered (or null when not yet known). Use it to show a "generating visual(s)" state. */
|
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.
|
|
3
|
+
"version": "0.55.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
|
@@ -74,6 +74,7 @@ export interface RetrievalContent {
|
|
|
74
74
|
export interface QueryOverrides {
|
|
75
75
|
generation_model?: string;
|
|
76
76
|
generation_model_mode?: string; // "reasoning" (adaptive thinking) | "standard" — how the TEXT answer is generated
|
|
77
|
+
rewrite_model?: string; // conversational rewrite model; null/unset => generation_model
|
|
77
78
|
max_response_tokens?: number; // max answer tokens
|
|
78
79
|
top_k_retrieved_chunks?: number; // candidate pool pulled from hybrid search (recall net)
|
|
79
80
|
top_k_reranked_chunks?: number; // sections kept after rerank -> the LLM
|
|
@@ -199,6 +200,7 @@ export interface QueryResponse {
|
|
|
199
200
|
standalone_query: string | null;
|
|
200
201
|
visuals?: Visual[]; // [] when off/none
|
|
201
202
|
visuals_meta?: VisualsMeta | null;
|
|
203
|
+
conversation_title?: string | null; // auto-title refreshed this turn (null if locked/one-shot/off)
|
|
202
204
|
}
|
|
203
205
|
|
|
204
206
|
export interface Citation {
|
|
@@ -482,6 +484,7 @@ export interface QueryProfile {
|
|
|
482
484
|
response_prompt: string | null; // answer-system: output guidelines (null => server default)
|
|
483
485
|
generation_model: string | null;
|
|
484
486
|
generation_model_mode: string | null; // "reasoning" (adaptive thinking) | "standard"; per-profile
|
|
487
|
+
rewrite_model: string | null; // conversational rewrite model; null => generation_model
|
|
485
488
|
max_response_tokens: number | null;
|
|
486
489
|
top_k_retrieved_chunks: number | null;
|
|
487
490
|
top_k_reranked_chunks: number | null;
|
|
@@ -795,6 +798,9 @@ export interface StreamHandlers {
|
|
|
795
798
|
* (native path). Also present in `final`. May be `{}` if scoring was unavailable. */
|
|
796
799
|
onGroundedness?: (g: Groundedness | Record<string, never>) => void;
|
|
797
800
|
onFinal?: (d: QueryResponse) => void;
|
|
801
|
+
/** Conversation auto-title, refreshed after `final` (conversational turns only). Update the
|
|
802
|
+
* sidebar title live. Fires at most once per turn; absent when locked/one-shot/disabled. */
|
|
803
|
+
onConversationTitle?: (t: { conversation_id: UUID; title: string }) => void;
|
|
798
804
|
/** First event of the trailing visual stage — visual generation has STARTED (fires after
|
|
799
805
|
* `final`/`groundedness`, before any `visual`). `pending` is how many concepts are about to be
|
|
800
806
|
* rendered (or null when not yet known). Use it to show a "generating visual(s)" state. */
|
|
@@ -1439,6 +1445,7 @@ function dispatchSse(frame: string, h: StreamHandlers): void {
|
|
|
1439
1445
|
case "citation": h.onCitation?.(data as Citation); break;
|
|
1440
1446
|
case "groundedness": h.onGroundedness?.(data as never); break;
|
|
1441
1447
|
case "final": h.onFinal?.(data as QueryResponse); break;
|
|
1448
|
+
case "conversation_title": h.onConversationTitle?.(data as { conversation_id: UUID; title: string }); break;
|
|
1442
1449
|
case "visuals_pending": h.onVisualsPending?.(data as VisualsPending); break;
|
|
1443
1450
|
case "visual": h.onVisual?.(data as Visual); break;
|
|
1444
1451
|
case "visuals_complete": h.onVisualsComplete?.(data as VisualsMeta); break;
|