[PR #369] [MERGED] feat: add InvokeLLMWithStructuredOutput functionality #472

Closed
opened 2026-02-16 01:16:04 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/langgenius/dify-plugin-daemon/pull/369
Author: @Yeuoly
Created: 6/27/2025
Status: Merged
Merged: 6/30/2025
Merged by: @Yeuoly

Base: mainHead: feat/support-structured-llm-output


📝 Commits (3)

  • 53fc0d6 feat: add InvokeLLMWithStructuredOutput functionality
  • 0944304 refactor: enhance LLMResultChunkWithStructuredOutput structure
  • 3d72cfe refactor: streamline LLMResultChunk construction in InvokeLLMWithStructuredOutput

📊 Changes

6 files changed (+120 additions, -0 deletions)

View changed files

📝 internal/core/dify_invocation/invcation.go (+3 -0)
📝 internal/core/dify_invocation/real/http_request.go (+6 -0)
📝 internal/core/dify_invocation/tester/mock.go (+56 -0)
📝 internal/core/dify_invocation/types.go (+10 -0)
📝 internal/core/plugin_daemon/backwards_invocation/task.go (+29 -0)
📝 pkg/entities/model_entities/llm.go (+16 -0)

📄 Description

  • Introduced a new method InvokeLLMWithStructuredOutput to the BackwardsInvocation interface for handling structured output requests.
  • Added corresponding request and response types to support structured output.
  • Implemented the method in both RealBackwardsInvocation and MockedDifyInvocation for testing purposes.
  • Updated permission handling and task execution for the new structured output invocation type.

This enhancement allows for more flexible and detailed responses from the LLM, improving the overall functionality of the invocation system.

Description

Please provide a brief description of the changes made in this pull request.
Please also include the issue number if this is related to an issue using the format Fixes #123 or Closes #123.

Type of Change

  • Bug fix
  • New feature
  • Refactor
  • Performance improvement
  • Other

Essential Checklist

Testing

  • I have tested the changes locally and confirmed they work as expected
  • I have added unit tests where necessary and they pass successfully

Bug Fix (if applicable)

  • I have used GitHub syntax to close the related issue (e.g., Fixes #123 or Closes #123)

Additional Information

Please provide any additional context that would help reviewers understand the changes.


🔄 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-daemon/pull/369 **Author:** [@Yeuoly](https://github.com/Yeuoly) **Created:** 6/27/2025 **Status:** ✅ Merged **Merged:** 6/30/2025 **Merged by:** [@Yeuoly](https://github.com/Yeuoly) **Base:** `main` ← **Head:** `feat/support-structured-llm-output` --- ### 📝 Commits (3) - [`53fc0d6`](https://github.com/langgenius/dify-plugin-daemon/commit/53fc0d6a3300c83fc7e3aef49d2b7aca1bde379b) feat: add InvokeLLMWithStructuredOutput functionality - [`0944304`](https://github.com/langgenius/dify-plugin-daemon/commit/09443046b215d4f1496cc4a56eabf129c584bb86) refactor: enhance LLMResultChunkWithStructuredOutput structure - [`3d72cfe`](https://github.com/langgenius/dify-plugin-daemon/commit/3d72cfea5658ec82d8f0938042d8adfd14a77f08) refactor: streamline LLMResultChunk construction in InvokeLLMWithStructuredOutput ### 📊 Changes **6 files changed** (+120 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `internal/core/dify_invocation/invcation.go` (+3 -0) 📝 `internal/core/dify_invocation/real/http_request.go` (+6 -0) 📝 `internal/core/dify_invocation/tester/mock.go` (+56 -0) 📝 `internal/core/dify_invocation/types.go` (+10 -0) 📝 `internal/core/plugin_daemon/backwards_invocation/task.go` (+29 -0) 📝 `pkg/entities/model_entities/llm.go` (+16 -0) </details> ### 📄 Description - Introduced a new method InvokeLLMWithStructuredOutput to the BackwardsInvocation interface for handling structured output requests. - Added corresponding request and response types to support structured output. - Implemented the method in both RealBackwardsInvocation and MockedDifyInvocation for testing purposes. - Updated permission handling and task execution for the new structured output invocation type. This enhancement allows for more flexible and detailed responses from the LLM, improving the overall functionality of the invocation system. ## Description Please provide a brief description of the changes made in this pull request. Please also include the issue number if this is related to an issue using the format `Fixes #123` or `Closes #123`. ## Type of Change - [ ] Bug fix - [x] New feature - [ ] Refactor - [ ] Performance improvement - [ ] Other ## Essential Checklist ### Testing - [x] I have tested the changes locally and confirmed they work as expected - [x] I have added unit tests where necessary and they pass successfully ### Bug Fix (if applicable) - [ ] I have used GitHub syntax to close the related issue (e.g., `Fixes #123` or `Closes #123`) ## Additional Information Please provide any additional context that would help reviewers understand the changes. --- <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 01:16:04 -05:00
yindo closed this issue 2026-02-16 01:16:04 -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-daemon#472