@babav/knowledge-core-client 0.14.0 → 0.16.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 +20 -4
- package/package.json +1 -1
- package/src/index.ts +14 -4
package/dist/index.d.ts
CHANGED
|
@@ -51,9 +51,14 @@ export interface RetrievalContent {
|
|
|
51
51
|
}
|
|
52
52
|
export interface QueryOverrides {
|
|
53
53
|
generation_model?: string;
|
|
54
|
-
|
|
54
|
+
max_response_tokens?: number;
|
|
55
|
+
top_k_retrieved_chunks?: number;
|
|
56
|
+
top_k_reranked_chunks?: number;
|
|
57
|
+
sibling_window?: number;
|
|
55
58
|
rerank_instruction?: string;
|
|
56
59
|
max_hops?: number;
|
|
60
|
+
decomposition_model?: string;
|
|
61
|
+
groundedness_verifier_model?: string;
|
|
57
62
|
groundedness_threshold?: number;
|
|
58
63
|
grounding_enabled?: boolean;
|
|
59
64
|
citations_enabled?: boolean;
|
|
@@ -199,9 +204,14 @@ export interface Agent {
|
|
|
199
204
|
identity_prompt: string | null;
|
|
200
205
|
response_prompt: string | null;
|
|
201
206
|
generation_model: string | null;
|
|
202
|
-
|
|
207
|
+
max_response_tokens: number | null;
|
|
208
|
+
top_k_retrieved_chunks: number | null;
|
|
209
|
+
top_k_reranked_chunks: number | null;
|
|
210
|
+
sibling_window: number | null;
|
|
203
211
|
rerank_instruction: string | null;
|
|
204
212
|
max_hops: number | null;
|
|
213
|
+
decomposition_model: string | null;
|
|
214
|
+
groundedness_verifier_model: string | null;
|
|
205
215
|
groundedness_threshold: number | null;
|
|
206
216
|
grounding_enabled: boolean | null;
|
|
207
217
|
citations_enabled: boolean | null;
|
|
@@ -291,7 +301,8 @@ export declare class KnowledgeCoreClient extends HttpBase {
|
|
|
291
301
|
retrieve(body: {
|
|
292
302
|
query: string;
|
|
293
303
|
corpus_ids: UUID[];
|
|
294
|
-
|
|
304
|
+
top_k_retrieved_chunks?: number;
|
|
305
|
+
top_k_reranked_chunks?: number;
|
|
295
306
|
rerank?: boolean;
|
|
296
307
|
instruction?: string;
|
|
297
308
|
filter?: MetadataFilter;
|
|
@@ -496,9 +507,14 @@ export declare class AdminClient extends HttpBase {
|
|
|
496
507
|
identity_prompt?: string;
|
|
497
508
|
response_prompt?: string;
|
|
498
509
|
generation_model?: string;
|
|
499
|
-
|
|
510
|
+
max_response_tokens?: number;
|
|
511
|
+
top_k_retrieved_chunks?: number;
|
|
512
|
+
top_k_reranked_chunks?: number;
|
|
513
|
+
sibling_window?: number;
|
|
500
514
|
rerank_instruction?: string;
|
|
501
515
|
max_hops?: number;
|
|
516
|
+
decomposition_model?: string;
|
|
517
|
+
groundedness_verifier_model?: string;
|
|
502
518
|
groundedness_threshold?: number;
|
|
503
519
|
grounding_enabled?: boolean;
|
|
504
520
|
citations_enabled?: boolean;
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -61,9 +61,14 @@ export interface RetrievalContent {
|
|
|
61
61
|
|
|
62
62
|
export interface QueryOverrides {
|
|
63
63
|
generation_model?: string;
|
|
64
|
-
|
|
64
|
+
max_response_tokens?: number; // max answer tokens
|
|
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
|
+
sibling_window?: number; // adjacent sections fetched each side of a hit
|
|
65
68
|
rerank_instruction?: string;
|
|
66
69
|
max_hops?: number;
|
|
70
|
+
decomposition_model?: string; // model for query decomposition
|
|
71
|
+
groundedness_verifier_model?: string; // model for the groundedness LLM judge
|
|
67
72
|
groundedness_threshold?: number;
|
|
68
73
|
grounding_enabled?: boolean; // groundedness score (default off)
|
|
69
74
|
citations_enabled?: boolean; // source attribution (default on)
|
|
@@ -212,9 +217,14 @@ export interface Agent {
|
|
|
212
217
|
identity_prompt: string | null; // answer-system: who/purpose (null => server default)
|
|
213
218
|
response_prompt: string | null; // answer-system: output guidelines (null => server default)
|
|
214
219
|
generation_model: string | null;
|
|
215
|
-
|
|
220
|
+
max_response_tokens: number | null;
|
|
221
|
+
top_k_retrieved_chunks: number | null;
|
|
222
|
+
top_k_reranked_chunks: number | null;
|
|
223
|
+
sibling_window: number | null;
|
|
216
224
|
rerank_instruction: string | null;
|
|
217
225
|
max_hops: number | null;
|
|
226
|
+
decomposition_model: string | null;
|
|
227
|
+
groundedness_verifier_model: string | null;
|
|
218
228
|
groundedness_threshold: number | null;
|
|
219
229
|
grounding_enabled: boolean | null;
|
|
220
230
|
citations_enabled: boolean | null;
|
|
@@ -456,7 +466,7 @@ export class KnowledgeCoreClient extends HttpBase {
|
|
|
456
466
|
}
|
|
457
467
|
|
|
458
468
|
// --- retrieve (cross-corpus primitive, no generation) ---
|
|
459
|
-
retrieve(body: { query: string; corpus_ids: UUID[];
|
|
469
|
+
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[] }> {
|
|
460
470
|
return this.request("POST", "/v1/retrieve", { json: body });
|
|
461
471
|
}
|
|
462
472
|
|
|
@@ -632,7 +642,7 @@ export class AdminClient extends HttpBase {
|
|
|
632
642
|
|
|
633
643
|
// Agents are query agents, global for now.
|
|
634
644
|
agents = {
|
|
635
|
-
create: (b: { name: string; identity_prompt?: string; response_prompt?: string; generation_model?: string;
|
|
645
|
+
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_hops?: number; decomposition_model?: string; groundedness_verifier_model?: string; groundedness_threshold?: number; grounding_enabled?: boolean; citations_enabled?: boolean }) =>
|
|
636
646
|
this.request<Agent>("POST", "/v1/agents", { json: b }),
|
|
637
647
|
update: (id: UUID, b: Partial<Omit<Agent, "id">>) =>
|
|
638
648
|
this.request<Agent>("PATCH", `/v1/agents/${id}`, { json: b }),
|