[google] Error: PluginInvokeError: {"args":{"description":"[models] Error: name 'time' is not defined"},"error_type":"InvokeError","message":"[models] Error: name 'time' is not defined"} #8906

Closed
opened 2026-02-21 18:28:31 -05:00 by yindo · 6 comments
Owner

Originally created by @yj11 on GitHub (Mar 3, 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

LLM

Cloud or Self Hosted

Self Hosted (Source)

Steps to reproduce

Image

✔️ Expected Behavior

No response

Actual Behavior

No response

Originally created by @yj11 on GitHub (Mar 3, 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 LLM ### Cloud or Self Hosted Self Hosted (Source) ### Steps to reproduce ![Image](https://github.com/user-attachments/assets/87f61f22-51f8-4166-ba0e-87ba958410c7) ### ✔️ Expected Behavior _No response_ ### ❌ Actual Behavior _No response_
yindo added the 🐞 buggood first issue labels 2026-02-21 18:28:31 -05:00
yindo closed this issue 2026-02-21 18:28:31 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Mar 3, 2025):

@yj11 Hello there! I'm here to assist you with any bugs, questions, or contributions you might have. Let's work together to solve this issue.

The error message "name 'time' is not defined" suggests that the time module is not imported in the code where it is being used. In the Dify codebase, the time module is typically imported at the beginning of the plugin code. Here's an example of how it should be imported:

import time

Make sure that this import statement is present at the top of the file where the time module is being used. This should resolve the "name 'time' is not defined" error [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

@dosubot[bot] commented on GitHub (Mar 3, 2025): <!-- Greeting --> @yj11 Hello there! I'm here to assist you with any bugs, questions, or contributions you might have. Let's work together to solve this issue. <!-- Answer --> The error message "name 'time' is not defined" suggests that the `time` module is not imported in the code where it is being used. In the Dify codebase, the `time` module is typically imported at the beginning of the plugin code. Here's an example of how it should be imported: ```python import time ``` Make sure that this import statement is present at the top of the file where the `time` module is being used. This should resolve the "name 'time' is not defined" error <sup>[[1]](https://github.com/langgenius/dify-docs/blob/main/jp/plugins/quick-start/develop-plugins/agent-strategy-plugin.md)</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/2f65d837-25f2-4f0c-9c40-16cc169bb926?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/2f65d837-25f2-4f0c-9c40-16cc169bb926?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/2f65d837-25f2-4f0c-9c40-16cc169bb926?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/2f65d837-25f2-4f0c-9c40-16cc169bb926?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/2f65d837-25f2-4f0c-9c40-16cc169bb926?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/2f65d837-25f2-4f0c-9c40-16cc169bb926?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/2f65d837-25f2-4f0c-9c40-16cc169bb926?feedback_type=other)</sup>
Author
Owner

@crazywoola commented on GitHub (Mar 3, 2025):

Please provide the DSL.

@crazywoola commented on GitHub (Mar 3, 2025): Please provide the DSL.
Author
Owner

@yj11 commented on GitHub (Mar 3, 2025):

Please provide the DSL.

app:
  description: ''
  icon: 🤖
  icon_background: '#FFEAD5'
  mode: workflow
  name: test_yj
  use_icon_as_answer_icon: false
dependencies:
- current_identifier: null
  type: marketplace
  value:
    marketplace_plugin_unique_identifier: langgenius/openai:0.0.10@db48346a4cfa3b510b94b5e4a72cc44a575b4e479e8e7c1e3f9ba3edca96b668
kind: app
version: 0.1.5
workflow:
  conversation_variables: []
  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:
        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: 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
        sourceType: llm
        targetType: end
      id: 1740645789806-source-1740645794697-target
      source: '1740645789806'
      sourceHandle: source
      target: '1740645794697'
      targetHandle: target
      type: custom
      zIndex: 0
    - data:
        isInIteration: false
        sourceType: start
        targetType: llm
      id: 1740645782254-source-1740645789806-target
      source: '1740645782254'
      sourceHandle: source
      target: '1740645789806'
      targetHandle: target
      type: custom
      zIndex: 0
    nodes:
    - data:
        desc: ''
        selected: false
        title: start
        type: start
        variables:
        - allowed_file_extensions: []
          allowed_file_types:
          - image
          - video
          - document
          allowed_file_upload_methods:
          - local_file
          - remote_url
          label: pdf2
          max_length: 48
          options: []
          required: true
          type: file
          variable: pdf2
      height: 90
      id: '1740645782254'
      position:
        x: 82
        y: 282
      positionAbsolute:
        x: 82
        y: 282
      selected: false
      sourcePosition: right
      targetPosition: left
      type: custom
      width: 244
    - data:
        context:
          enabled: false
          variable_selector: []
        desc: ''
        model:
          completion_params:
            temperature: 0.7
          mode: chat
          name: gpt-4o-mini
          provider: langgenius/openai/openai
        prompt_template:
        - id: 96cba20a-0732-42e1-a1b2-d20e08be452c
          role: system
          text: please extract date and place
        - id: d95b4acf-95e4-4a2d-a0de-954fbedfd44f
          role: user
          text: '{{#1740645782254.pdf2#}}'
        selected: false
        title: LLM
        type: llm
        variables: []
        vision:
          enabled: false
      height: 90
      id: '1740645789806'
      position:
        x: 384
        y: 282
      positionAbsolute:
        x: 384
        y: 282
      selected: false
      sourcePosition: right
      targetPosition: left
      type: custom
      width: 244
    - data:
        desc: ''
        outputs:
        - value_selector:
          - '1740645789806'
          - text
          variable: text
        selected: false
        title: end
        type: end
      height: 90
      id: '1740645794697'
      position:
        x: 688
        y: 282
      positionAbsolute:
        x: 688
        y: 282
      selected: false
      sourcePosition: right
      targetPosition: left
      type: custom
      width: 244
    viewport:
      x: 218.11186765015736
      y: 280.21557454861943
      zoom: 0.5620318821143135
@yj11 commented on GitHub (Mar 3, 2025): > Please provide the DSL. ``` app: description: '' icon: 🤖 icon_background: '#FFEAD5' mode: workflow name: test_yj use_icon_as_answer_icon: false dependencies: - current_identifier: null type: marketplace value: marketplace_plugin_unique_identifier: langgenius/openai:0.0.10@db48346a4cfa3b510b94b5e4a72cc44a575b4e479e8e7c1e3f9ba3edca96b668 kind: app version: 0.1.5 workflow: conversation_variables: [] 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: 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: 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 sourceType: llm targetType: end id: 1740645789806-source-1740645794697-target source: '1740645789806' sourceHandle: source target: '1740645794697' targetHandle: target type: custom zIndex: 0 - data: isInIteration: false sourceType: start targetType: llm id: 1740645782254-source-1740645789806-target source: '1740645782254' sourceHandle: source target: '1740645789806' targetHandle: target type: custom zIndex: 0 nodes: - data: desc: '' selected: false title: start type: start variables: - allowed_file_extensions: [] allowed_file_types: - image - video - document allowed_file_upload_methods: - local_file - remote_url label: pdf2 max_length: 48 options: [] required: true type: file variable: pdf2 height: 90 id: '1740645782254' position: x: 82 y: 282 positionAbsolute: x: 82 y: 282 selected: false sourcePosition: right targetPosition: left type: custom width: 244 - data: context: enabled: false variable_selector: [] desc: '' model: completion_params: temperature: 0.7 mode: chat name: gpt-4o-mini provider: langgenius/openai/openai prompt_template: - id: 96cba20a-0732-42e1-a1b2-d20e08be452c role: system text: please extract date and place - id: d95b4acf-95e4-4a2d-a0de-954fbedfd44f role: user text: '{{#1740645782254.pdf2#}}' selected: false title: LLM type: llm variables: [] vision: enabled: false height: 90 id: '1740645789806' position: x: 384 y: 282 positionAbsolute: x: 384 y: 282 selected: false sourcePosition: right targetPosition: left type: custom width: 244 - data: desc: '' outputs: - value_selector: - '1740645789806' - text variable: text selected: false title: end type: end height: 90 id: '1740645794697' position: x: 688 y: 282 positionAbsolute: x: 688 y: 282 selected: false sourcePosition: right targetPosition: left type: custom width: 244 viewport: x: 218.11186765015736 y: 280.21557454861943 zoom: 0.5620318821143135 ```
Author
Owner

@yj11 commented on GitHub (Mar 3, 2025):

I use video .mp4

@yj11 commented on GitHub (Mar 3, 2025): I use video .mp4
Author
Owner

@yj11 commented on GitHub (Mar 3, 2025):

@crazywoola Please check this bug, thanks

@yj11 commented on GitHub (Mar 3, 2025): @crazywoola Please check this bug, thanks
Author
Owner

@crazywoola commented on GitHub (Mar 5, 2025):

Fixed in https://github.com/langgenius/dify-official-plugins/pull/372

@crazywoola commented on GitHub (Mar 5, 2025): Fixed in https://github.com/langgenius/dify-official-plugins/pull/372
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#8906