dify icon indicating copy to clipboard operation
dify copied to clipboard

allow to config max segmentation tokens length for RAG document using environment variable

Open rainchen opened this issue 1 year ago • 2 comments

Description

allow to config max segmentation tokens length for RAG document using environment variable

Fixes # (issue)

Fix #2438 #3290 also #4071

Type of Change

Please delete options that are not relevant.

  • [x] This change requires a documentation update, included: Dify Document
  • [x] Improvement, including but not limited to code refactoring, performance optimization, and UI/UX improvement

How Has This Been Tested?

manually tested

Suggested Checklist:

  • [x] I have performed a self-review of my own code
  • [x] I have commented my code, particularly in hard-to-understand areas
  • [x] My changes generate no new warnings
  • [x] I ran dev/reformat(backend) and cd web && npx lint-staged(frontend) to appease the lint gods
  • [ ] optional I have made corresponding changes to the documentation
  • [ ] optional I have added tests that prove my fix is effective or that my feature works
  • [ ] optional New and existing unit tests pass locally with my changes

rainchen avatar May 14 '24 09:05 rainchen

pls add the default value for the new variable in the file : config.py , thanks @rainchen

JohnJyong avatar May 14 '24 11:05 JohnJyong

pls add the default value for the new variable in the file : config.py , thanks @rainchen

@JohnJyong refactored, please review again

rainchen avatar May 15 '24 02:05 rainchen

LGTM

JohnJyong avatar May 20 '24 05:05 JohnJyong

@rainchen AMAZING PR! I was wondering if something like this is possible because I was having some texts that were > 1k and they got broke down.

rennokki avatar May 20 '24 05:05 rennokki

I have set the docker-compose.yaml environment variable on self-host and restarted the container, but the changes are not applied. I am building with the “langgenius/dify-api:0.6.8” image, is this feature already enabled?

daigo38 avatar May 27 '24 08:05 daigo38