The length of output variable kb_content must be less than 30 characters #5257

Closed
opened 2026-02-21 18:10:08 -05:00 by yindo · 2 comments
Owner

Originally created by @Thinking80s on GitHub (Aug 27, 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

Version 0.7.2

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

The length of output variable kb_content must be less than 30 characters

✔️ Expected Behavior

The length of output variable kb_content must be less than 30 characters

Actual Behavior

The length of output variable kb_content must be less than 30 characters

Originally created by @Thinking80s on GitHub (Aug 27, 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 Version 0.7.2 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce The length of output variable `kb_content` must be less than 30 characters ### ✔️ Expected Behavior The length of output variable `kb_content` must be less than 30 characters ### ❌ Actual Behavior The length of output variable `kb_content` must be less than 30 characters
yindo added the 🐞 bug label 2026-02-21 18:10:08 -05:00
yindo closed this issue 2026-02-21 18:10:08 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Aug 27, 2024):

@Thinking80s Hello! I'm here to help you with bugs, questions, and becoming a contributor. While you wait for a human maintainer, I'm available to assist you.

It appears that you are encountering an issue where the length of the kb_content output variable must be less than 30 characters. Unfortunately, I couldn't find specific information about the kb_content variable in the repository. However, there are configuration files or settings that specify constraints or validation rules for variables in general.

For example, the checkValid function in the nodeDefault object contains validation rules for the KnowledgeRetrievalNodeType payload. This function checks for required fields and conditions based on retrieval_mode [1].

If you need to enforce a length constraint on kb_content, you might need to implement a similar validation check in your code. Here is a basic example of how you could add a length check:

function validateKbContent(kb_content: string): { isValid: boolean, errorMessage: string } {
    let errorMessage = '';
    if (kb_content.length >= 30) {
        errorMessage = 'The length of kb_content must be less than 30 characters';
    }
    return {
        isValid: errorMessage === '',
        errorMessage: errorMessage,
    };
}

You can integrate this function into your existing validation logic to ensure that kb_content meets the required length constraint.

To continue talking to Dosu, mention @dosu.

@dosubot[bot] commented on GitHub (Aug 27, 2024): <!-- Greeting --> @Thinking80s Hello! I'm here to help you with bugs, questions, and becoming a contributor. While you wait for a human maintainer, I'm available to assist you. <!-- Answer --> It appears that you are encountering an issue where the length of the `kb_content` output variable must be less than 30 characters. Unfortunately, I couldn't find specific information about the `kb_content` variable in the repository. However, there are configuration files or settings that specify constraints or validation rules for variables in general. For example, the `checkValid` function in the `nodeDefault` object contains validation rules for the `KnowledgeRetrievalNodeType` payload. This function checks for required fields and conditions based on `retrieval_mode` <sup>[[1]](https://github.com/langgenius/dify/blob/main/web/app/components/workflow/nodes/knowledge-retrieval/default.ts)</sup>. If you need to enforce a length constraint on `kb_content`, you might need to implement a similar validation check in your code. Here is a basic example of how you could add a length check: ```ts function validateKbContent(kb_content: string): { isValid: boolean, errorMessage: string } { let errorMessage = ''; if (kb_content.length >= 30) { errorMessage = 'The length of kb_content must be less than 30 characters'; } return { isValid: errorMessage === '', errorMessage: errorMessage, }; } ``` You can integrate this function into your existing validation logic to ensure that `kb_content` meets the required length constraint. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.*
Author
Owner

@crazywoola commented on GitHub (Aug 27, 2024):

Duplicated, we already fixed this yesterday in this PR https://github.com/langgenius/dify/pull/7683

@crazywoola commented on GitHub (Aug 27, 2024): Duplicated, we already fixed this yesterday in this PR https://github.com/langgenius/dify/pull/7683
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#5257