The maximum number of segmentation tokens in a dataset was not consistent between api and web. #6997

Closed
opened 2026-02-21 18:18:19 -05:00 by yindo · 1 comment
Owner

Originally created by @fujita-h on GitHub (Nov 30, 2024).

Self Checks

  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • 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.

Dify version

0.12.1

Cloud or Self Hosted

Self Hosted (Source)

Steps to reproduce

Even if you change the INDEXING_MAX_SEGMENTATION_TOKENS_LENGTH environment variable, the upper limit on the web side is hard-coded at 4000, and the environment variable change is not reflected.

✔️ Expected Behavior

When we change the INDEXING_MAX_SEGMENTATION_TOKENS_LENGTH environment variable, the web limit should also be changed.

Actual Behavior

No response

Originally created by @fujita-h on GitHub (Nov 30, 2024). ### Self Checks - [X] This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general). - [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. ### Dify version 0.12.1 ### Cloud or Self Hosted Self Hosted (Source) ### Steps to reproduce Even if you change the `INDEXING_MAX_SEGMENTATION_TOKENS_LENGTH` environment variable, the upper limit on the web side is hard-coded at 4000, and the environment variable change is not reflected. ### ✔️ Expected Behavior When we change the `INDEXING_MAX_SEGMENTATION_TOKENS_LENGTH` environment variable, the web limit should also be changed. ### ❌ Actual Behavior _No response_
yindo added the 🐞 bug label 2026-02-21 18:18:19 -05:00
yindo closed this issue 2026-02-21 18:18:19 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Nov 30, 2024):

The issue you're experiencing is due to the segmentation token limit being hard-coded in the web application. Specifically, the default chunk length for segmentation tokens is set to 4000 in the web component, which does not automatically reflect changes made to the INDEXING_MAX_SEGMENTATION_TOKENS_LENGTH environment variable [1].

To address this inconsistency, you would need to modify the web application's code to dynamically use the value from the environment variable instead of the hard-coded value. This would involve updating the relevant component in the web application to fetch and apply the environment variable value.

If you need further assistance with implementing this change, feel free to ask!

To continue talking to Dosu, mention @dosu.

@dosubot[bot] commented on GitHub (Nov 30, 2024): <!-- Answer --> The issue you're experiencing is due to the segmentation token limit being hard-coded in the web application. Specifically, the default chunk length for segmentation tokens is set to 4000 in the web component, which does not automatically reflect changes made to the `INDEXING_MAX_SEGMENTATION_TOKENS_LENGTH` environment variable <sup>[[1]](https://github.com/langgenius/dify/blob/main/web/app/components/datasets/create/step-two/index.tsx)</sup>. To address this inconsistency, you would need to modify the web application's code to dynamically use the value from the environment variable instead of the hard-coded value. This would involve updating the relevant component in the web application to fetch and apply the environment variable value. If you need further assistance with implementing this change, feel free to ask! <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.*
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#6997