openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
33 lines (32 loc) • 1.36 kB
JavaScript
import { _ as uniqueStrings } from "./string-normalization-WNUDCpXX.js";
import "./string-coerce-runtime-CEGJWkQ_.js";
import "./provider-catalog-Cfg7HXK7.js";
import "./models-DKsBDoCN.js";
//#region extensions/volcengine/api.ts
const VOLCENGINE_UNSUPPORTED_TOOL_SCHEMA_KEYWORDS = [
"minLength",
"maxLength",
"minItems",
"maxItems",
"minContains",
"maxContains"
];
function mergeUnsupportedToolSchemaKeywords(existing) {
return uniqueStrings([...existing ?? [], ...VOLCENGINE_UNSUPPORTED_TOOL_SCHEMA_KEYWORDS]);
}
function resolveVolcengineToolSchemaCompatPatch(compat) {
return { unsupportedToolSchemaKeywords: mergeUnsupportedToolSchemaKeywords(compat?.unsupportedToolSchemaKeywords) };
}
function applyVolcengineToolSchemaCompat(model) {
const unsupportedToolSchemaKeywords = mergeUnsupportedToolSchemaKeywords(model.compat?.unsupportedToolSchemaKeywords);
if (model.compat?.unsupportedToolSchemaKeywords?.length === unsupportedToolSchemaKeywords.length && unsupportedToolSchemaKeywords.every((keyword, index) => model.compat?.unsupportedToolSchemaKeywords?.[index] === keyword)) return model;
return {
...model,
compat: {
...model.compat,
unsupportedToolSchemaKeywords
}
};
}
//#endregion
export { applyVolcengineToolSchemaCompat as n, resolveVolcengineToolSchemaCompatPatch as r, VOLCENGINE_UNSUPPORTED_TOOL_SCHEMA_KEYWORDS as t };