mirror of
				https://github.com/langgenius/dify.git
				synced 2025-10-31 02:42:59 +00:00 
			
		
		
		
	
		
			
	
	
		
			25 lines
		
	
	
		
			815 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
		
		
			
		
	
	
			25 lines
		
	
	
		
			815 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
|   | 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) | ||
|  | } |