@babav/knowledge-core-client 0.15.0 → 0.17.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 +17 -10
- package/package.json +1 -1
- package/src/index.ts +12 -8
package/dist/index.d.ts
CHANGED
|
@@ -52,12 +52,14 @@ export interface RetrievalContent {
|
|
|
52
52
|
export interface QueryOverrides {
|
|
53
53
|
generation_model?: string;
|
|
54
54
|
max_response_tokens?: number;
|
|
55
|
-
|
|
56
|
-
|
|
55
|
+
top_k_retrieved_chunks?: number;
|
|
56
|
+
top_k_reranked_chunks?: number;
|
|
57
57
|
sibling_window?: number;
|
|
58
58
|
rerank_instruction?: string;
|
|
59
|
-
|
|
59
|
+
max_subqueries?: number;
|
|
60
|
+
max_reasoning_rounds?: number;
|
|
60
61
|
decomposition_model?: string;
|
|
62
|
+
reasoning_inspect_model?: string;
|
|
61
63
|
groundedness_verifier_model?: string;
|
|
62
64
|
groundedness_threshold?: number;
|
|
63
65
|
grounding_enabled?: boolean;
|
|
@@ -205,12 +207,14 @@ export interface Agent {
|
|
|
205
207
|
response_prompt: string | null;
|
|
206
208
|
generation_model: string | null;
|
|
207
209
|
max_response_tokens: number | null;
|
|
208
|
-
|
|
209
|
-
|
|
210
|
+
top_k_retrieved_chunks: number | null;
|
|
211
|
+
top_k_reranked_chunks: number | null;
|
|
210
212
|
sibling_window: number | null;
|
|
211
213
|
rerank_instruction: string | null;
|
|
212
|
-
|
|
214
|
+
max_subqueries: number | null;
|
|
215
|
+
max_reasoning_rounds: number | null;
|
|
213
216
|
decomposition_model: string | null;
|
|
217
|
+
reasoning_inspect_model: string | null;
|
|
214
218
|
groundedness_verifier_model: string | null;
|
|
215
219
|
groundedness_threshold: number | null;
|
|
216
220
|
grounding_enabled: boolean | null;
|
|
@@ -301,7 +305,8 @@ export declare class KnowledgeCoreClient extends HttpBase {
|
|
|
301
305
|
retrieve(body: {
|
|
302
306
|
query: string;
|
|
303
307
|
corpus_ids: UUID[];
|
|
304
|
-
|
|
308
|
+
top_k_retrieved_chunks?: number;
|
|
309
|
+
top_k_reranked_chunks?: number;
|
|
305
310
|
rerank?: boolean;
|
|
306
311
|
instruction?: string;
|
|
307
312
|
filter?: MetadataFilter;
|
|
@@ -507,12 +512,14 @@ export declare class AdminClient extends HttpBase {
|
|
|
507
512
|
response_prompt?: string;
|
|
508
513
|
generation_model?: string;
|
|
509
514
|
max_response_tokens?: number;
|
|
510
|
-
|
|
511
|
-
|
|
515
|
+
top_k_retrieved_chunks?: number;
|
|
516
|
+
top_k_reranked_chunks?: number;
|
|
512
517
|
sibling_window?: number;
|
|
513
518
|
rerank_instruction?: string;
|
|
514
|
-
|
|
519
|
+
max_subqueries?: number;
|
|
520
|
+
max_reasoning_rounds?: number;
|
|
515
521
|
decomposition_model?: string;
|
|
522
|
+
reasoning_inspect_model?: string;
|
|
516
523
|
groundedness_verifier_model?: string;
|
|
517
524
|
groundedness_threshold?: number;
|
|
518
525
|
grounding_enabled?: boolean;
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -62,12 +62,14 @@ export interface RetrievalContent {
|
|
|
62
62
|
export interface QueryOverrides {
|
|
63
63
|
generation_model?: string;
|
|
64
64
|
max_response_tokens?: number; // max answer tokens
|
|
65
|
-
|
|
66
|
-
|
|
65
|
+
top_k_retrieved_chunks?: number; // candidate pool pulled from hybrid search (recall net)
|
|
66
|
+
top_k_reranked_chunks?: number; // sections kept after rerank -> the LLM
|
|
67
67
|
sibling_window?: number; // adjacent sections fetched each side of a hit
|
|
68
68
|
rerank_instruction?: string;
|
|
69
|
-
|
|
69
|
+
max_subqueries?: number; // parallel decompose-and-merge breadth per retrieval step
|
|
70
|
+
max_reasoning_rounds?: number; // iterative agentic-loop ceiling (1 = single pass; early-stops)
|
|
70
71
|
decomposition_model?: string; // model for query decomposition
|
|
72
|
+
reasoning_inspect_model?: string; // model for the per-round sufficiency / next-query decision
|
|
71
73
|
groundedness_verifier_model?: string; // model for the groundedness LLM judge
|
|
72
74
|
groundedness_threshold?: number;
|
|
73
75
|
grounding_enabled?: boolean; // groundedness score (default off)
|
|
@@ -218,12 +220,14 @@ export interface Agent {
|
|
|
218
220
|
response_prompt: string | null; // answer-system: output guidelines (null => server default)
|
|
219
221
|
generation_model: string | null;
|
|
220
222
|
max_response_tokens: number | null;
|
|
221
|
-
|
|
222
|
-
|
|
223
|
+
top_k_retrieved_chunks: number | null;
|
|
224
|
+
top_k_reranked_chunks: number | null;
|
|
223
225
|
sibling_window: number | null;
|
|
224
226
|
rerank_instruction: string | null;
|
|
225
|
-
|
|
227
|
+
max_subqueries: number | null;
|
|
228
|
+
max_reasoning_rounds: number | null;
|
|
226
229
|
decomposition_model: string | null;
|
|
230
|
+
reasoning_inspect_model: string | null;
|
|
227
231
|
groundedness_verifier_model: string | null;
|
|
228
232
|
groundedness_threshold: number | null;
|
|
229
233
|
grounding_enabled: boolean | null;
|
|
@@ -466,7 +470,7 @@ export class KnowledgeCoreClient extends HttpBase {
|
|
|
466
470
|
}
|
|
467
471
|
|
|
468
472
|
// --- retrieve (cross-corpus primitive, no generation) ---
|
|
469
|
-
retrieve(body: { query: string; corpus_ids: UUID[];
|
|
473
|
+
retrieve(body: { query: string; corpus_ids: UUID[]; top_k_retrieved_chunks?: number; top_k_reranked_chunks?: number; rerank?: boolean; instruction?: string; filter?: MetadataFilter; }): Promise<{ retrieval_contents: RetrievalContent[] }> {
|
|
470
474
|
return this.request("POST", "/v1/retrieve", { json: body });
|
|
471
475
|
}
|
|
472
476
|
|
|
@@ -642,7 +646,7 @@ export class AdminClient extends HttpBase {
|
|
|
642
646
|
|
|
643
647
|
// Agents are query agents, global for now.
|
|
644
648
|
agents = {
|
|
645
|
-
create: (b: { name: string; identity_prompt?: string; response_prompt?: string; generation_model?: string; max_response_tokens?: number;
|
|
649
|
+
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 }) =>
|
|
646
650
|
this.request<Agent>("POST", "/v1/agents", { json: b }),
|
|
647
651
|
update: (id: UUID, b: Partial<Omit<Agent, "id">>) =>
|
|
648
652
|
this.request<Agent>("PATCH", `/v1/agents/${id}`, { json: b }),
|