Question Classifier output should include class_id variable #10983

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

Originally created by @3ks on GitHub (Mar 14, 2025).

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).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

1. Is this request related to a challenge you're experiencing? Tell me about your story.

When using the Question Classifier for categorization followed by Jinja2 template processing to aggregate multi-branch results, we need to generate different prompts based on class_id. However, the current implementation only provides class_name in the output.

Image

Using class_id would be more precise and efficient for template scripting, as class_names could be lengthy textual descriptions (potentially spanning dozens or hundreds of characters). This would improve template readability and maintain consistency across pipeline stages.

Image

2. Additional context or comments

No response

3. Can you help us with this feature?

  • I am interested in contributing to this feature.
Originally created by @3ks on GitHub (Mar 14, 2025). ### 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] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [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? Tell me about your story. When using the Question Classifier for categorization followed by Jinja2 template processing to aggregate multi-branch results, we need to generate different prompts based on class_id. However, the current implementation only provides class_name in the output. ![Image](https://github.com/user-attachments/assets/f4b96e73-12eb-4af3-8fed-24399835ce84) Using class_id would be more precise and efficient for template scripting, as class_names could be lengthy textual descriptions (potentially spanning dozens or hundreds of characters). This would improve template readability and maintain consistency across pipeline stages. ![Image](https://github.com/user-attachments/assets/f326f9f2-d9c2-4293-8318-9ee22c86666b) ### 2. Additional context or comments _No response_ ### 3. Can you help us with this feature? - [x] I am interested in contributing to this feature.
yindo added the 💪 enhancement label 2026-02-21 18:53:29 -05:00
yindo closed this issue 2026-02-21 18:53:29 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#10983