Fix: Parameter Extractor Uses Correct Prompt for Prompt Mode in Chat Models (#24636)

Co-authored-by: -LAN- <laipz8200@outlook.com>
This commit is contained in:
Ding
2025-09-08 10:29:12 +08:00
committed by GitHub
parent 3d16767fb3
commit ce2281d31b

View File

@@ -52,6 +52,7 @@ from .exc import (
)
from .prompts import (
CHAT_EXAMPLE,
CHAT_GENERATE_JSON_PROMPT,
CHAT_GENERATE_JSON_USER_MESSAGE_TEMPLATE,
COMPLETION_GENERATE_JSON_PROMPT,
FUNCTION_CALLING_EXTRACTOR_EXAMPLE,
@@ -752,7 +753,7 @@ class ParameterExtractorNode(BaseNode):
if model_mode == ModelMode.CHAT:
system_prompt_messages = ChatModelMessage(
role=PromptMessageRole.SYSTEM,
text=FUNCTION_CALLING_EXTRACTOR_SYSTEM_PROMPT.format(histories=memory_str, instruction=instruction),
text=CHAT_GENERATE_JSON_PROMPT.format(histories=memory_str).replace("{{instructions}}", instruction),
)
user_prompt_message = ChatModelMessage(role=PromptMessageRole.USER, text=input_text)
return [system_prompt_messages, user_prompt_message]