dify - 💡(How to fix) Fix Error: not supported value type integer because cannot init a float var [1 pull requests]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Error Message

No error raised.

Fix Action

Fixed

Code Example

app:
  description: ''
  icon: 🤖
  icon_background: '#FFEAD5'
  icon_type: emoji
  mode: advanced-chat
  name: number-var-test
  use_icon_as_answer_icon: false
dependencies: []
kind: app
version: 0.6.0
workflow:
  conversation_variables:
  - description: ''
    id: 644a18ea-9e9d-49f3-92c3-827847dbde62
    name: nnumber_var
    selector:
    - conversation
    - nnumber_var
    value: 0
    value_type: integer
  environment_variables: []
  features:
    file_upload:
      allowed_file_extensions:
      - .JPG
      - .JPEG
      - .PNG
      - .GIF
      - .WEBP
      - .SVG
      allowed_file_types:
      - image
      allowed_file_upload_methods:
      - local_file
      - remote_url
      enabled: false
      fileUploadConfig:
        attachment_image_file_size_limit: 2
        audio_file_size_limit: 50
        batch_count_limit: 5
        file_size_limit: 15
        file_upload_limit: 20
        image_file_batch_limit: 10
        image_file_size_limit: 10
        single_chunk_attachment_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: 3
    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: code
      id: 1779100725510-source-1779100736555-target
      source: '1779100725510'
      sourceHandle: source
      target: '1779100736555'
      targetHandle: target
      type: custom
      zIndex: 0
    - data:
        isInIteration: false
        isInLoop: false
        sourceType: code
        targetType: assigner
      id: 1779100736555-source-1779100777713-target
      source: '1779100736555'
      sourceHandle: source
      target: '1779100777713'
      targetHandle: target
      type: custom
      zIndex: 0
    - data:
        isInLoop: false
        sourceType: assigner
        targetType: answer
      id: 1779100777713-source-answer-target
      source: '1779100777713'
      sourceHandle: source
      target: answer
      targetHandle: target
      type: custom
      zIndex: 0
    nodes:
    - data:
        selected: false
        title: 用户输入
        type: start
        variables: []
      height: 73
      id: '1779100725510'
      position:
        x: 97.23047532495553
        y: 261
      positionAbsolute:
        x: 97.23047532495553
        y: 261
      selected: false
      sourcePosition: right
      targetPosition: left
      type: custom
      width: 242
    - data:
        answer: '{{#conversation.nnumber_var#}}'
        selected: false
        title: 直接回复
        type: answer
        variables: []
      height: 103
      id: answer
      position:
        x: 966
        y: 282
      positionAbsolute:
        x: 966
        y: 282
      selected: false
      sourcePosition: right
      targetPosition: left
      type: custom
      width: 242
    - data:
        code: "\ndef main():\n    return {\n        \"result\": 0.01,\n    }\n"
        code_language: python3
        outputs:
          result:
            children: null
            type: number
        selected: false
        title: 代码执行
        type: code
        variables: []
      height: 52
      id: '1779100736555'
      position:
        x: 382
        y: 282
      positionAbsolute:
        x: 382
        y: 282
      selected: true
      sourcePosition: right
      targetPosition: left
      type: custom
      width: 242
    - data:
        items:
        - input_type: variable
          operation: over-write
          value:
          - '1779100736555'
          - result
          variable_selector:
          - conversation
          - nnumber_var
        selected: false
        title: 变量赋值
        type: assigner
        version: '2'
      height: 84
      id: '1779100777713'
      position:
        x: 684
        y: 282
      positionAbsolute:
        x: 684
        y: 282
      selected: false
      sourcePosition: right
      targetPosition: left
      type: custom
      width: 242
    viewport:
      x: -56.28846230288684
      y: -78.32861285925742
      zoom: 0.8705505632961241
  rag_pipeline_variables: []
RAW_BUFFERClick to expand / collapse

Self Checks

  • I have read the Contributing Guide and Language Policy.
  • 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, otherwise it will be closed.
  • 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

1.14.1

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

Step:

  1. Init a conversation var in ChatFlow, set Numer 0.0 it will change to 0 automatically.
  2. Using Code node to output a Number var that Float value actually.
  3. Set number var using float value.
  4. First turn conversation is OK. I think var type is still Number.
  5. Second turn conversation will raise 「not supported value type integer」. Number var changed to Integer Already.

Position: https://github.com/langgenius/dify/blob/06f076e0ff47f2e7c69ebc51e756556dd1030d95/api/factories/variable_factory.py#L68

Yaml DSL:

app:
  description: ''
  icon: 🤖
  icon_background: '#FFEAD5'
  icon_type: emoji
  mode: advanced-chat
  name: number-var-test
  use_icon_as_answer_icon: false
dependencies: []
kind: app
version: 0.6.0
workflow:
  conversation_variables:
  - description: ''
    id: 644a18ea-9e9d-49f3-92c3-827847dbde62
    name: nnumber_var
    selector:
    - conversation
    - nnumber_var
    value: 0
    value_type: integer
  environment_variables: []
  features:
    file_upload:
      allowed_file_extensions:
      - .JPG
      - .JPEG
      - .PNG
      - .GIF
      - .WEBP
      - .SVG
      allowed_file_types:
      - image
      allowed_file_upload_methods:
      - local_file
      - remote_url
      enabled: false
      fileUploadConfig:
        attachment_image_file_size_limit: 2
        audio_file_size_limit: 50
        batch_count_limit: 5
        file_size_limit: 15
        file_upload_limit: 20
        image_file_batch_limit: 10
        image_file_size_limit: 10
        single_chunk_attachment_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: 3
    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: code
      id: 1779100725510-source-1779100736555-target
      source: '1779100725510'
      sourceHandle: source
      target: '1779100736555'
      targetHandle: target
      type: custom
      zIndex: 0
    - data:
        isInIteration: false
        isInLoop: false
        sourceType: code
        targetType: assigner
      id: 1779100736555-source-1779100777713-target
      source: '1779100736555'
      sourceHandle: source
      target: '1779100777713'
      targetHandle: target
      type: custom
      zIndex: 0
    - data:
        isInLoop: false
        sourceType: assigner
        targetType: answer
      id: 1779100777713-source-answer-target
      source: '1779100777713'
      sourceHandle: source
      target: answer
      targetHandle: target
      type: custom
      zIndex: 0
    nodes:
    - data:
        selected: false
        title: 用户输入
        type: start
        variables: []
      height: 73
      id: '1779100725510'
      position:
        x: 97.23047532495553
        y: 261
      positionAbsolute:
        x: 97.23047532495553
        y: 261
      selected: false
      sourcePosition: right
      targetPosition: left
      type: custom
      width: 242
    - data:
        answer: '{{#conversation.nnumber_var#}}'
        selected: false
        title: 直接回复
        type: answer
        variables: []
      height: 103
      id: answer
      position:
        x: 966
        y: 282
      positionAbsolute:
        x: 966
        y: 282
      selected: false
      sourcePosition: right
      targetPosition: left
      type: custom
      width: 242
    - data:
        code: "\ndef main():\n    return {\n        \"result\": 0.01,\n    }\n"
        code_language: python3
        outputs:
          result:
            children: null
            type: number
        selected: false
        title: 代码执行
        type: code
        variables: []
      height: 52
      id: '1779100736555'
      position:
        x: 382
        y: 282
      positionAbsolute:
        x: 382
        y: 282
      selected: true
      sourcePosition: right
      targetPosition: left
      type: custom
      width: 242
    - data:
        items:
        - input_type: variable
          operation: over-write
          value:
          - '1779100736555'
          - result
          variable_selector:
          - conversation
          - nnumber_var
        selected: false
        title: 变量赋值
        type: assigner
        version: '2'
      height: 84
      id: '1779100777713'
      position:
        x: 684
        y: 282
      positionAbsolute:
        x: 684
        y: 282
      selected: false
      sourcePosition: right
      targetPosition: left
      type: custom
      width: 242
    viewport:
      x: -56.28846230288684
      y: -78.32861285925742
      zoom: 0.8705505632961241
  rag_pipeline_variables: []

✔️ Expected Behavior

No error raised.

❌ Actual Behavior

「not supported value type integer」 <img width="1521" height="699" alt="Image" src="https://github.com/user-attachments/assets/6b4afdac-4bb9-4e37-b66e-9b06b39312ca" />

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

dify - 💡(How to fix) Fix Error: not supported value type integer because cannot init a float var [1 pull requests]