Skip to content

[Bug]: Custom entity types cannot be properly invoked during graph parsing. #6608

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
4 tasks done
MarcusYuan opened this issue Mar 27, 2025 · 1 comment
Closed
4 tasks done
Labels
🐞 bug Something isn't working, pull request that fix bug.

Comments

@MarcusYuan
Copy link
Contributor

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).
  • Non-english title submitions will be closed directly ( 非英文标题的提交将会被直接关闭 ) (Language Policy).
  • Please do not modify this template :) and fill in all the required fields.

RAGFlow workspace code commit ID

baf3b9b

RAGFlow image version

v0.17.2-166-gdf389082 slim

Other environment information

ubuntu docker

Actual behavior

Image

Image

Expected behavior

I hope the filled entity list can be loaded properly/normally.

Steps to reproduce

Add non-default entities for testing.

Additional information

No response

@MarcusYuan MarcusYuan added the 🐞 bug Something isn't working, pull request that fix bug. label Mar 27, 2025
Copy link

dosubot bot commented Mar 27, 2025

Custom entity types cannot be properly invoked during graph parsing in RAGFlow because the graph_extractor is hardcoded to use default entity types instead of custom ones. To resolve this issue, you need to modify the self._prompt_variables in the graph_extractor to use the custom entity_types instead of DEFAULT_ENTITY_TYPES. Here is the code change required:

Change from:

self._prompt_variables = {
    "entity_types": entity_types,
    self._tuple_delimiter_key: DEFAULT_TUPLE_DELIMITER,
    self._record_delimiter_key: DEFAULT_RECORD_DELIMITER,
    self._completion_delimiter_key: DEFAULT_COMPLETION_DELIMITER,
    self._entity_types_key: ",".join(DEFAULT_ENTITY_TYPES),
}

To:

self._prompt_variables = {
    self._tuple_delimiter_key: DEFAULT_TUPLE_DELIMITER,
    self._record_delimiter_key: DEFAULT_RECORD_DELIMITER,
    self._completion_delimiter_key: DEFAULT_COMPLETION_DELIMITER,
    self._entity_types_key: ",".join(entity_types),
}

This change should allow the system to properly recognize and invoke custom entity types during graph parsing [1].

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other

yuzhichang added a commit to yuzhichang/ragflow that referenced this issue Mar 28, 2025
yuzhichang added a commit that referenced this issue Mar 28, 2025
### What problem does this PR solve?

Fix entity_types. Close #6287 and #6608

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working, pull request that fix bug.
Projects
None yet
Development

No branches or pull requests

2 participants