@babav/knowledge-core-client 0.6.0 → 0.7.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 +0 -7
- package/dist/index.js +0 -3
- package/package.json +1 -1
- package/src/index.ts +0 -3
package/dist/index.d.ts
CHANGED
|
@@ -73,7 +73,6 @@ export interface QueryResponse {
|
|
|
73
73
|
groundedness: Groundedness | null;
|
|
74
74
|
usage: Record<string, number | null>;
|
|
75
75
|
standalone_query: string | null;
|
|
76
|
-
hops: string[];
|
|
77
76
|
}
|
|
78
77
|
export interface Citation {
|
|
79
78
|
quote: string;
|
|
@@ -241,12 +240,6 @@ declare class HttpBase {
|
|
|
241
240
|
protected pageAll<T>(path: string, query?: RequestOpts["query"]): Promise<T[]>;
|
|
242
241
|
}
|
|
243
242
|
export interface StreamHandlers {
|
|
244
|
-
onHop?: (d: {
|
|
245
|
-
n: number;
|
|
246
|
-
subquery: string;
|
|
247
|
-
status: string;
|
|
248
|
-
retrieval_contents?: number;
|
|
249
|
-
}) => void;
|
|
250
243
|
onSources?: (d: {
|
|
251
244
|
retrieval_contents: RetrievalContent[];
|
|
252
245
|
}) => void;
|
package/dist/index.js
CHANGED
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -85,7 +85,6 @@ export interface QueryResponse {
|
|
|
85
85
|
groundedness: Groundedness | null;
|
|
86
86
|
usage: Record<string, number | null>;
|
|
87
87
|
standalone_query: string | null;
|
|
88
|
-
hops: string[];
|
|
89
88
|
}
|
|
90
89
|
|
|
91
90
|
export interface Citation {
|
|
@@ -368,7 +367,6 @@ function toBlob(data: FileData, contentType?: string): Blob {
|
|
|
368
367
|
// SSE handlers
|
|
369
368
|
// ---------------------------------------------------------------------------
|
|
370
369
|
export interface StreamHandlers {
|
|
371
|
-
onHop?: (d: { n: number; subquery: string; status: string; retrieval_contents?: number }) => void;
|
|
372
370
|
onSources?: (d: { retrieval_contents: RetrievalContent[] }) => void;
|
|
373
371
|
onToken?: (text: string) => void;
|
|
374
372
|
onFinal?: (d: QueryResponse) => void;
|
|
@@ -612,7 +610,6 @@ function dispatchSse(frame: string, h: StreamHandlers): void {
|
|
|
612
610
|
const data = safeJson(dataLines.join("\n"));
|
|
613
611
|
h.onEvent?.(event, data);
|
|
614
612
|
switch (event) {
|
|
615
|
-
case "hop": h.onHop?.(data as never); break;
|
|
616
613
|
case "retrieval_contents": h.onSources?.(data as never); break;
|
|
617
614
|
case "token": h.onToken?.((data as { text: string }).text); break;
|
|
618
615
|
case "final": h.onFinal?.(data as QueryResponse); break;
|