@babav/knowledge-core-client 0.33.0 → 0.34.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 +42 -19
- package/dist/index.js +5 -1
- package/package.json +1 -1
- package/src/index.ts +32 -3
package/dist/index.d.ts
CHANGED
|
@@ -417,6 +417,7 @@ export interface Feedback {
|
|
|
417
417
|
}
|
|
418
418
|
export interface Agent {
|
|
419
419
|
id: UUID;
|
|
420
|
+
tenant_id: UUID | null;
|
|
420
421
|
name: string;
|
|
421
422
|
identity_prompt: string | null;
|
|
422
423
|
response_prompt: string | null;
|
|
@@ -435,6 +436,41 @@ export interface Agent {
|
|
|
435
436
|
groundedness_threshold: number | null;
|
|
436
437
|
grounding_enabled: boolean | null;
|
|
437
438
|
citations_enabled: boolean | null;
|
|
439
|
+
visual_mode_default: string | null;
|
|
440
|
+
visual_concept_model: string | null;
|
|
441
|
+
visual_concept_vet_model: string | null;
|
|
442
|
+
visual_proposer_model: string | null;
|
|
443
|
+
visual_claims_check_model: string | null;
|
|
444
|
+
visual_vision_judge_model: string | null;
|
|
445
|
+
visual_max_revisions: number | null;
|
|
446
|
+
visual_combine_generation_and_concept: boolean | null;
|
|
447
|
+
concept_model_mode: string | null;
|
|
448
|
+
}
|
|
449
|
+
/** Fields settable when creating/updating an agent. All optional (null/omit => server default); model
|
|
450
|
+
* fields must be one of `getModelOptions().fields[field].supported`. `tenant_id` is create-only. */
|
|
451
|
+
export type AgentWrite = Partial<Omit<Agent, "id" | "tenant_id">>;
|
|
452
|
+
/** Model catalog for the agent-config UI (GET /v1/agents/model-options). `models` maps id → its
|
|
453
|
+
* capabilities; `fields` gives each agent model-field its supported ids + default (+ usage metadata);
|
|
454
|
+
* `modes` says which model field governs each mode (reasoning is valid only if that model's
|
|
455
|
+
* supports_reasoning is true). KC provides the data; the UI decides presentation. */
|
|
456
|
+
export interface ModelOptions {
|
|
457
|
+
models: Record<string, {
|
|
458
|
+
label: string;
|
|
459
|
+
provider: "anthropic" | "vertex";
|
|
460
|
+
kind: "text" | "vision";
|
|
461
|
+
supports_reasoning: boolean;
|
|
462
|
+
}>;
|
|
463
|
+
fields: Record<string, {
|
|
464
|
+
supported: string[];
|
|
465
|
+
default: string;
|
|
466
|
+
applies_when?: string;
|
|
467
|
+
applies_to?: string[];
|
|
468
|
+
note?: string;
|
|
469
|
+
}>;
|
|
470
|
+
modes: Record<string, {
|
|
471
|
+
depends_on: string;
|
|
472
|
+
values: string[];
|
|
473
|
+
}>;
|
|
438
474
|
}
|
|
439
475
|
export interface Tenant {
|
|
440
476
|
id: UUID;
|
|
@@ -923,28 +959,15 @@ export declare class AdminClient extends HttpBase {
|
|
|
923
959
|
revokeApiKey: (tenantId: UUID, keyId: UUID) => Promise<void>;
|
|
924
960
|
};
|
|
925
961
|
agents: {
|
|
926
|
-
create: (b: {
|
|
962
|
+
create: (b: AgentWrite & {
|
|
927
963
|
name: string;
|
|
928
|
-
|
|
929
|
-
response_prompt?: string;
|
|
930
|
-
generation_model?: string;
|
|
931
|
-
generation_model_mode?: string;
|
|
932
|
-
max_response_tokens?: number;
|
|
933
|
-
top_k_retrieved_chunks?: number;
|
|
934
|
-
top_k_reranked_chunks?: number;
|
|
935
|
-
sibling_window?: number;
|
|
936
|
-
rerank_instruction?: string;
|
|
937
|
-
max_subqueries?: number;
|
|
938
|
-
max_reasoning_rounds?: number;
|
|
939
|
-
decomposition_model?: string;
|
|
940
|
-
reasoning_inspect_model?: string;
|
|
941
|
-
groundedness_verifier_model?: string;
|
|
942
|
-
groundedness_threshold?: number;
|
|
943
|
-
grounding_enabled?: boolean;
|
|
944
|
-
citations_enabled?: boolean;
|
|
964
|
+
tenant_id?: UUID | null;
|
|
945
965
|
}) => Promise<Agent>;
|
|
946
|
-
update: (id: UUID, b:
|
|
966
|
+
update: (id: UUID, b: AgentWrite) => Promise<Agent>;
|
|
947
967
|
delete: (id: UUID) => Promise<void>;
|
|
968
|
+
/** The model catalog for an agent-config UI: supported models + default per field, per-model
|
|
969
|
+
* capabilities (`supports_reasoning`), and mode↔model dependencies. */
|
|
970
|
+
modelOptions: () => Promise<ModelOptions>;
|
|
948
971
|
};
|
|
949
972
|
}
|
|
950
973
|
export interface ChatSendOptions extends StreamHandlers {
|
package/dist/index.js
CHANGED
|
@@ -490,11 +490,15 @@ export class AdminClient extends HttpBase {
|
|
|
490
490
|
listApiKeys: (tenantId, q) => this.request("GET", `/v1/tenants/${tenantId}/api-keys`, { query: q }),
|
|
491
491
|
revokeApiKey: (tenantId, keyId) => this.request("DELETE", `/v1/tenants/${tenantId}/api-keys/${keyId}`),
|
|
492
492
|
};
|
|
493
|
-
//
|
|
493
|
+
// Agent provisioning (query agents). Pass `tenant_id` on create for a per-tenant agent; omit (or
|
|
494
|
+
// null) for a Babav-global one. Model fields are validated against the model registry server-side.
|
|
494
495
|
agents = {
|
|
495
496
|
create: (b) => this.request("POST", "/v1/agents", { json: b }),
|
|
496
497
|
update: (id, b) => this.request("PATCH", `/v1/agents/${id}`, { json: b }),
|
|
497
498
|
delete: (id) => this.request("DELETE", `/v1/agents/${id}`),
|
|
499
|
+
/** The model catalog for an agent-config UI: supported models + default per field, per-model
|
|
500
|
+
* capabilities (`supports_reasoning`), and mode↔model dependencies. */
|
|
501
|
+
modelOptions: () => this.request("GET", "/v1/agents/model-options"),
|
|
498
502
|
};
|
|
499
503
|
}
|
|
500
504
|
/** A chat session bound to ONE conversation (created via `kc.chat(...)`). Every `send()` is ALWAYS
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@babav/knowledge-core-client",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.34.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
|
@@ -399,6 +399,7 @@ export interface Feedback {
|
|
|
399
399
|
}
|
|
400
400
|
export interface Agent {
|
|
401
401
|
id: UUID;
|
|
402
|
+
tenant_id: UUID | null; // null => Babav-global agent; a tenant id => per-tenant
|
|
402
403
|
name: string;
|
|
403
404
|
identity_prompt: string | null; // answer-system: who/purpose (null => server default)
|
|
404
405
|
response_prompt: string | null; // answer-system: output guidelines (null => server default)
|
|
@@ -417,6 +418,30 @@ export interface Agent {
|
|
|
417
418
|
groundedness_threshold: number | null;
|
|
418
419
|
grounding_enabled: boolean | null;
|
|
419
420
|
citations_enabled: boolean | null;
|
|
421
|
+
// Visual pipeline defaults (null => server default; overridable per request).
|
|
422
|
+
visual_mode_default: string | null; // "off" | "on"
|
|
423
|
+
visual_concept_model: string | null;
|
|
424
|
+
visual_concept_vet_model: string | null;
|
|
425
|
+
visual_proposer_model: string | null; // authors the HTML figure + chart/structural/scene specs
|
|
426
|
+
visual_claims_check_model: string | null;
|
|
427
|
+
visual_vision_judge_model: string | null; // Vertex Gemini model
|
|
428
|
+
visual_max_revisions: number | null;
|
|
429
|
+
visual_combine_generation_and_concept: boolean | null;
|
|
430
|
+
concept_model_mode: string | null; // "reasoning" | "standard"; overrules gen mode when combining
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
/** Fields settable when creating/updating an agent. All optional (null/omit => server default); model
|
|
434
|
+
* fields must be one of `getModelOptions().fields[field].supported`. `tenant_id` is create-only. */
|
|
435
|
+
export type AgentWrite = Partial<Omit<Agent, "id" | "tenant_id">>;
|
|
436
|
+
|
|
437
|
+
/** Model catalog for the agent-config UI (GET /v1/agents/model-options). `models` maps id → its
|
|
438
|
+
* capabilities; `fields` gives each agent model-field its supported ids + default (+ usage metadata);
|
|
439
|
+
* `modes` says which model field governs each mode (reasoning is valid only if that model's
|
|
440
|
+
* supports_reasoning is true). KC provides the data; the UI decides presentation. */
|
|
441
|
+
export interface ModelOptions {
|
|
442
|
+
models: Record<string, { label: string; provider: "anthropic" | "vertex"; kind: "text" | "vision"; supports_reasoning: boolean }>;
|
|
443
|
+
fields: Record<string, { supported: string[]; default: string; applies_when?: string; applies_to?: string[]; note?: string }>;
|
|
444
|
+
modes: Record<string, { depends_on: string; values: string[] }>;
|
|
420
445
|
}
|
|
421
446
|
export interface Tenant {
|
|
422
447
|
id: UUID;
|
|
@@ -1065,13 +1090,17 @@ export class AdminClient extends HttpBase {
|
|
|
1065
1090
|
revokeApiKey: (tenantId: UUID, keyId: UUID) => this.request<void>("DELETE", `/v1/tenants/${tenantId}/api-keys/${keyId}`),
|
|
1066
1091
|
};
|
|
1067
1092
|
|
|
1068
|
-
//
|
|
1093
|
+
// Agent provisioning (query agents). Pass `tenant_id` on create for a per-tenant agent; omit (or
|
|
1094
|
+
// null) for a Babav-global one. Model fields are validated against the model registry server-side.
|
|
1069
1095
|
agents = {
|
|
1070
|
-
create: (b: { name: string;
|
|
1096
|
+
create: (b: AgentWrite & { name: string; tenant_id?: UUID | null }) =>
|
|
1071
1097
|
this.request<Agent>("POST", "/v1/agents", { json: b }),
|
|
1072
|
-
update: (id: UUID, b:
|
|
1098
|
+
update: (id: UUID, b: AgentWrite) =>
|
|
1073
1099
|
this.request<Agent>("PATCH", `/v1/agents/${id}`, { json: b }),
|
|
1074
1100
|
delete: (id: UUID) => this.request<void>("DELETE", `/v1/agents/${id}`),
|
|
1101
|
+
/** The model catalog for an agent-config UI: supported models + default per field, per-model
|
|
1102
|
+
* capabilities (`supports_reasoning`), and mode↔model dependencies. */
|
|
1103
|
+
modelOptions: () => this.request<ModelOptions>("GET", "/v1/agents/model-options"),
|
|
1075
1104
|
};
|
|
1076
1105
|
}
|
|
1077
1106
|
|