@openbkn/bkn-sdk 0.1.1-alpha.12 → 0.1.1-alpha.14
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/{chunk-3FVB6VFQ.js → chunk-2GNQU4XH.js} +26 -3
- package/dist/chunk-2GNQU4XH.js.map +1 -0
- package/dist/cli.js +54 -7
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +17 -0
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-3FVB6VFQ.js.map +0 -1
|
@@ -3745,6 +3745,23 @@ function deleteModels(ctx, kind, modelIds) {
|
|
|
3745
3745
|
function testModel(ctx, kind, body) {
|
|
3746
3746
|
return request(ctx, `${MANAGER}/${kind}/test`, { method: "POST", body });
|
|
3747
3747
|
}
|
|
3748
|
+
function setDefaultLlm(ctx, modelId, isDefault = true) {
|
|
3749
|
+
return request(ctx, `${MANAGER}/llm/default/edit`, {
|
|
3750
|
+
method: "POST",
|
|
3751
|
+
body: { model_id: modelId, default: isDefault }
|
|
3752
|
+
});
|
|
3753
|
+
}
|
|
3754
|
+
function setDefaultSmallModel(ctx, modelId, isDefault = true) {
|
|
3755
|
+
return request(ctx, `${MANAGER}/small-model/set-default`, {
|
|
3756
|
+
method: "POST",
|
|
3757
|
+
body: { model_id: modelId, default: isDefault }
|
|
3758
|
+
});
|
|
3759
|
+
}
|
|
3760
|
+
function getDefaultSmallModel(ctx, modelType = "embedding") {
|
|
3761
|
+
return request(ctx, `${MANAGER}/small-model/get_default`, {
|
|
3762
|
+
query: { model_type: modelType }
|
|
3763
|
+
});
|
|
3764
|
+
}
|
|
3748
3765
|
function rerank(ctx, model, query, documents) {
|
|
3749
3766
|
return request(ctx, `${API}/small-model/reranker`, {
|
|
3750
3767
|
method: "POST",
|
|
@@ -3763,7 +3780,9 @@ function models(ctx) {
|
|
|
3763
3780
|
add: (body) => addModel(ctx, "llm", body),
|
|
3764
3781
|
edit: (body) => editModel(ctx, "llm", body),
|
|
3765
3782
|
delete: (modelIds) => deleteModels(ctx, "llm", modelIds),
|
|
3766
|
-
test: (body) => testModel(ctx, "llm", body)
|
|
3783
|
+
test: (body) => testModel(ctx, "llm", body),
|
|
3784
|
+
/** Set (or clear) the system default LLM. */
|
|
3785
|
+
setDefault: (modelId, isDefault = true) => setDefaultLlm(ctx, modelId, isDefault)
|
|
3767
3786
|
},
|
|
3768
3787
|
small: {
|
|
3769
3788
|
list: (opts) => listSmallModels(ctx, opts),
|
|
@@ -3773,7 +3792,11 @@ function models(ctx) {
|
|
|
3773
3792
|
add: (body) => addModel(ctx, "small-model", body),
|
|
3774
3793
|
edit: (body) => editModel(ctx, "small-model", body),
|
|
3775
3794
|
delete: (modelIds) => deleteModels(ctx, "small-model", modelIds),
|
|
3776
|
-
test: (body) => testModel(ctx, "small-model", body)
|
|
3795
|
+
test: (body) => testModel(ctx, "small-model", body),
|
|
3796
|
+
/** Set (or clear) the system default small model (type inferred from the model). */
|
|
3797
|
+
setDefault: (modelId, isDefault = true) => setDefaultSmallModel(ctx, modelId, isDefault),
|
|
3798
|
+
/** Get the system default small model for a type (default "embedding"). */
|
|
3799
|
+
getDefault: (modelType) => getDefaultSmallModel(ctx, modelType)
|
|
3777
3800
|
}
|
|
3778
3801
|
};
|
|
3779
3802
|
}
|
|
@@ -5308,4 +5331,4 @@ export {
|
|
|
5308
5331
|
exportCreds,
|
|
5309
5332
|
auth_exports
|
|
5310
5333
|
};
|
|
5311
|
-
//# sourceMappingURL=chunk-
|
|
5334
|
+
//# sourceMappingURL=chunk-2GNQU4XH.js.map
|