mirror of
http://112.124.100.131/huang.ze/ebiz-dify-ai.git
synced 2025-12-11 03:46:52 +08:00
feat: advanced prompt (#1330)
Co-authored-by: Joel <iamjoel007@gmail.com> Co-authored-by: JzoNg <jzongcode@gmail.com> Co-authored-by: Gillian97 <jinling.sunshine@gmail.com>
This commit is contained in:
24
web/app/components/base/prompt-editor/constants.tsx
Normal file
24
web/app/components/base/prompt-editor/constants.tsx
Normal file
@@ -0,0 +1,24 @@
|
||||
export const CONTEXT_PLACEHOLDER_TEXT = '{{#context#}}'
|
||||
export const HISTORY_PLACEHOLDER_TEXT = '{{#histories#}}'
|
||||
export const QUERY_PLACEHOLDER_TEXT = '{{#query#}}'
|
||||
export const PRE_PROMPT_PLACEHOLDER_TEXT = '{{#pre_prompt#}}'
|
||||
export const UPDATE_DATASETS_EVENT_EMITTER = 'prompt-editor-context-block-update-datasets'
|
||||
export const UPDATE_HISTORY_EVENT_EMITTER = 'prompt-editor-history-block-update-role'
|
||||
|
||||
export const checkHasContextBlock = (text: string) => {
|
||||
if (!text)
|
||||
return false
|
||||
return text.includes(CONTEXT_PLACEHOLDER_TEXT)
|
||||
}
|
||||
|
||||
export const checkHasHistoryBlock = (text: string) => {
|
||||
if (!text)
|
||||
return false
|
||||
return text.includes(HISTORY_PLACEHOLDER_TEXT)
|
||||
}
|
||||
|
||||
export const checkHasQueryBlock = (text: string) => {
|
||||
if (!text)
|
||||
return false
|
||||
return text.includes(QUERY_PLACEHOLDER_TEXT)
|
||||
}
|
||||
Reference in New Issue
Block a user