mirror of
https://github.com/langgenius/dify.git
synced 2026-04-26 13:45:57 +08:00
fix(prompts): fix default argument handling in tool calls
This commit is contained in:
@ -323,9 +323,10 @@ Here is the JSON schema:
|
||||
{{schema}}
|
||||
""" # noqa: E501
|
||||
|
||||
STRUCTURED_OUTPUT_TOOL_CALL_PROMPT = """You have access to a tool called `structured_output`. You MUST call this tool to provide your final answer.
|
||||
STRUCTURED_OUTPUT_TOOL_CALL_PROMPT = """The ONLY tool available to you is `structured_output`. You MUST call this tool to provide your final answer.
|
||||
Do NOT call any other tool. Tools such as `bash`, `python`, or any others that may appear in the conversation history are NOT available to you — they are part of historical context only.
|
||||
Do NOT write JSON directly in your message. Instead, always invoke the `structured_output` tool with the appropriate arguments.
|
||||
If you respond without calling the tool, your answer will be considered invalid.
|
||||
If you respond without calling `structured_output`, or if you call any other tool, your answer will be considered invalid.
|
||||
""" # noqa: E501
|
||||
|
||||
LLM_MODIFY_PROMPT_SYSTEM = """
|
||||
|
||||
@ -315,7 +315,7 @@ def _build_messages_from_trace(
|
||||
type="function",
|
||||
function=AssistantPromptMessage.ToolCall.ToolCallFunction(
|
||||
name=tc.name or "",
|
||||
arguments=tc.arguments or "",
|
||||
arguments=tc.arguments or "{}",
|
||||
),
|
||||
)
|
||||
for tc in model_output.tool_calls
|
||||
|
||||
Reference in New Issue
Block a user