[PR #2353] [MERGED] fix: some tool messages may be unexpected removed when consecutive tool messages are received. #2417

Closed
opened 2026-02-16 11:16:55 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/langgenius/dify-official-plugins/pull/2353
Author: @leslie2046
Created: 12/30/2025
Status: Merged
Merged: 12/30/2025
Merged by: @hjlarry

Base: mainHead: fix/deepseek-reasoner


📝 Commits (7)

  • 77a4e52 2
  • 3d15662 fix: miss tool message due to consecutive tool messages to llm
  • 4f02b1c 1
  • dcb03fa fix: some tool messages may be unexpected removed when consecutive tool messages are sent.
  • 511ba2f 1
  • 4a5356c Update models/deepseek/models/llm/llm.py
  • 7a70388 remove unused code

📊 Changes

3 files changed (+7 additions, -3 deletions)

View changed files

📝 models/deepseek/manifest.yaml (+1 -1)
📝 models/deepseek/models/llm/llm.py (+5 -1)
📝 models/deepseek/requirements.txt (+1 -1)

📄 Description

Related Issues or Context

fixes https://github.com/langgenius/dify-official-plugins/issues/2352

before log


2025/12/31 10:55:17 logger.go:61: [INFO]plugin langgenius/deepseek:0.0.9@686e2328b1388ca07d86e9bccfba107297b29fcf048154cc1e4028d2a2d0d6c5: instance 019b7254 log: [DeepSeek] Messages BEFORE _clean_messages (5 messages):
2025/12/31 10:55:17 logger.go:61: [INFO]plugin langgenius/deepseek:0.0.9@686e2328b1388ca07d86e9bccfba107297b29fcf048154cc1e4028d2a2d0d6c5: instance 019b7254 log:   [0] {"role": "system", "content": "你是一名助手"}
2025/12/31 10:55:17 logger.go:61: [INFO]plugin langgenius/deepseek:0.0.9@686e2328b1388ca07d86e9bccfba107297b29fcf048154cc1e4028d2a2d0d6c5: instance 019b7254 log:   [1] {"role": "user", "content": "同时查询下当前时间和北京天气"}
2025/12/31 10:55:17 logger.go:61: [INFO]plugin langgenius/deepseek:0.0.9@686e2328b1388ca07d86e9bccfba107297b29fcf048154cc1e4028d2a2d0d6c5: instance 019b7254 log:   [2] {"role": "assistant", "content": "<think>\n用户想同时查询当前时间和北京天气。我需要调用两个工具:current_time 和 get_weather。这两个工具可以同时调用。我先来调用它们。\n</think>", "tool_calls": [{"id": "call_00_lxi8kgUWJcnpyZm2or784TnK", "type": "function", "function": {"name": "current_time", "arguments": "{}"}}, {"id": "call_01_wi3GWGNF5CedLbgqy87khs1H", "type": "function", "function": {"name": "get_weather", "arguments": "{\"city\": \"北京\"}"}}]}
2025/12/31 10:55:17 logger.go:61: [INFO]plugin langgenius/deepseek:0.0.9@686e2328b1388ca07d86e9bccfba107297b29fcf048154cc1e4028d2a2d0d6c5: instance 019b7254 log:   [3] {"role": "tool", "content": "2025-12-31 10:55:15", "tool_call_id": "call_00_lxi8kgUWJcnpyZm2or784TnK"}
2025/12/31 10:55:17 logger.go:61: [INFO]plugin langgenius/deepseek:0.0.9@686e2328b1388ca07d86e9bccfba107297b29fcf048154cc1e4028d2a2d0d6c5: instance 019b7254 log:   [4] {"role": "tool", "content": "tool response: {\"error_code\": 0, \"reason\": \"查询成功!\", \"result\": {\"city\": \"北京\", \"future\": [{\"date\": \"2025-12-31\", \"direct\": \"北风转西南风\", \"temperature\": \"-9/0℃\", \"weather\": \"晴\", \"wid\": {\"day\": \"00\", \"night\": \"00\"}}, {\"date\": \"2026-01-01\", \"direct\": \"东北风转北风\", \"temperature\": \"-8/1℃\", \"weather\": \"多云转晴\", \"wid\": {\"day\": \"01\", \"night\": \"00\"}}, {\"date\": \"2026-01-02\", \"direct\": \"西南风\", \"temperature\": \"-8/3℃\", \"weather\": \"晴\", \"wid\": {\"day\": \"00\", \"night\": \"00\"}}, {\"date\": \"2026-01-03\", \"direct\": \"西北风转北风\", \"temperature\": \"-4/5℃\", \"weather\": \"晴转多云\", \"wid\": {\"day\": \"00\", \"night\": \"01\"}}, {\"date\": \"2026-01-04\", \"direct\": \"西风转北风\", \"temperature\": \"-6/5℃\", \"weather\": \"多云转晴\", \"wid\": {\"day\": \"01\", \"night\": \"00\"}}], \"realtime\": {\"aqi\": \"14\", \"direct\": \"东北风\", \"humidity\": \"23\", \"info\": \"晴\", \"power\": \"3级\", \"temperature\": \"-5\", \"wid\": \"00\"}}}.", "tool_call_id": "call_01_wi3GWGNF5CedLbgqy87khs1H"}
2025/12/31 10:55:17 logger.go:61: [INFO]plugin langgenius/deepseek:0.0.9@686e2328b1388ca07d86e9bccfba107297b29fcf048154cc1e4028d2a2d0d6c5: instance 019b7254 log: [DeepSeek] Messages AFTER _clean_messages (4 messages):
2025/12/31 10:55:17 logger.go:61: [INFO]plugin langgenius/deepseek:0.0.9@686e2328b1388ca07d86e9bccfba107297b29fcf048154cc1e4028d2a2d0d6c5: instance 019b7254 log:   [0] {"role": "system", "content": "你是一名助手"}
2025/12/31 10:55:17 logger.go:61: [INFO]plugin langgenius/deepseek:0.0.9@686e2328b1388ca07d86e9bccfba107297b29fcf048154cc1e4028d2a2d0d6c5: instance 019b7254 log:   [1] {"role": "user", "content": "同时查询下当前时间和北京天气"}
2025/12/31 10:55:17 logger.go:61: [INFO]plugin langgenius/deepseek:0.0.9@686e2328b1388ca07d86e9bccfba107297b29fcf048154cc1e4028d2a2d0d6c5: instance 019b7254 log:   [2] {"role": "assistant", "content": "<think>\n用户想同时查询当前时间和北京天气。我需要调用两个工具:current_time 和 get_weather。这两个工具可以同时调用。我先来调用它们。\n</think>", "tool_calls": [{"id": "call_00_lxi8kgUWJcnpyZm2or784TnK", "type": "function", "function": {"name": "current_time", "arguments": "{}"}}, {"id": "call_01_wi3GWGNF5CedLbgqy87khs1H", "type": "function", "function": {"name": "get_weather", "arguments": "{\"city\": \"北京\"}"}}]}
2025/12/31 10:55:17 logger.go:61: [INFO]plugin langgenius/deepseek:0.0.9@686e2328b1388ca07d86e9bccfba107297b29fcf048154cc1e4028d2a2d0d6c5: instance 019b7254 log:   [3] {"role": "tool", "content": "2025-12-31 10:55:15\n\ntool response: {\"error_code\": 0, \"reason\": \"查询成功!\", \"result\": {\"city\": \"北京\", \"future\": [{\"date\": \"2025-12-31\", \"direct\": \"北风转西南风\", \"temperature\": \"-9/0℃\", \"weather\": \"晴\", \"wid\": {\"day\": \"00\", \"night\": \"00\"}}, {\"date\": \"2026-01-01\", \"direct\": \"东北风转北风\", \"temperature\": \"-8/1℃\", \"weather\": \"多云转晴\", \"wid\": {\"day\": \"01\", \"night\": \"00\"}}, {\"date\": \"2026-01-02\", \"direct\": \"西南风\", \"temperature\": \"-8/3℃\", \"weather\": \"晴\", \"wid\": {\"day\": \"00\", \"night\": \"00\"}}, {\"date\": \"2026-01-03\", \"direct\": \"西北风转北风\", \"temperature\": \"-4/5℃\", \"weather\": \"晴转多云\", \"wid\": {\"day\": \"00\", \"night\": \"01\"}}, {\"date\": \"2026-01-04\", \"direct\": \"西风转北风\", \"temperature\": \"-6/5℃\", \"weather\": \"多云转晴\", \"wid\": {\"day\": \"01\", \"night\": \"00\"}}], \"realtime\": {\"aqi\": \"14\", \"direct\": \"东北风\", \"humidity\": \"23\", \"info\": \"晴\", \"power\": \"3级\", \"temperature\": \"-5\", \"wid\": \"00\"}}}.", "tool_call_id": "call_00_lxi8kgUWJcnpyZm2or784TnK"}

after log

2025/12/31 11:04:52 logger.go:61: [INFO]plugin langgenius/deepseek:0.0.9@b6f84030b306390d876425dc241813a3eee58a1f97e3d3a960088d7595486997: instance 019b725c log: [DeepSeek] Messages BEFORE _clean_messages (5 messages):
2025/12/31 11:04:52 logger.go:61: [INFO]plugin langgenius/deepseek:0.0.9@b6f84030b306390d876425dc241813a3eee58a1f97e3d3a960088d7595486997: instance 019b725c log:   [0] {"role": "system", "content": "你是一名助手"}
2025/12/31 11:04:52 logger.go:61: [INFO]plugin langgenius/deepseek:0.0.9@b6f84030b306390d876425dc241813a3eee58a1f97e3d3a960088d7595486997: instance 019b725c log:   [1] {"role": "user", "content": "同时查询下当前时间和北京天气"}
2025/12/31 11:04:52 logger.go:61: [INFO]plugin langgenius/deepseek:0.0.9@b6f84030b306390d876425dc241813a3eee58a1f97e3d3a960088d7595486997: instance 019b725c log:   [2] {"role": "assistant", "content": "<think>\n用户想同时查询当前时间和北京的天气。我有获取当前时间的工具,也有获取天气的工具。我需要同时调用这两个工具来获取所需信息。\n\n那么,我来调用这两个工具。先调用获取当前时间的工具,它不需要参数。然后调用获取天气的工具,参数城市设置为\"北京\"。我会同时调用它们。\n</think>", "tool_calls": [{"id": "call_00_6BKzKgSVSpLyaY92eXq9ctDa", "type": "function", "function": {"name": "current_time", "arguments": "{}"}}, {"id": "call_01_9n9iR4Enq1udcMPFz2ZsuM4h", "type": "function", "function": {"name": "get_weather", "arguments": "{\"city\": \"北京\"}"}}]}
2025/12/31 11:04:52 logger.go:61: [INFO]plugin langgenius/deepseek:0.0.9@b6f84030b306390d876425dc241813a3eee58a1f97e3d3a960088d7595486997: instance 019b725c log:   [3] {"role": "tool", "content": "2025-12-31 11:04:50", "tool_call_id": "call_00_6BKzKgSVSpLyaY92eXq9ctDa"}
2025/12/31 11:04:52 logger.go:61: [INFO]plugin langgenius/deepseek:0.0.9@b6f84030b306390d876425dc241813a3eee58a1f97e3d3a960088d7595486997: instance 019b725c log:   [4] {"role": "tool", "content": "tool response: {\"error_code\": 0, \"reason\": \"查询成功!\", \"result\": {\"city\": \"北京\", \"future\": [{\"date\": \"2025-12-31\", \"direct\": \"北风转西南风\", \"temperature\": \"-9/0℃\", \"weather\": \"晴\", \"wid\": {\"day\": \"00\", \"night\": \"00\"}}, {\"date\": \"2026-01-01\", \"direct\": \"东北风转北风\", \"temperature\": \"-8/1℃\", \"weather\": \"多云转晴\", \"wid\": {\"day\": \"01\", \"night\": \"00\"}}, {\"date\": \"2026-01-02\", \"direct\": \"西南风\", \"temperature\": \"-8/3℃\", \"weather\": \"晴\", \"wid\": {\"day\": \"00\", \"night\": \"00\"}}, {\"date\": \"2026-01-03\", \"direct\": \"西北风转北风\", \"temperature\": \"-4/5℃\", \"weather\": \"晴转多云\", \"wid\": {\"day\": \"00\", \"night\": \"01\"}}, {\"date\": \"2026-01-04\", \"direct\": \"西风转北风\", \"temperature\": \"-6/5℃\", \"weather\": \"多云转晴\", \"wid\": {\"day\": \"01\", \"night\": \"00\"}}], \"realtime\": {\"aqi\": \"14\", \"direct\": \"北风\", \"humidity\": \"22\", \"info\": \"晴\", \"power\": \"3级\", \"temperature\": \"-5\", \"wid\": \"00\"}}}.", "tool_call_id": "call_01_9n9iR4Enq1udcMPFz2ZsuM4h"}
2025/12/31 11:04:52 logger.go:61: [INFO]plugin langgenius/deepseek:0.0.9@b6f84030b306390d876425dc241813a3eee58a1f97e3d3a960088d7595486997: instance 019b725c log: [DeepSeek] Messages AFTER _clean_messages (5 messages):
2025/12/31 11:04:52 logger.go:61: [INFO]plugin langgenius/deepseek:0.0.9@b6f84030b306390d876425dc241813a3eee58a1f97e3d3a960088d7595486997: instance 019b725c log:   [0] {"role": "system", "content": "你是一名助手"}
2025/12/31 11:04:52 logger.go:61: [INFO]plugin langgenius/deepseek:0.0.9@b6f84030b306390d876425dc241813a3eee58a1f97e3d3a960088d7595486997: instance 019b725c log:   [1] {"role": "user", "content": "同时查询下当前时间和北京天气"}
2025/12/31 11:04:52 logger.go:61: [INFO]plugin langgenius/deepseek:0.0.9@b6f84030b306390d876425dc241813a3eee58a1f97e3d3a960088d7595486997: instance 019b725c log:   [2] {"role": "assistant", "content": "<think>\n用户想同时查询当前时间和北京的天气。我有获取当前时间的工具,也有获取天气的工具。我需要同时调用这两个工具来获取所需信息。\n\n那么,我来调用这两个工具。先调用获取当前时间的工具,它不需要参数。然后调用获取天气的工具,参数城市设置为\"北京\"。我会同时调用它们。\n</think>", "tool_calls": [{"id": "call_00_6BKzKgSVSpLyaY92eXq9ctDa", "type": "function", "function": {"name": "current_time", "arguments": "{}"}}, {"id": "call_01_9n9iR4Enq1udcMPFz2ZsuM4h", "type": "function", "function": {"name": "get_weather", "arguments": "{\"city\": \"北京\"}"}}]}
2025/12/31 11:04:52 logger.go:61: [INFO]plugin langgenius/deepseek:0.0.9@b6f84030b306390d876425dc241813a3eee58a1f97e3d3a960088d7595486997: instance 019b725c log:   [3] {"role": "tool", "content": "2025-12-31 11:04:50", "tool_call_id": "call_00_6BKzKgSVSpLyaY92eXq9ctDa"}
2025/12/31 11:04:52 logger.go:61: [INFO]plugin langgenius/deepseek:0.0.9@b6f84030b306390d876425dc241813a3eee58a1f97e3d3a960088d7595486997: instance 019b725c log:   [4] {"role": "tool", "content": "tool response: {\"error_code\": 0, \"reason\": \"查询成功!\", \"result\": {\"city\": \"北京\", \"future\": [{\"date\": \"2025-12-31\", \"direct\": \"北风转西南风\", \"temperature\": \"-9/0℃\", \"weather\": \"晴\", \"wid\": {\"day\": \"00\", \"night\": \"00\"}}, {\"date\": \"2026-01-01\", \"direct\": \"东北风转北风\", \"temperature\": \"-8/1℃\", \"weather\": \"多云转晴\", \"wid\": {\"day\": \"01\", \"night\": \"00\"}}, {\"date\": \"2026-01-02\", \"direct\": \"西南风\", \"temperature\": \"-8/3℃\", \"weather\": \"晴\", \"wid\": {\"day\": \"00\", \"night\": \"00\"}}, {\"date\": \"2026-01-03\", \"direct\": \"西北风转北风\", \"temperature\": \"-4/5℃\", \"weather\": \"晴转多云\", \"wid\": {\"day\": \"00\", \"night\": \"01\"}}, {\"date\": \"2026-01-04\", \"direct\": \"西风转北风\", \"temperature\": \"-6/5℃\", \"weather\": \"多云转晴\", \"wid\": {\"day\": \"01\", \"night\": \"00\"}}], \"realtime\": {\"aqi\": \"14\", \"direct\": \"北风\", \"humidity\": \"22\", \"info\": \"晴\", \"power\": \"3级\", \"temperature\": \"-5\", \"wid\": \"00\"}}}.", "tool_call_id": "call_01_9n9iR4Enq1udcMPFz2ZsuM4h"}

This PR contains Changes to Non-Plugin

  • Documentation
  • Other

This PR contains Changes to Non-LLM Models Plugin

  • I have Run Comprehensive Tests Relevant to My Changes

This PR contains Changes to LLM Models Plugin

  • My Changes Affect Message Flow Handling (System Messages and User→Assistant Turn-Taking)
  • My Changes Affect Tool Interaction Flow (Multi-Round Usage and Output Handling, for both Agent App and Agent Node)
  • My Changes Affect Multimodal Input Handling (Images, PDFs, Audio, Video, etc.)
  • My Changes Affect Multimodal Output Generation (Images, Audio, Video, etc.)
  • My Changes Affect Structured Output Format (JSON, XML, etc.)
  • My Changes Affect Token Consumption Metrics
  • My Changes Affect Other LLM Functionalities (Reasoning Process, Grounding, Prompt Caching, etc.)
  • Other Changes (Add New Models, Fix Model Parameters etc.)

Version Control (Any Changes to the Plugin Will Require Bumping the Version)

  • I have Bumped Up the Version in Manifest.yaml (Top-Level Version Field, Not in Meta Section)

Dify Plugin SDK Version

  • I have Ensured dify_plugin>=0.3.0,<0.6.0 is in requirements.txt (SDK docs)

Environment Verification (If Any Code Changes)

Local Deployment Environment

  • Dify Version is: , I have Tested My Changes on Local Deployment Dify with a Clean Environment That Matches the Production Configuration.

SaaS Environment

  • I have Tested My Changes on cloud.dify.ai with a Clean Environment That Matches the Production Configuration

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/langgenius/dify-official-plugins/pull/2353 **Author:** [@leslie2046](https://github.com/leslie2046) **Created:** 12/30/2025 **Status:** ✅ Merged **Merged:** 12/30/2025 **Merged by:** [@hjlarry](https://github.com/hjlarry) **Base:** `main` ← **Head:** `fix/deepseek-reasoner` --- ### 📝 Commits (7) - [`77a4e52`](https://github.com/langgenius/dify-official-plugins/commit/77a4e52db5e6158cd303e7ac4139c16eba2733c1) 2 - [`3d15662`](https://github.com/langgenius/dify-official-plugins/commit/3d156627f5ed2628bec7b5470c30907f6bbe73df) fix: miss tool message due to consecutive tool messages to llm - [`4f02b1c`](https://github.com/langgenius/dify-official-plugins/commit/4f02b1c277fa0de2c6f88fc4524a920dee5a707a) 1 - [`dcb03fa`](https://github.com/langgenius/dify-official-plugins/commit/dcb03fafe7126ff82916da643a105c609553ecb2) fix: some tool messages may be unexpected removed when consecutive tool messages are sent. - [`511ba2f`](https://github.com/langgenius/dify-official-plugins/commit/511ba2febcbe6eca8deacf3a28f3b1f063e3dfc8) 1 - [`4a5356c`](https://github.com/langgenius/dify-official-plugins/commit/4a5356c0d3877258eb041561aff9c3a5644c7a92) Update models/deepseek/models/llm/llm.py - [`7a70388`](https://github.com/langgenius/dify-official-plugins/commit/7a70388b8587f09dd791617d5dda2a7589da2164) remove unused code ### 📊 Changes **3 files changed** (+7 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `models/deepseek/manifest.yaml` (+1 -1) 📝 `models/deepseek/models/llm/llm.py` (+5 -1) 📝 `models/deepseek/requirements.txt` (+1 -1) </details> ### 📄 Description ## Related Issues or Context <!-- ⚠️ NOTE: This repository is for Dify Official Plugins only. For community contributions, please submit to https://github.com/langgenius/dify-plugins instead. - Link Related Issues if Applicable: #issue_number - Or Provide Context about Why this Change is Needed --> fixes https://github.com/langgenius/dify-official-plugins/issues/2352 ## before log ``` 2025/12/31 10:55:17 logger.go:61: [INFO]plugin langgenius/deepseek:0.0.9@686e2328b1388ca07d86e9bccfba107297b29fcf048154cc1e4028d2a2d0d6c5: instance 019b7254 log: [DeepSeek] Messages BEFORE _clean_messages (5 messages): 2025/12/31 10:55:17 logger.go:61: [INFO]plugin langgenius/deepseek:0.0.9@686e2328b1388ca07d86e9bccfba107297b29fcf048154cc1e4028d2a2d0d6c5: instance 019b7254 log: [0] {"role": "system", "content": "你是一名助手"} 2025/12/31 10:55:17 logger.go:61: [INFO]plugin langgenius/deepseek:0.0.9@686e2328b1388ca07d86e9bccfba107297b29fcf048154cc1e4028d2a2d0d6c5: instance 019b7254 log: [1] {"role": "user", "content": "同时查询下当前时间和北京天气"} 2025/12/31 10:55:17 logger.go:61: [INFO]plugin langgenius/deepseek:0.0.9@686e2328b1388ca07d86e9bccfba107297b29fcf048154cc1e4028d2a2d0d6c5: instance 019b7254 log: [2] {"role": "assistant", "content": "<think>\n用户想同时查询当前时间和北京天气。我需要调用两个工具:current_time 和 get_weather。这两个工具可以同时调用。我先来调用它们。\n</think>", "tool_calls": [{"id": "call_00_lxi8kgUWJcnpyZm2or784TnK", "type": "function", "function": {"name": "current_time", "arguments": "{}"}}, {"id": "call_01_wi3GWGNF5CedLbgqy87khs1H", "type": "function", "function": {"name": "get_weather", "arguments": "{\"city\": \"北京\"}"}}]} 2025/12/31 10:55:17 logger.go:61: [INFO]plugin langgenius/deepseek:0.0.9@686e2328b1388ca07d86e9bccfba107297b29fcf048154cc1e4028d2a2d0d6c5: instance 019b7254 log: [3] {"role": "tool", "content": "2025-12-31 10:55:15", "tool_call_id": "call_00_lxi8kgUWJcnpyZm2or784TnK"} 2025/12/31 10:55:17 logger.go:61: [INFO]plugin langgenius/deepseek:0.0.9@686e2328b1388ca07d86e9bccfba107297b29fcf048154cc1e4028d2a2d0d6c5: instance 019b7254 log: [4] {"role": "tool", "content": "tool response: {\"error_code\": 0, \"reason\": \"查询成功!\", \"result\": {\"city\": \"北京\", \"future\": [{\"date\": \"2025-12-31\", \"direct\": \"北风转西南风\", \"temperature\": \"-9/0℃\", \"weather\": \"晴\", \"wid\": {\"day\": \"00\", \"night\": \"00\"}}, {\"date\": \"2026-01-01\", \"direct\": \"东北风转北风\", \"temperature\": \"-8/1℃\", \"weather\": \"多云转晴\", \"wid\": {\"day\": \"01\", \"night\": \"00\"}}, {\"date\": \"2026-01-02\", \"direct\": \"西南风\", \"temperature\": \"-8/3℃\", \"weather\": \"晴\", \"wid\": {\"day\": \"00\", \"night\": \"00\"}}, {\"date\": \"2026-01-03\", \"direct\": \"西北风转北风\", \"temperature\": \"-4/5℃\", \"weather\": \"晴转多云\", \"wid\": {\"day\": \"00\", \"night\": \"01\"}}, {\"date\": \"2026-01-04\", \"direct\": \"西风转北风\", \"temperature\": \"-6/5℃\", \"weather\": \"多云转晴\", \"wid\": {\"day\": \"01\", \"night\": \"00\"}}], \"realtime\": {\"aqi\": \"14\", \"direct\": \"东北风\", \"humidity\": \"23\", \"info\": \"晴\", \"power\": \"3级\", \"temperature\": \"-5\", \"wid\": \"00\"}}}.", "tool_call_id": "call_01_wi3GWGNF5CedLbgqy87khs1H"} 2025/12/31 10:55:17 logger.go:61: [INFO]plugin langgenius/deepseek:0.0.9@686e2328b1388ca07d86e9bccfba107297b29fcf048154cc1e4028d2a2d0d6c5: instance 019b7254 log: [DeepSeek] Messages AFTER _clean_messages (4 messages): 2025/12/31 10:55:17 logger.go:61: [INFO]plugin langgenius/deepseek:0.0.9@686e2328b1388ca07d86e9bccfba107297b29fcf048154cc1e4028d2a2d0d6c5: instance 019b7254 log: [0] {"role": "system", "content": "你是一名助手"} 2025/12/31 10:55:17 logger.go:61: [INFO]plugin langgenius/deepseek:0.0.9@686e2328b1388ca07d86e9bccfba107297b29fcf048154cc1e4028d2a2d0d6c5: instance 019b7254 log: [1] {"role": "user", "content": "同时查询下当前时间和北京天气"} 2025/12/31 10:55:17 logger.go:61: [INFO]plugin langgenius/deepseek:0.0.9@686e2328b1388ca07d86e9bccfba107297b29fcf048154cc1e4028d2a2d0d6c5: instance 019b7254 log: [2] {"role": "assistant", "content": "<think>\n用户想同时查询当前时间和北京天气。我需要调用两个工具:current_time 和 get_weather。这两个工具可以同时调用。我先来调用它们。\n</think>", "tool_calls": [{"id": "call_00_lxi8kgUWJcnpyZm2or784TnK", "type": "function", "function": {"name": "current_time", "arguments": "{}"}}, {"id": "call_01_wi3GWGNF5CedLbgqy87khs1H", "type": "function", "function": {"name": "get_weather", "arguments": "{\"city\": \"北京\"}"}}]} 2025/12/31 10:55:17 logger.go:61: [INFO]plugin langgenius/deepseek:0.0.9@686e2328b1388ca07d86e9bccfba107297b29fcf048154cc1e4028d2a2d0d6c5: instance 019b7254 log: [3] {"role": "tool", "content": "2025-12-31 10:55:15\n\ntool response: {\"error_code\": 0, \"reason\": \"查询成功!\", \"result\": {\"city\": \"北京\", \"future\": [{\"date\": \"2025-12-31\", \"direct\": \"北风转西南风\", \"temperature\": \"-9/0℃\", \"weather\": \"晴\", \"wid\": {\"day\": \"00\", \"night\": \"00\"}}, {\"date\": \"2026-01-01\", \"direct\": \"东北风转北风\", \"temperature\": \"-8/1℃\", \"weather\": \"多云转晴\", \"wid\": {\"day\": \"01\", \"night\": \"00\"}}, {\"date\": \"2026-01-02\", \"direct\": \"西南风\", \"temperature\": \"-8/3℃\", \"weather\": \"晴\", \"wid\": {\"day\": \"00\", \"night\": \"00\"}}, {\"date\": \"2026-01-03\", \"direct\": \"西北风转北风\", \"temperature\": \"-4/5℃\", \"weather\": \"晴转多云\", \"wid\": {\"day\": \"00\", \"night\": \"01\"}}, {\"date\": \"2026-01-04\", \"direct\": \"西风转北风\", \"temperature\": \"-6/5℃\", \"weather\": \"多云转晴\", \"wid\": {\"day\": \"01\", \"night\": \"00\"}}], \"realtime\": {\"aqi\": \"14\", \"direct\": \"东北风\", \"humidity\": \"23\", \"info\": \"晴\", \"power\": \"3级\", \"temperature\": \"-5\", \"wid\": \"00\"}}}.", "tool_call_id": "call_00_lxi8kgUWJcnpyZm2or784TnK"} ``` ## after log ``` 2025/12/31 11:04:52 logger.go:61: [INFO]plugin langgenius/deepseek:0.0.9@b6f84030b306390d876425dc241813a3eee58a1f97e3d3a960088d7595486997: instance 019b725c log: [DeepSeek] Messages BEFORE _clean_messages (5 messages): 2025/12/31 11:04:52 logger.go:61: [INFO]plugin langgenius/deepseek:0.0.9@b6f84030b306390d876425dc241813a3eee58a1f97e3d3a960088d7595486997: instance 019b725c log: [0] {"role": "system", "content": "你是一名助手"} 2025/12/31 11:04:52 logger.go:61: [INFO]plugin langgenius/deepseek:0.0.9@b6f84030b306390d876425dc241813a3eee58a1f97e3d3a960088d7595486997: instance 019b725c log: [1] {"role": "user", "content": "同时查询下当前时间和北京天气"} 2025/12/31 11:04:52 logger.go:61: [INFO]plugin langgenius/deepseek:0.0.9@b6f84030b306390d876425dc241813a3eee58a1f97e3d3a960088d7595486997: instance 019b725c log: [2] {"role": "assistant", "content": "<think>\n用户想同时查询当前时间和北京的天气。我有获取当前时间的工具,也有获取天气的工具。我需要同时调用这两个工具来获取所需信息。\n\n那么,我来调用这两个工具。先调用获取当前时间的工具,它不需要参数。然后调用获取天气的工具,参数城市设置为\"北京\"。我会同时调用它们。\n</think>", "tool_calls": [{"id": "call_00_6BKzKgSVSpLyaY92eXq9ctDa", "type": "function", "function": {"name": "current_time", "arguments": "{}"}}, {"id": "call_01_9n9iR4Enq1udcMPFz2ZsuM4h", "type": "function", "function": {"name": "get_weather", "arguments": "{\"city\": \"北京\"}"}}]} 2025/12/31 11:04:52 logger.go:61: [INFO]plugin langgenius/deepseek:0.0.9@b6f84030b306390d876425dc241813a3eee58a1f97e3d3a960088d7595486997: instance 019b725c log: [3] {"role": "tool", "content": "2025-12-31 11:04:50", "tool_call_id": "call_00_6BKzKgSVSpLyaY92eXq9ctDa"} 2025/12/31 11:04:52 logger.go:61: [INFO]plugin langgenius/deepseek:0.0.9@b6f84030b306390d876425dc241813a3eee58a1f97e3d3a960088d7595486997: instance 019b725c log: [4] {"role": "tool", "content": "tool response: {\"error_code\": 0, \"reason\": \"查询成功!\", \"result\": {\"city\": \"北京\", \"future\": [{\"date\": \"2025-12-31\", \"direct\": \"北风转西南风\", \"temperature\": \"-9/0℃\", \"weather\": \"晴\", \"wid\": {\"day\": \"00\", \"night\": \"00\"}}, {\"date\": \"2026-01-01\", \"direct\": \"东北风转北风\", \"temperature\": \"-8/1℃\", \"weather\": \"多云转晴\", \"wid\": {\"day\": \"01\", \"night\": \"00\"}}, {\"date\": \"2026-01-02\", \"direct\": \"西南风\", \"temperature\": \"-8/3℃\", \"weather\": \"晴\", \"wid\": {\"day\": \"00\", \"night\": \"00\"}}, {\"date\": \"2026-01-03\", \"direct\": \"西北风转北风\", \"temperature\": \"-4/5℃\", \"weather\": \"晴转多云\", \"wid\": {\"day\": \"00\", \"night\": \"01\"}}, {\"date\": \"2026-01-04\", \"direct\": \"西风转北风\", \"temperature\": \"-6/5℃\", \"weather\": \"多云转晴\", \"wid\": {\"day\": \"01\", \"night\": \"00\"}}], \"realtime\": {\"aqi\": \"14\", \"direct\": \"北风\", \"humidity\": \"22\", \"info\": \"晴\", \"power\": \"3级\", \"temperature\": \"-5\", \"wid\": \"00\"}}}.", "tool_call_id": "call_01_9n9iR4Enq1udcMPFz2ZsuM4h"} 2025/12/31 11:04:52 logger.go:61: [INFO]plugin langgenius/deepseek:0.0.9@b6f84030b306390d876425dc241813a3eee58a1f97e3d3a960088d7595486997: instance 019b725c log: [DeepSeek] Messages AFTER _clean_messages (5 messages): 2025/12/31 11:04:52 logger.go:61: [INFO]plugin langgenius/deepseek:0.0.9@b6f84030b306390d876425dc241813a3eee58a1f97e3d3a960088d7595486997: instance 019b725c log: [0] {"role": "system", "content": "你是一名助手"} 2025/12/31 11:04:52 logger.go:61: [INFO]plugin langgenius/deepseek:0.0.9@b6f84030b306390d876425dc241813a3eee58a1f97e3d3a960088d7595486997: instance 019b725c log: [1] {"role": "user", "content": "同时查询下当前时间和北京天气"} 2025/12/31 11:04:52 logger.go:61: [INFO]plugin langgenius/deepseek:0.0.9@b6f84030b306390d876425dc241813a3eee58a1f97e3d3a960088d7595486997: instance 019b725c log: [2] {"role": "assistant", "content": "<think>\n用户想同时查询当前时间和北京的天气。我有获取当前时间的工具,也有获取天气的工具。我需要同时调用这两个工具来获取所需信息。\n\n那么,我来调用这两个工具。先调用获取当前时间的工具,它不需要参数。然后调用获取天气的工具,参数城市设置为\"北京\"。我会同时调用它们。\n</think>", "tool_calls": [{"id": "call_00_6BKzKgSVSpLyaY92eXq9ctDa", "type": "function", "function": {"name": "current_time", "arguments": "{}"}}, {"id": "call_01_9n9iR4Enq1udcMPFz2ZsuM4h", "type": "function", "function": {"name": "get_weather", "arguments": "{\"city\": \"北京\"}"}}]} 2025/12/31 11:04:52 logger.go:61: [INFO]plugin langgenius/deepseek:0.0.9@b6f84030b306390d876425dc241813a3eee58a1f97e3d3a960088d7595486997: instance 019b725c log: [3] {"role": "tool", "content": "2025-12-31 11:04:50", "tool_call_id": "call_00_6BKzKgSVSpLyaY92eXq9ctDa"} 2025/12/31 11:04:52 logger.go:61: [INFO]plugin langgenius/deepseek:0.0.9@b6f84030b306390d876425dc241813a3eee58a1f97e3d3a960088d7595486997: instance 019b725c log: [4] {"role": "tool", "content": "tool response: {\"error_code\": 0, \"reason\": \"查询成功!\", \"result\": {\"city\": \"北京\", \"future\": [{\"date\": \"2025-12-31\", \"direct\": \"北风转西南风\", \"temperature\": \"-9/0℃\", \"weather\": \"晴\", \"wid\": {\"day\": \"00\", \"night\": \"00\"}}, {\"date\": \"2026-01-01\", \"direct\": \"东北风转北风\", \"temperature\": \"-8/1℃\", \"weather\": \"多云转晴\", \"wid\": {\"day\": \"01\", \"night\": \"00\"}}, {\"date\": \"2026-01-02\", \"direct\": \"西南风\", \"temperature\": \"-8/3℃\", \"weather\": \"晴\", \"wid\": {\"day\": \"00\", \"night\": \"00\"}}, {\"date\": \"2026-01-03\", \"direct\": \"西北风转北风\", \"temperature\": \"-4/5℃\", \"weather\": \"晴转多云\", \"wid\": {\"day\": \"00\", \"night\": \"01\"}}, {\"date\": \"2026-01-04\", \"direct\": \"西风转北风\", \"temperature\": \"-6/5℃\", \"weather\": \"多云转晴\", \"wid\": {\"day\": \"01\", \"night\": \"00\"}}], \"realtime\": {\"aqi\": \"14\", \"direct\": \"北风\", \"humidity\": \"22\", \"info\": \"晴\", \"power\": \"3级\", \"temperature\": \"-5\", \"wid\": \"00\"}}}.", "tool_call_id": "call_01_9n9iR4Enq1udcMPFz2ZsuM4h"} ``` ## This PR contains Changes to *Non-Plugin* <!-- Put an `x` in all the boxes that apply by replacing [ ] with [x] For example: - [x] Documentation --> - [ ] Documentation - [ ] Other ## This PR contains Changes to *Non-LLM Models Plugin* - [ ] I have Run Comprehensive Tests Relevant to My Changes <!-- 📷 Include Screenshots/Videos Demonstrating the Fix, New Feature, or the Behavior Before/After Breaking Changes. --> ## This PR contains Changes to *LLM Models Plugin* <!-- LLM Models Test Example: --> <!-- https://github.com/langgenius/dify-official-plugins/blob/main/.assets/test-examples/llm-plugin-tests/llm_test_example.md --> - [x] My Changes Affect Message Flow Handling (System Messages and User→Assistant Turn-Taking) <!-- 📷 Include Screenshots/Videos Demonstrating the Fix, New Feature, or the Behavior Before/After Breaking Changes. --> - [ ] My Changes Affect Tool Interaction Flow (Multi-Round Usage and Output Handling, for both Agent App and Agent Node) <!-- 📷 Include Screenshots/Videos Demonstrating the Fix, New Feature, or the Behavior Before/After Breaking Changes. --> - [ ] My Changes Affect Multimodal Input Handling (Images, PDFs, Audio, Video, etc.) <!-- 📷 Include Screenshots/Videos Demonstrating the Fix, New Feature, or the Behavior Before/After Breaking Changes. --> - [ ] My Changes Affect Multimodal Output Generation (Images, Audio, Video, etc.) <!-- 📷 Include Screenshots/Videos Demonstrating the Fix, New Feature, or the Behavior Before/After Breaking Changes. --> - [ ] My Changes Affect Structured Output Format (JSON, XML, etc.) <!-- 📷 Include Screenshots/Videos Demonstrating the Fix, New Feature, or the Behavior Before/After Breaking Changes. --> - [ ] My Changes Affect Token Consumption Metrics <!-- 📷 Include Screenshots/Videos Demonstrating the Fix, New Feature, or the Behavior Before/After Breaking Changes. --> - [ ] My Changes Affect Other LLM Functionalities (Reasoning Process, Grounding, Prompt Caching, etc.) <!-- 📷 Include Screenshots/Videos Demonstrating the Fix, New Feature, or the Behavior Before/After Breaking Changes. --> - [ ] Other Changes (Add New Models, Fix Model Parameters etc.) <!-- 📷 Include Screenshots/Videos Demonstrating the Fix, New Feature, or the Behavior Before/After Breaking Changes. --> ## Version Control (Any Changes to the Plugin Will Require Bumping the Version) - [x] I have Bumped Up the Version in Manifest.yaml (Top-Level `Version` Field, Not in Meta Section) <!-- ⚠️ NOTE: Version Format: MAJOR.MINOR.PATCH - MAJOR (0.x.x): Reserved for Significant architectural changes or incompatible API modifications - MINOR (x.0.x): For New feature additions while maintaining backward compatibility - PATCH (x.x.0): For Backward-compatible bug fixes and minor improvements - Note: Each Version Component (MAJOR, MINOR, PATCH) Can Be 2 Digits, e.g., 10.11.22 --> ## Dify Plugin SDK Version - [x] I have Ensured `dify_plugin>=0.3.0,<0.6.0` is in requirements.txt ([SDK docs](https://github.com/langgenius/dify-plugin-sdks/blob/main/python/README.md)) ## Environment Verification (If Any Code Changes) <!-- ⚠️ NOTE: At Least One Environment Must Be Tested. --> ### Local Deployment Environment - [x] Dify Version is: <!-- Specify Your Version (e.g., 1.2.0) -->, I have Tested My Changes on Local Deployment Dify with a Clean Environment That Matches the Production Configuration. <!-- - Python Virtual Env Matching Manifest.yaml & requirements.txt - No Breaking Changes in Dify That May Affect the Testing Result --> ### SaaS Environment - [ ] I have Tested My Changes on cloud.dify.ai with a Clean Environment That Matches the Production Configuration <!-- - Python Virtual Env Matching Manifest.yaml & requirements.txt --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-16 11:16:55 -05:00
yindo closed this issue 2026-02-16 11:16:55 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify-official-plugins#2417