[PR #10784] feat: support function call for ollama block chat api #26930

Closed
opened 2026-02-21 20:40:32 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/langgenius/dify/pull/10784

State: closed
Merged: Yes


Summary

Ollama’s Block Chat API supports function calls when the LLM includes this feature. In agent apps, the agent with ollama LLM will use Function Call mode instead of ReAct mode to prevent unexpected function executions.

Screenshots

Before: After:
截屏2024-11-17 21 35 13 截屏2024-11-17 22 05 22 截屏2024-11-17 21 44 38 截屏2024-11-17 21 44 03

Checklist

Important

Please review the checklist below before submitting your pull request.

  • This change requires a documentation update, included: Dify Document
  • I understand that this PR may be closed in case there was no previous discussion or issues. (This doesn't apply to typos!)
  • I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change.
  • I've updated the documentation accordingly.
  • I ran dev/reformat(backend) and cd web && npx lint-staged(frontend) to appease the lint gods
**Original Pull Request:** https://github.com/langgenius/dify/pull/10784 **State:** closed **Merged:** Yes --- # Summary Ollama’s Block Chat API supports function calls when the LLM includes this feature. In agent apps, the agent with ollama LLM will use Function Call mode instead of ReAct mode to prevent unexpected function executions. # Screenshots <table> <tr> <td>Before: </td> <td>After: </td> </tr> <tr> <td> <img width="652" alt="截屏2024-11-17 21 35 13" src="https://github.com/user-attachments/assets/fb815a53-c9d7-4d7f-b626-332d52a0a660"> <img width="1450" alt="截屏2024-11-17 22 05 22" src="https://github.com/user-attachments/assets/abeb3075-3685-4020-8379-923f823c76f7"> </td> <td> <img width="644" alt="截屏2024-11-17 21 44 38" src="https://github.com/user-attachments/assets/9a49258a-0718-4fb9-94ec-f2f7481777b0"> <img width="1446" alt="截屏2024-11-17 21 44 03" src="https://github.com/user-attachments/assets/9bd3cca2-e401-4cb1-a1b0-2ba81cbc40c4"> </td> </tr> </table> # Checklist > [!IMPORTANT] > Please review the checklist below before submitting your pull request. - [ ] This change requires a documentation update, included: [Dify Document](https://github.com/langgenius/dify-docs) - [x] I understand that this PR may be closed in case there was no previous discussion or issues. (This doesn't apply to typos!) - [x] I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change. - [x] I've updated the documentation accordingly. - [x] I ran `dev/reformat`(backend) and `cd web && npx lint-staged`(frontend) to appease the lint gods
yindo added the pull-request label 2026-02-21 20:40:32 -05:00
yindo closed this issue 2026-02-21 20:40:32 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#26930