[PR #585] feat: support opaque_body in prompt messages #597

Open
opened 2026-02-16 01:16:27 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/langgenius/dify-plugin-daemon/pull/585
Author: @BeautyyuYanli
Created: 1/26/2026
Status: 🔄 Open

Base: mainHead: yanli/add-opaque-body


📝 Commits (1)

  • bba10ae add message level and content level opaque_body

📊 Changes

2 files changed (+16 additions, -2 deletions)

View changed files

📝 pkg/entities/model_entities/llm.go (+6 -0)
📝 pkg/entities/model_entities/llm_test.go (+10 -2)

📄 Description

This is part of https://github.com/langgenius/dify-official-plugins/issues/2492

Summary

Adds optional opaque_body passthrough for prompt messages so provider-specific metadata can be carried through without schema changes.

Changes

  • Add opaque_body to PromptMessage and PromptMessageContent (omitempty).
  • Preserve opaque_body in PromptMessage JSON unmarshal.
  • Extend tests to cover message-level and content-level opaque_body.

Testing

  • go test ./pkg/entities/model_entities -run TestFullFunctionPromptMessage

🔄 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/585 **Author:** [@BeautyyuYanli](https://github.com/BeautyyuYanli) **Created:** 1/26/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `yanli/add-opaque-body` --- ### 📝 Commits (1) - [`bba10ae`](https://github.com/langgenius/dify-plugin-daemon/commit/bba10ae06622b113204c0e62d2c8adca041de86f) add message level and content level opaque_body ### 📊 Changes **2 files changed** (+16 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `pkg/entities/model_entities/llm.go` (+6 -0) 📝 `pkg/entities/model_entities/llm_test.go` (+10 -2) </details> ### 📄 Description This is part of https://github.com/langgenius/dify-official-plugins/issues/2492 ## Summary Adds optional `opaque_body` passthrough for prompt messages so provider-specific metadata can be carried through without schema changes. ## Changes - Add `opaque_body` to `PromptMessage` and `PromptMessageContent` (omitempty). - Preserve `opaque_body` in `PromptMessage` JSON unmarshal. - Extend tests to cover message-level and content-level `opaque_body`. ## Testing - go test ./pkg/entities/model_entities -run TestFullFunctionPromptMessage --- <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:27 -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#597