Issue regarding passing a epub file #13603

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

Originally created by @Awesomelok622 on GitHub (May 2, 2025).

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

1.3.0

Cloud or Self Hosted

Self Hosted (Source)

Steps to reproduce

Hi, I encountered an issue where I am trying to pass a epub file into a LLM node, but it returns an error "Invalid context structure". Is it related to self-hosted environment configuration, for example http and https related issues? Or is it because the LLM model cannot directly extract and read the content of the epub file?

Image

✔️ Expected Behavior

I am expecting the LLM node to extract the content in the epub file according the prompt and understand the context of the content.

Actual Behavior

The "Invalid context structure" error occurred.

Originally created by @Awesomelok622 on GitHub (May 2, 2025). ### 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 1.3.0 ### Cloud or Self Hosted Self Hosted (Source) ### Steps to reproduce Hi, I encountered an issue where I am trying to pass a epub file into a LLM node, but it returns an error "Invalid context structure". Is it related to self-hosted environment configuration, for example http and https related issues? Or is it because the LLM model cannot directly extract and read the content of the epub file? ![Image](https://github.com/user-attachments/assets/b001395d-d9c9-4901-84de-d3bfaa2c947e) ### ✔️ Expected Behavior I am expecting the LLM node to extract the content in the epub file according the prompt and understand the context of the content. ### ❌ Actual Behavior The "Invalid context structure" error occurred.
yindo closed this issue 2026-02-21 19:12:56 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (May 2, 2025):

Hello @Awesomelok622! I'm Dosu, your friendly bot here to help you solve bugs, answer questions, and guide you on your journey to becoming a contributor. While you're waiting for a human maintainer, feel free to ask me anything!

The "Invalid context structure" error you're encountering is related to the LLM model's ability to handle file inputs. Specifically, the DeepSeek R1 and v3 models do not support multimodality, meaning they cannot process file inputs like EPUB files. This issue is not related to your self-hosted environment configuration [1][2].

To resolve this, you need to use a model that supports file handling. Alternatively, you can extract the text from the EPUB file and convert it into a string data structure suitable for LLM nodes. You can use the _extract_text_from_epub function to achieve this. This function extracts text from an EPUB file and returns it as a string, which can then be used in LLM nodes [3][4].

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

@dosubot[bot] commented on GitHub (May 2, 2025): <!-- Greeting --> Hello @Awesomelok622! I'm [Dosu](https://dosu.dev), your friendly bot here to help you solve bugs, answer questions, and guide you on your journey to becoming a contributor. While you're waiting for a human maintainer, feel free to ask me anything! <!-- Answer --> The "Invalid context structure" error you're encountering is related to the LLM model's ability to handle file inputs. Specifically, the DeepSeek R1 and v3 models do not support multimodality, meaning they cannot process file inputs like EPUB files. This issue is not related to your self-hosted environment configuration <sup>[[1]](https://github.com/langgenius/dify/issues/16445)</sup><sup>[[2]](https://github.com/crazywoola/dify-docs-mintlify/blob/main/en/guides/workflow/error-handling/error-type.mdx)</sup>. To resolve this, you need to use a model that supports file handling. Alternatively, you can extract the text from the EPUB file and convert it into a string data structure suitable for LLM nodes. You can use the `_extract_text_from_epub` function to achieve this. This function extracts text from an EPUB file and returns it as a string, which can then be used in LLM nodes <sup>[[3]](https://github.com/langgenius/dify/blob/main/api/core/workflow/nodes/document_extractor/node.py)</sup><sup>[[4]](https://github.com/crazywoola/dify-docs-mintlify/blob/main/en/workshop/intermediate/article-reader.mdx)</sup>. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.* --- <sup>Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/903336cd-6d6a-4a53-810e-6eb32de7170a?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/903336cd-6d6a-4a53-810e-6eb32de7170a?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/903336cd-6d6a-4a53-810e-6eb32de7170a?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/903336cd-6d6a-4a53-810e-6eb32de7170a?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/903336cd-6d6a-4a53-810e-6eb32de7170a?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/903336cd-6d6a-4a53-810e-6eb32de7170a?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/903336cd-6d6a-4a53-810e-6eb32de7170a?feedback_type=other)</sup>
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#13603