[improvement][Chat] Support agent permission management (#1923)

* [improvement][Chat] Support agent permission management #1143

* [improvement][chat]Iterate LLM prompts of parsing and correction.

* [improvement][headless-fe] Added null-check conditions to the data formatting function.

* [improvement][headless]Clean code logic of headless translator.

---------

Co-authored-by: lxwcodemonkey <jolunoluo@tencent.com>
Co-authored-by: tristanliu <tristanliu@tencent.com>
This commit is contained in:
Jun Zhang
2024-11-23 09:09:04 +08:00
committed by GitHub
parent 244052e806
commit cb183b7ac8
66 changed files with 1023 additions and 1233 deletions

View File

@@ -3,6 +3,9 @@ import { NumericUnit } from '../common/constants';
import { isString } from 'lodash';
export function formatByDecimalPlaces(value: number | string, decimalPlaces: number) {
if (value === null || value === undefined || value === '') {
return 0;
}
if (isNaN(+value) || decimalPlaces < 0 || decimalPlaces > 100) {
return value;
}
@@ -17,6 +20,9 @@ export function formatByDecimalPlaces(value: number | string, decimalPlaces: num
}
export function formatByThousandSeperator(value: number | string) {
if (value === null || value === undefined || value === '') {
return 0;
}
if (isNaN(+value)) {
return value;
}