@c4a/core 0.4.15-beta.1 → 0.4.15-beta.4
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/index.js +38 -1
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -8936,6 +8936,21 @@ var DEFAULT_SERVER_CONFIG = {
|
|
|
8936
8936
|
api_key: "",
|
|
8937
8937
|
model_id: "text-embedding-004"
|
|
8938
8938
|
}
|
|
8939
|
+
},
|
|
8940
|
+
reranker: {
|
|
8941
|
+
enabled: false,
|
|
8942
|
+
provider: "huggingface",
|
|
8943
|
+
huggingface: {
|
|
8944
|
+
model_id: "onnx-community/bge-reranker-v2-m3-ONNX",
|
|
8945
|
+
dtype: "q8",
|
|
8946
|
+
cache_dir: "./models/reranker"
|
|
8947
|
+
},
|
|
8948
|
+
xenova: {
|
|
8949
|
+
model_id: "onnx-community/bge-reranker-v2-m3-ONNX",
|
|
8950
|
+
dtype: "q8",
|
|
8951
|
+
cache_dir: "./models/reranker"
|
|
8952
|
+
},
|
|
8953
|
+
max_rerank: 20
|
|
8939
8954
|
}
|
|
8940
8955
|
};
|
|
8941
8956
|
// src/types/daemon.ts
|
|
@@ -13773,6 +13788,26 @@ import { createHash as createHash2 } from "node:crypto";
|
|
|
13773
13788
|
function contentHash(content) {
|
|
13774
13789
|
return createHash2("sha256").update(content).digest("hex");
|
|
13775
13790
|
}
|
|
13791
|
+
// src/utils/object.ts
|
|
13792
|
+
function isPlainObject(value) {
|
|
13793
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
13794
|
+
}
|
|
13795
|
+
function mergeDefaults(defaults, override) {
|
|
13796
|
+
const result = { ...defaults };
|
|
13797
|
+
for (const [key, value] of Object.entries(override)) {
|
|
13798
|
+
if (!(key in defaults))
|
|
13799
|
+
continue;
|
|
13800
|
+
const defaultValue = defaults[key];
|
|
13801
|
+
if (isPlainObject(defaultValue)) {
|
|
13802
|
+
if (isPlainObject(value)) {
|
|
13803
|
+
result[key] = mergeDefaults(defaultValue, value);
|
|
13804
|
+
}
|
|
13805
|
+
} else if (value !== undefined && value !== null) {
|
|
13806
|
+
result[key] = value;
|
|
13807
|
+
}
|
|
13808
|
+
}
|
|
13809
|
+
return result;
|
|
13810
|
+
}
|
|
13776
13811
|
// src/utils/path.ts
|
|
13777
13812
|
import path from "node:path";
|
|
13778
13813
|
function isPathSafe(inputPath) {
|
|
@@ -14007,7 +14042,7 @@ var INDEXABLE_EXTENSIONS = new Set([
|
|
|
14007
14042
|
var UPLOAD_ALLOWED_EXTENSIONS = collectExtensions(() => true);
|
|
14008
14043
|
var TEXT_EXTENSIONS = collectExtensions((definition) => definition.cas.encoding === "utf8");
|
|
14009
14044
|
var UPLOAD_MAX_FILE_SIZE = 5 * 1024 * 1024;
|
|
14010
|
-
var UPLOAD_MAX_FILES =
|
|
14045
|
+
var UPLOAD_MAX_FILES = 20;
|
|
14011
14046
|
function getFileExtension(name) {
|
|
14012
14047
|
const dot = name.lastIndexOf(".");
|
|
14013
14048
|
return dot >= 0 ? name.slice(dot).toLowerCase() : "";
|
|
@@ -14066,11 +14101,13 @@ export {
|
|
|
14066
14101
|
metricMilestoneSchema,
|
|
14067
14102
|
metricAtomSchema,
|
|
14068
14103
|
metadataSchema,
|
|
14104
|
+
mergeDefaults,
|
|
14069
14105
|
matchesPathFilter,
|
|
14070
14106
|
mapErrorCodeToStatus,
|
|
14071
14107
|
kindSchema,
|
|
14072
14108
|
isValidManifest,
|
|
14073
14109
|
isRefPointer,
|
|
14110
|
+
isPlainObject,
|
|
14074
14111
|
isPathSafe,
|
|
14075
14112
|
isIndexableFile,
|
|
14076
14113
|
hasExcludedSegment,
|