chore: make text generation timeout duration configurable (#6450)
This commit is contained in:
parent
2ba05b041f
commit
a5fcd91ba5
2 changed files with 4 additions and 1 deletions
|
|
@ -19,6 +19,7 @@ import { NodeRunningStatus, WorkflowRunningStatus } from '@/app/components/workf
|
||||||
import type { WorkflowProcess } from '@/app/components/base/chat/types'
|
import type { WorkflowProcess } from '@/app/components/base/chat/types'
|
||||||
import { sleep } from '@/utils'
|
import { sleep } from '@/utils'
|
||||||
import type { SiteInfo } from '@/models/share'
|
import type { SiteInfo } from '@/models/share'
|
||||||
|
import { TEXT_GENERATION_TIMEOUT_MS } from '@/config'
|
||||||
|
|
||||||
export type IResultProps = {
|
export type IResultProps = {
|
||||||
isWorkflow: boolean
|
isWorkflow: boolean
|
||||||
|
|
@ -186,7 +187,7 @@ const Result: FC<IResultProps> = ({
|
||||||
let isEnd = false
|
let isEnd = false
|
||||||
let isTimeout = false;
|
let isTimeout = false;
|
||||||
(async () => {
|
(async () => {
|
||||||
await sleep(1000 * 60) // 1min timeout
|
await sleep(TEXT_GENERATION_TIMEOUT_MS)
|
||||||
if (!isEnd) {
|
if (!isEnd) {
|
||||||
setRespondingFalse()
|
setRespondingFalse()
|
||||||
onCompleted(getCompletionRes(), taskId, false)
|
onCompleted(getCompletionRes(), taskId, false)
|
||||||
|
|
|
||||||
|
|
@ -245,3 +245,5 @@ Thought: {{agent_scratchpad}}
|
||||||
}
|
}
|
||||||
|
|
||||||
export const VAR_REGEX = /\{\{(#[a-zA-Z0-9_-]{1,50}(\.[a-zA-Z_][a-zA-Z0-9_]{0,29}){1,10}#)\}\}/gi
|
export const VAR_REGEX = /\{\{(#[a-zA-Z0-9_-]{1,50}(\.[a-zA-Z_][a-zA-Z0-9_]{0,29}){1,10}#)\}\}/gi
|
||||||
|
|
||||||
|
export const TEXT_GENERATION_TIMEOUT_MS = 60000
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue