[PR #104] [MERGED] fix: incorrectly uses new_tool_call.function.name while getting existing tool calls #148

Closed
opened 2026-02-15 21:15:58 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/langgenius/dify-plugin-sdks/pull/104
Author: @ExenVitor
Created: 4/17/2025
Status: Merged
Merged: 4/25/2025
Merged by: @Yeuoly

Base: mainHead: fix-oai-compat-increase-tool-call-with-fallback


📝 Commits (1)

  • 4a0dd86 fix: incorrectly uses new_tool_call.function.name while getting existing tool calls

📊 Changes

4 files changed (+153 additions, -42 deletions)

View changed files

📝 python/dify_plugin/interfaces/model/openai_compatible/llm.py (+54 -42)
python/tests/interfaces/model/__init__.py (+0 -0)
python/tests/interfaces/model/openai_compatible/__init__.py (+0 -0)
python/tests/interfaces/model/openai_compatible/test_increase_tool_call.py (+99 -0)

📄 Description

  1. Identify new tool call instances using tool_call_id when available.
  2. For model providers that are not fully compatible with OpenAI's schema (returning only function_name instead of tool_call_id), fallback to generating random tool_call_id for each new tool call.

Ref PR in main repo: #17781


🔄 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-plugin-sdks/pull/104 **Author:** [@ExenVitor](https://github.com/ExenVitor) **Created:** 4/17/2025 **Status:** ✅ Merged **Merged:** 4/25/2025 **Merged by:** [@Yeuoly](https://github.com/Yeuoly) **Base:** `main` ← **Head:** `fix-oai-compat-increase-tool-call-with-fallback` --- ### 📝 Commits (1) - [`4a0dd86`](https://github.com/langgenius/dify-plugin-sdks/commit/4a0dd86c48132c69c18ea1087905b3df78e82991) fix: incorrectly uses new_tool_call.function.name while getting existing tool calls ### 📊 Changes **4 files changed** (+153 additions, -42 deletions) <details> <summary>View changed files</summary> 📝 `python/dify_plugin/interfaces/model/openai_compatible/llm.py` (+54 -42) ➕ `python/tests/interfaces/model/__init__.py` (+0 -0) ➕ `python/tests/interfaces/model/openai_compatible/__init__.py` (+0 -0) ➕ `python/tests/interfaces/model/openai_compatible/test_increase_tool_call.py` (+99 -0) </details> ### 📄 Description 1. Identify new tool call instances using `tool_call_id` when available. 2. For model providers that are not fully compatible with OpenAI's schema (returning only `function_name` instead of `tool_call_id`), fallback to generating random `tool_call_id` for each new tool call. Ref PR in main repo: [#17781](https://github.com/langgenius/dify/pull/17781) --- <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-15 21:15:58 -05:00
yindo closed this issue 2026-02-15 21:15:58 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify-plugin-sdks#148