fix: auto prompt (#2768)

This commit is contained in:
zxhlyh
2024-03-09 18:36:58 +08:00
committed by GitHub
parent 88145efa97
commit 9beefd7d5a
3 changed files with 28 additions and 0 deletions

View File

@@ -26,6 +26,7 @@ import { ArrowNarrowRight } from '@/app/components/base/icons/src/vender/line/ar
import { useEventEmitterContextContext } from '@/context/event-emitter'
import { ADD_EXTERNAL_DATA_TOOL } from '@/app/components/app/configuration/config-var'
import { INSERT_VARIABLE_VALUE_BLOCK_COMMAND } from '@/app/components/base/prompt-editor/plugins/variable-block'
import { PROMPT_EDITOR_UPDATE_VALUE_BY_EVENT_EMITTER } from '@/app/components/base/prompt-editor/plugins/update-block'
export type ISimplePromptInput = {
mode: AppType
@@ -125,6 +126,10 @@ const Prompt: FC<ISimplePromptInput> = ({
if (mode === AppType.chat)
setIntroduction(res.opening_statement)
showAutomaticFalse()
eventEmitter?.emit({
type: PROMPT_EDITOR_UPDATE_VALUE_BY_EVENT_EMITTER,
payload: res.prompt,
} as any)
}
const minHeight = 228
const [editorHeight, setEditorHeight] = useState(minHeight)