PluginlnvokeError: User message content must be str #10842

Closed
opened 2026-02-21 18:51:50 -05:00 by yindo · 0 comments
Owner

Originally created by @africa1207 on GitHub (Mar 13, 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.0.1

Cloud or Self Hosted

Self Hosted (Docker), Cloud

Steps to reproduce

workflow

app:
  description: ''
  icon: 🤖
  icon_background: '#FFEAD5'
  mode: advanced-chat
  name: test
  use_icon_as_answer_icon: false
dependencies:
- current_identifier: null
  type: marketplace
  value:
    marketplace_plugin_unique_identifier: langgenius/localai:0.0.3@ffa71a9c05d5f8de48aed4bc7616d880670ed12c68bc313188d8c48e72ccc2a5
kind: app
version: 0.1.5
workflow:
  conversation_variables: []
  environment_variables: []
  features:
    file_upload:
      allowed_file_extensions: []
      allowed_file_types:
      - document
      allowed_file_upload_methods:
      - remote_url
      - local_file
      enabled: true
      fileUploadConfig:
        audio_file_size_limit: 50
        batch_count_limit: 5
        file_size_limit: 15
        image_file_size_limit: 10
        video_file_size_limit: 100
        workflow_file_upload_limit: 10
      image:
        enabled: false
        number_limits: 3
        transfer_methods:
        - local_file
        - remote_url
      number_limits: 1
    opening_statement: ''
    retriever_resource:
      enabled: true
    sensitive_word_avoidance:
      enabled: false
    speech_to_text:
      enabled: false
    suggested_questions: []
    suggested_questions_after_answer:
      enabled: false
    text_to_speech:
      enabled: false
      language: ''
      voice: ''
  graph:
    edges:
    - data:
        isInIteration: false
        isInLoop: false
        sourceType: start
        targetType: document-extractor
      id: 1741850128994-source-1741850145403-target
      source: '1741850128994'
      sourceHandle: source
      target: '1741850145403'
      targetHandle: target
      type: custom
      zIndex: 0
    - data:
        isInIteration: false
        isInLoop: false
        sourceType: document-extractor
        targetType: llm
      id: 1741850145403-source-1741850148619-target
      source: '1741850145403'
      sourceHandle: source
      target: '1741850148619'
      targetHandle: target
      type: custom
      zIndex: 0
    - data:
        isInIteration: false
        isInLoop: false
        sourceType: llm
        targetType: answer
      id: 1741850148619-source-1741850151963-target
      source: '1741850148619'
      sourceHandle: source
      target: '1741850151963'
      targetHandle: target
      type: custom
      zIndex: 0
    nodes:
    - data:
        desc: ''
        selected: false
        title: 开始
        type: start
        variables: []
      height: 54
      id: '1741850128994'
      position:
        x: 30
        y: 252.5
      positionAbsolute:
        x: 30
        y: 252.5
      selected: false
      sourcePosition: right
      targetPosition: left
      type: custom
      width: 244
    - data:
        desc: ''
        is_array_file: true
        selected: false
        title: 文档提取器
        type: document-extractor
        variable_selector:
        - sys
        - files
      height: 92
      id: '1741850145403'
      position:
        x: 334
        y: 252.5
      positionAbsolute:
        x: 334
        y: 252.5
      selected: false
      sourcePosition: right
      targetPosition: left
      type: custom
      width: 244
    - data:
        context:
          enabled: true
          variable_selector:
          - '1741850145403'
          - text
        desc: ''
        memory:
          query_prompt_template: '{{#sys.query#}}'
          role_prefix:
            assistant: ''
            user: ''
          window:
            enabled: false
            size: 50
        model:
          completion_params:
            temperature: 0.7
          mode: chat
          name: DeepSeek-R1-70B
          provider: langgenius/localai/localai
        prompt_template:
        - id: 8546ff8e-b3bb-42f8-a4cc-c1eb5a2b6afe
          role: system
          text: 'Correct {{#context#}} typos. Only point out the typos and correct
            them. If there are no typos, reply: No typos.'
        selected: true
        title: LLM
        type: llm
        variables: []
        vision:
          enabled: false
      height: 90
      id: '1741850148619'
      position:
        x: 638
        y: 252.5
      positionAbsolute:
        x: 638
        y: 252.5
      selected: true
      sourcePosition: right
      targetPosition: left
      type: custom
      width: 244
    - data:
        answer: '{{#1741850148619.text#}}'
        desc: ''
        selected: false
        title: 直接回复
        type: answer
        variables: []
      height: 105
      id: '1741850151963'
      position:
        x: 942
        y: 252.5
      positionAbsolute:
        x: 942
        y: 252.5
      selected: false
      sourcePosition: right
      targetPosition: left
      type: custom
      width: 244
    viewport:
      x: 123
      y: 206.24999999999994
      zoom: 0.7

Error phenomenon

The first time a file is uploaded, the LLM can obtain the content and answer normally. The second time a file is uploaded, an error occurs: User message content must be str.

correct steps

If the memory function is not turned on, no matter how many times the LLM is uploaded, it can normally obtain content and answer.

wrong steps

Turn on the memory function. The second time you upload a file, LLM will report an error.

✔️ Expected Behavior

Turn on the memory function. Uploading documents multiple times enables the LLM to obtain content and output.

Actual Behavior

Turn on the memory function. The second time you upload a file, LLM will report an error.

Image

Originally created by @africa1207 on GitHub (Mar 13, 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.0.1 ### Cloud or Self Hosted Self Hosted (Docker), Cloud ### Steps to reproduce # workflow ``` app: description: '' icon: 🤖 icon_background: '#FFEAD5' mode: advanced-chat name: test use_icon_as_answer_icon: false dependencies: - current_identifier: null type: marketplace value: marketplace_plugin_unique_identifier: langgenius/localai:0.0.3@ffa71a9c05d5f8de48aed4bc7616d880670ed12c68bc313188d8c48e72ccc2a5 kind: app version: 0.1.5 workflow: conversation_variables: [] environment_variables: [] features: file_upload: allowed_file_extensions: [] allowed_file_types: - document allowed_file_upload_methods: - remote_url - local_file enabled: true fileUploadConfig: audio_file_size_limit: 50 batch_count_limit: 5 file_size_limit: 15 image_file_size_limit: 10 video_file_size_limit: 100 workflow_file_upload_limit: 10 image: enabled: false number_limits: 3 transfer_methods: - local_file - remote_url number_limits: 1 opening_statement: '' retriever_resource: enabled: true sensitive_word_avoidance: enabled: false speech_to_text: enabled: false suggested_questions: [] suggested_questions_after_answer: enabled: false text_to_speech: enabled: false language: '' voice: '' graph: edges: - data: isInIteration: false isInLoop: false sourceType: start targetType: document-extractor id: 1741850128994-source-1741850145403-target source: '1741850128994' sourceHandle: source target: '1741850145403' targetHandle: target type: custom zIndex: 0 - data: isInIteration: false isInLoop: false sourceType: document-extractor targetType: llm id: 1741850145403-source-1741850148619-target source: '1741850145403' sourceHandle: source target: '1741850148619' targetHandle: target type: custom zIndex: 0 - data: isInIteration: false isInLoop: false sourceType: llm targetType: answer id: 1741850148619-source-1741850151963-target source: '1741850148619' sourceHandle: source target: '1741850151963' targetHandle: target type: custom zIndex: 0 nodes: - data: desc: '' selected: false title: 开始 type: start variables: [] height: 54 id: '1741850128994' position: x: 30 y: 252.5 positionAbsolute: x: 30 y: 252.5 selected: false sourcePosition: right targetPosition: left type: custom width: 244 - data: desc: '' is_array_file: true selected: false title: 文档提取器 type: document-extractor variable_selector: - sys - files height: 92 id: '1741850145403' position: x: 334 y: 252.5 positionAbsolute: x: 334 y: 252.5 selected: false sourcePosition: right targetPosition: left type: custom width: 244 - data: context: enabled: true variable_selector: - '1741850145403' - text desc: '' memory: query_prompt_template: '{{#sys.query#}}' role_prefix: assistant: '' user: '' window: enabled: false size: 50 model: completion_params: temperature: 0.7 mode: chat name: DeepSeek-R1-70B provider: langgenius/localai/localai prompt_template: - id: 8546ff8e-b3bb-42f8-a4cc-c1eb5a2b6afe role: system text: 'Correct {{#context#}} typos. Only point out the typos and correct them. If there are no typos, reply: No typos.' selected: true title: LLM type: llm variables: [] vision: enabled: false height: 90 id: '1741850148619' position: x: 638 y: 252.5 positionAbsolute: x: 638 y: 252.5 selected: true sourcePosition: right targetPosition: left type: custom width: 244 - data: answer: '{{#1741850148619.text#}}' desc: '' selected: false title: 直接回复 type: answer variables: [] height: 105 id: '1741850151963' position: x: 942 y: 252.5 positionAbsolute: x: 942 y: 252.5 selected: false sourcePosition: right targetPosition: left type: custom width: 244 viewport: x: 123 y: 206.24999999999994 zoom: 0.7 ``` # Error phenomenon The first time a file is uploaded, the LLM can obtain the content and answer normally. The second time a file is uploaded, an error occurs: User message content must be str. # correct steps If the memory function is not turned on, no matter how many times the LLM is uploaded, it can normally obtain content and answer. # wrong steps Turn on the memory function. The second time you upload a file, LLM will report an error. ### ✔️ Expected Behavior Turn on the memory function. Uploading documents multiple times enables the LLM to obtain content and output. ### ❌ Actual Behavior Turn on the memory function. The second time you upload a file, LLM will report an error. ![Image](https://github.com/user-attachments/assets/bca84bc0-3bd5-4e80-a842-34b561c8aac7)
yindo added the 🐞 bug label 2026-02-21 18:51:50 -05:00
yindo closed this issue 2026-02-21 18:51:50 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#10842