feat: env MAX_TOOLS_NUM (#15431)
Co-authored-by: crazywoola <427733928@qq.com>
This commit is contained in:
parent
0415cc209d
commit
1d5ea80a2b
6 changed files with 18 additions and 1 deletions
|
|
@ -162,7 +162,14 @@ export const ANNOTATION_DEFAULT = {
|
|||
score_threshold: 0.9,
|
||||
}
|
||||
|
||||
export const MAX_TOOLS_NUM = 10
|
||||
export let maxToolsNum = 10
|
||||
|
||||
if (process.env.NEXT_PUBLIC_MAX_TOOLS_NUM && process.env.NEXT_PUBLIC_MAX_TOOLS_NUM !== '')
|
||||
maxToolsNum = Number.parseInt(process.env.NEXT_PUBLIC_MAX_TOOLS_NUM)
|
||||
else if (globalThis.document?.body?.getAttribute('data-public-max-tools-num') && globalThis.document.body.getAttribute('data-public-max-tools-num') !== '')
|
||||
maxToolsNum = Number.parseInt(globalThis.document.body.getAttribute('data-public-max-tools-num') as string)
|
||||
|
||||
export const MAX_TOOLS_NUM = maxToolsNum
|
||||
|
||||
export const DEFAULT_AGENT_SETTING = {
|
||||
enabled: false,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue