How to add extra payloads in /chat-messages response? #3954

Closed
opened 2026-02-21 18:04:02 -05:00 by yindo · 0 comments
Owner

Originally created by @gaoxiao on GitHub (Jun 3, 2024).

Self Checks

  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • Please do not modify this template :) and fill in all the required fields.

1. Is this request related to a challenge you're experiencing?

I want to build API services using Studio. Besides providing a direct answer to the user, I also want to add some extra information in the response. Ideally, I want to return something like:

{
  "response": "hello from bot",
  "is_end": true
}

However, I can't simply put this format in the Answer node, because it will be fed back to the LLM as history, and I don't want JSON in the history, only the "response" field. Is there a way to include these extra fields in the API response without them appearing in the history?

2. Describe the feature you'd like to see

Include extra fields in the API response without them appearing in the history.

3. How will this feature improve your workflow or experience?

Include extra fields in the API response without them appearing in the history.

4. Additional context or comments

No response

5. Can you help us with this feature?

  • I am interested in contributing to this feature.
Originally created by @gaoxiao on GitHub (Jun 3, 2024). ### Self Checks - [X] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [X] I confirm that I am using English to submit this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [X] Please do not modify this template :) and fill in all the required fields. ### 1. Is this request related to a challenge you're experiencing? I want to build API services using Studio. Besides providing a direct answer to the user, I also want to add some extra information in the response. Ideally, I want to return something like: ```json { "response": "hello from bot", "is_end": true } ``` However, I can't simply put this format in the Answer node, because it will be fed back to the LLM as history, and I don't want JSON in the history, only the "response" field. Is there a way to include these extra fields in the API response without them appearing in the history? ### 2. Describe the feature you'd like to see Include extra fields in the API response without them appearing in the history. ### 3. How will this feature improve your workflow or experience? Include extra fields in the API response without them appearing in the history. ### 4. Additional context or comments _No response_ ### 5. Can you help us with this feature? - [ ] I am interested in contributing to this feature.
yindo added the 💪 enhancement label 2026-02-21 18:04:02 -05:00
yindo closed this issue 2026-02-21 18:04:02 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#3954