开启【引用和归属】功能后,来自知识库的回答无法标记来源 #997

Closed
opened 2026-02-21 17:29:25 -05:00 by yindo · 2 comments
Owner

Originally created by @wenhuiwu on GitHub (Jan 30, 2024).

Self Checks

Dify version

0.4.8

Cloud or Self Hosted

Self Hosted (Source)

Steps to reproduce

1、添加一个知识库
2、创建一个问答应用
3、问答应用添加这个知识库作为上下文
4、开启【引用和归属】功能
5、在应用中询问一个知识库中的内容
6、ai回到后,没有显示应有的引用信息

✔️ Expected Behavior

应该根据功能展示引用
image

Actual Behavior

ai回到后,没有显示应有的引用信息

Originally created by @wenhuiwu on GitHub (Jan 30, 2024). ### 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 file this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). ### Dify version 0.4.8 ### Cloud or Self Hosted Self Hosted (Source) ### Steps to reproduce 1、添加一个知识库 2、创建一个问答应用 3、问答应用添加这个知识库作为上下文 4、开启【引用和归属】功能 5、在应用中询问一个知识库中的内容 6、ai回到后,没有显示应有的引用信息 ### ✔️ Expected Behavior 应该根据功能展示引用 <img width="224" alt="image" src="https://github.com/langgenius/dify/assets/10475862/8502dba7-8c11-469b-9583-dc93291aad4b"> ### ❌ Actual Behavior ai回到后,没有显示应有的引用信息
yindo added the 🐞 bug label 2026-02-21 17:29:25 -05:00
yindo closed this issue 2026-02-21 17:29:25 -05:00
Author
Owner

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

🤖

您好,wenhuiwu。根据您提供的信息,我理解您在使用Dify应用的"引用和归属"功能时遇到了问题。这个功能是在Popup组件中实现的,该组件接受一个类型为Resourcesdata属性和一个可选的showHitInfo属性。data属性包含引用信息,showHitInfo属性决定是否显示关于引用的额外信息(如段落位置、字数、命中次数、向量哈希和分数)。

如果"引用和归属"功能没有显示预期的引用信息,可能有几个原因:

  1. data属性可能不包含正确的引用信息。这可能是数据源的问题,或者是将数据传递给Popup组件的方式的问题。

  2. showHitInfo属性可能被设置为false,或者根本没有提供,这种情况下,额外的引用信息将不会显示。

  3. 可能是Popup组件本身的渲染问题。例如,如果JSX或CSS中有错误,引用信息可能无法正确显示。

没有更多关于您遇到的具体问题的信息,我很难提供更详细的答案。您可能需要检查datashowHitInfo属性的值,并检查控制台是否有任何错误信息。您可以参考这个源代码文件:web/app/components/app/chat/citation/popup.tsx

至于您提到的Dify应用在0.4.8版本和最新的0.5.2版本之间对"引用和归属"功能做了哪些更改,我在仓库中没有找到答案,可能答案在其他地方,或者我可能遗漏了。如果您能提供更多信息,我可能能够更好地帮助您解决问题。

Sources


This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.

Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.

If you want to continue the conversation, start your reply with @dosu-bot.

@dosubot[bot] commented on GitHub (Jan 30, 2024): _🤖_ <!-- Answer --> 您好,wenhuiwu。根据您提供的信息,我理解您在使用Dify应用的"引用和归属"功能时遇到了问题。这个功能是在`Popup`组件中实现的,该组件接受一个类型为`Resources`的`data`属性和一个可选的`showHitInfo`属性。`data`属性包含引用信息,`showHitInfo`属性决定是否显示关于引用的额外信息(如段落位置、字数、命中次数、向量哈希和分数)。 如果"引用和归属"功能没有显示预期的引用信息,可能有几个原因: 1. `data`属性可能不包含正确的引用信息。这可能是数据源的问题,或者是将数据传递给`Popup`组件的方式的问题。 2. `showHitInfo`属性可能被设置为`false`,或者根本没有提供,这种情况下,额外的引用信息将不会显示。 3. 可能是`Popup`组件本身的渲染问题。例如,如果JSX或CSS中有错误,引用信息可能无法正确显示。 没有更多关于您遇到的具体问题的信息,我很难提供更详细的答案。您可能需要检查`data`和`showHitInfo`属性的值,并检查控制台是否有任何错误信息。您可以参考这个源代码文件:[web/app/components/app/chat/citation/popup.tsx](https://github.com/langgenius/dify/blob/main/web/app/components/app/chat/citation/popup.tsx)。 至于您提到的Dify应用在0.4.8版本和最新的0.5.2版本之间对"引用和归属"功能做了哪些更改,我在仓库中没有找到答案,可能答案在其他地方,或者我可能遗漏了。如果您能提供更多信息,我可能能够更好地帮助您解决问题。 ## Sources - [web/app/components/app/chat/citation/popup.tsx](https://github.com/langgenius/dify/blob/main/web/app/components/app/chat/citation/popup.tsx) --- This response is meant to be useful and save you time. It is **not meant to be a precise solution**, but rather a starting point for your own research. Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant. If you want to continue the conversation, start your reply with @dosu-bot.
Author
Owner

@guchenhe commented on GitHub (Jan 30, 2024):

See #1542.

@guchenhe commented on GitHub (Jan 30, 2024): See #1542.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#997