fix system prompt
Browse files35 unmodified lines3637383940414243444546474849505152174 unmodified lines22722822923023123223323423519 unmodified lines25525625725825926026126226326426535 unmodified lineshistory_to_chatbot_messages, strip_placeholder_thinking,is_placeholder_thinking_only, extract_last_thinking_line)from .prompts import (HTML_SYSTEM_PROMPT,TRANSFORMERS_JS_SYSTEM_PROMPT, STREAMLIT_SYSTEM_PROMPT,REACT_SYSTEM_PROMPT, REACT_FOLLOW_UP_SYSTEM_PROMPT,GRADIO_SYSTEM_PROMPT, JSON_SYSTEM_PROMPT,GENERIC_SYSTEM_PROMPT, MULTIPAGE_HTML_SYSTEM_PROMPT,DYNAMIC_MULTIPAGE_HTML_SYSTEM_PROMPT,FollowUpSystemPrompt, GradioFollowUpSystemPrompt,TransformersJSFollowUpSystemPrompt)from .docs_manager import get_comfyui_system_prompt, update_gradio_system_promptsdef check_authentication(profile: Optional[gr.OAuthProfile] = None, token: Optional[gr.OAuthToken] = None) -> Tuple[bool, str]:174 unmodified lineselse:session_id = str(uuid.uuid4())# Update Gradio system prompts if neededif language == "gradio":update_gradio_system_prompts()# Choose system prompt based on context# Special case: If user is asking about model identity, use neutral prompt19 unmodified lineselif language == "react":system_prompt = REACT_SYSTEM_PROMPTelif language == "gradio":system_prompt = GRADIO_SYSTEM_PROMPTelif language == "streamlit":system_prompt = STREAMLIT_SYSTEM_PROMPTelif language == "json":system_prompt = JSON_SYSTEM_PROMPTelif language == "comfyui":system_prompt = get_comfyui_system_prompt()else:35 unmodified lines363738394041424344454647484950515253174 unmodified lines22822923023123223323423523623723819 unmodified lines25825926026126226326426526626726826927035 unmodified lineshistory_to_chatbot_messages, strip_placeholder_thinking,is_placeholder_thinking_only, extract_last_thinking_line)from . import promptsfrom .prompts import (HTML_SYSTEM_PROMPT,TRANSFORMERS_JS_SYSTEM_PROMPT, STREAMLIT_SYSTEM_PROMPT,REACT_SYSTEM_PROMPT, REACT_FOLLOW_UP_SYSTEM_PROMPT,JSON_SYSTEM_PROMPT,GENERIC_SYSTEM_PROMPT, MULTIPAGE_HTML_SYSTEM_PROMPT,DYNAMIC_MULTIPAGE_HTML_SYSTEM_PROMPT,FollowUpSystemPrompt, GradioFollowUpSystemPrompt,TransformersJSFollowUpSystemPrompt)from .docs_manager import get_comfyui_system_prompt, update_gradio_system_prompts, update_json_system_promptsdef check_authentication(profile: Optional[gr.OAuthProfile] = None, token: Optional[gr.OAuthToken] = None) -> Tuple[bool, str]:174 unmodified lineselse:session_id = str(uuid.uuid4())# Update system prompts if neededif language == "gradio":update_gradio_system_prompts()elif language == "json":update_json_system_prompts()# Choose system prompt based on context# Special case: If user is asking about model identity, use neutral prompt19 unmodified lineselif language == "react":system_prompt = REACT_SYSTEM_PROMPTelif language == "gradio":# Access GRADIO_SYSTEM_PROMPT from prompts module to get updated valuesystem_prompt = prompts.GRADIO_SYSTEM_PROMPTelif language == "streamlit":system_prompt = STREAMLIT_SYSTEM_PROMPTelif language == "json":# Access JSON_SYSTEM_PROMPT from prompts module to get updated valuesystem_prompt = prompts.JSON_SYSTEM_PROMPTelif language == "comfyui":system_prompt = get_comfyui_system_prompt()else:
anycoder_app/deploy.py+10-5