feat: Embedded chat window supports userVariables configuration. (#20983)

This commit is contained in:
croatialu
2025-06-18 14:27:02 +08:00
committed by GitHub
parent 787a556bd7
commit 15800c6108
8 changed files with 58 additions and 6 deletions

View File

@@ -112,9 +112,21 @@
return compressedSystemVariables;
}
async function getCompressedUserVariablesFromConfig() {
const userVariables = config?.userVariables || {};
const compressedUserVariables = {};
await Promise.all(
Object.entries(userVariables).map(async ([key, value]) => {
compressedUserVariables[`user.${key}`] = await compressAndEncodeBase64(value);
})
);
return compressedUserVariables;
}
const params = new URLSearchParams({
...await getCompressedInputsFromConfig(),
...await getCompressedSystemVariablesFromConfig()
...await getCompressedSystemVariablesFromConfig(),
...await getCompressedUserVariablesFromConfig()
});
const baseUrl =