@babav/knowledge-core-client 0.15.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 +8 -7
- package/package.json +1 -1
- package/src/index.ts +6 -6
package/dist/index.d.ts
CHANGED
|
@@ -52,8 +52,8 @@ 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_hops?: number;
|
|
@@ -205,8 +205,8 @@ export interface Agent {
|
|
|
205
205
|
response_prompt: string | null;
|
|
206
206
|
generation_model: string | null;
|
|
207
207
|
max_response_tokens: number | null;
|
|
208
|
-
|
|
209
|
-
|
|
208
|
+
top_k_retrieved_chunks: number | null;
|
|
209
|
+
top_k_reranked_chunks: number | null;
|
|
210
210
|
sibling_window: number | null;
|
|
211
211
|
rerank_instruction: string | null;
|
|
212
212
|
max_hops: number | null;
|
|
@@ -301,7 +301,8 @@ export declare class KnowledgeCoreClient extends HttpBase {
|
|
|
301
301
|
retrieve(body: {
|
|
302
302
|
query: string;
|
|
303
303
|
corpus_ids: UUID[];
|
|
304
|
-
|
|
304
|
+
top_k_retrieved_chunks?: number;
|
|
305
|
+
top_k_reranked_chunks?: number;
|
|
305
306
|
rerank?: boolean;
|
|
306
307
|
instruction?: string;
|
|
307
308
|
filter?: MetadataFilter;
|
|
@@ -507,8 +508,8 @@ export declare class AdminClient extends HttpBase {
|
|
|
507
508
|
response_prompt?: string;
|
|
508
509
|
generation_model?: string;
|
|
509
510
|
max_response_tokens?: number;
|
|
510
|
-
|
|
511
|
-
|
|
511
|
+
top_k_retrieved_chunks?: number;
|
|
512
|
+
top_k_reranked_chunks?: number;
|
|
512
513
|
sibling_window?: number;
|
|
513
514
|
rerank_instruction?: string;
|
|
514
515
|
max_hops?: number;
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -62,8 +62,8 @@ 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_hops?: number;
|
|
@@ -218,8 +218,8 @@ export interface Agent {
|
|
|
218
218
|
response_prompt: string | null; // answer-system: output guidelines (null => server default)
|
|
219
219
|
generation_model: string | null;
|
|
220
220
|
max_response_tokens: number | null;
|
|
221
|
-
|
|
222
|
-
|
|
221
|
+
top_k_retrieved_chunks: number | null;
|
|
222
|
+
top_k_reranked_chunks: number | null;
|
|
223
223
|
sibling_window: number | null;
|
|
224
224
|
rerank_instruction: string | null;
|
|
225
225
|
max_hops: number | null;
|
|
@@ -466,7 +466,7 @@ export class KnowledgeCoreClient extends HttpBase {
|
|
|
466
466
|
}
|
|
467
467
|
|
|
468
468
|
// --- retrieve (cross-corpus primitive, no generation) ---
|
|
469
|
-
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[] }> {
|
|
470
470
|
return this.request("POST", "/v1/retrieve", { json: body });
|
|
471
471
|
}
|
|
472
472
|
|
|
@@ -642,7 +642,7 @@ export class AdminClient extends HttpBase {
|
|
|
642
642
|
|
|
643
643
|
// Agents are query agents, global for now.
|
|
644
644
|
agents = {
|
|
645
|
-
create: (b: { name: string; identity_prompt?: string; response_prompt?: string; generation_model?: string; max_response_tokens?: number;
|
|
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 }) =>
|
|
646
646
|
this.request<Agent>("POST", "/v1/agents", { json: b }),
|
|
647
647
|
update: (id: UUID, b: Partial<Omit<Agent, "id">>) =>
|
|
648
648
|
this.request<Agent>("PATCH", `/v1/agents/${id}`, { json: b }),
|