langgenius / dify

Dify is an open-source LLM app development platform. Dify's intuitive interface combines AI workflow, RAG pipeline, agent capabilities, model management, observability features and more, letting you quickly go from prototype to production.
https://dify.ai
Other
48.26k stars 6.9k forks source link

Application error: a client-side exception has occurred (see the browser console for more information). #6765

Closed delvin-sparkle closed 2 months ago

delvin-sparkle commented 2 months ago

Self Checks

Dify version

v0.6.15

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

I deployed a Dify setup using Docker Compose. When I access http://localhost/apps, I can access all the workflows. However, when I try to access one specific workflow, I encounter the error:

Application error: a client-side exception has occurred (see the browser console for more information).

This error only occurs for one workflow, while the others are functioning normally. I checked the browser console, and the error message is as follows:

1 2

✔️ Expected Behavior

the workflow works

❌ Actual Behavior

Application error: a client-side exception has occurred (see the browser console for more information).

dosubot[bot] commented 2 months ago

Hey @delvin-sparkle! 👋 I'm here to help you with bugs, questions, and becoming a contributor. Let's tackle this issue together while we wait for a human maintainer to assist us.

The error TypeError: e.split is not a function typically occurs when the split method is called on a variable that is not a string. Here are some steps to mitigate this issue:

  1. Ensure e is a String: Before calling split, check if e is a string.

    if (typeof e === 'string') {
        e.split('delimiter');
    } else {
        // Handle the case where e is not a string
    }
  2. Check for Null or Undefined: Ensure e is not null or undefined before calling split.

    if (e != null && typeof e === 'string') {
        e.split('delimiter');
    } else {
        // Handle the case where e is null or undefined
    }

These checks can help prevent the TypeError by ensuring that split is only called on valid string values [1].

Additionally, you might want to review the specific workflow data to ensure that all expected string fields are correctly populated and not null or undefined. This can help identify any data inconsistencies that might be causing the issue.

To continue talking to Dosu, mention @dosu.

crazywoola commented 2 months ago

Please provide an example DSL here. We will take a look at this later.

delvin-sparkle commented 2 months ago

DSL:

app:
  description: 'Tarot Game bot in Prompt Inc AI.

    Platforms: Twitter (@starrybookapp) & TG'
  icon: "\U0001F916"
  icon_background: '#D1E9FF'
  mode: advanced-chat
  name: Tarot Game DM
kind: app
version: 0.1.0
workflow:
  environment_variables: []
  features:
    file_upload:
      image:
        enabled: false
        number_limits: 3
        transfer_methods:
        - local_file
        - remote_url
    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: start
        targetType: llm
      id: 1722154838779-source-1722155515536-target
      source: '1722154838779'
      sourceHandle: source
      target: '1722155515536'
      targetHandle: target
      type: custom
      zIndex: 0
    - data:
        isInIteration: false
        sourceType: llm
        targetType: if-else
      id: 1722155515536-source-1722156415937-target
      source: '1722155515536'
      sourceHandle: source
      target: '1722156415937'
      targetHandle: target
      type: custom
      zIndex: 0
    - data:
        isInIteration: false
        sourceType: if-else
        targetType: tool
      id: 1722156415937-true-1722158746894-target
      source: '1722156415937'
      sourceHandle: 'true'
      target: '1722158746894'
      targetHandle: target
      type: custom
      zIndex: 0
    - data:
        isInIteration: false
        sourceType: if-else
        targetType: tool
      id: 1722156415937-e3a1846f-ea31-41e3-9212-69c033862889-1722158844159-target
      source: '1722156415937'
      sourceHandle: e3a1846f-ea31-41e3-9212-69c033862889
      target: '1722158844159'
      targetHandle: target
      type: custom
      zIndex: 0
    - data:
        isInIteration: false
        sourceType: if-else
        targetType: answer
      id: 1722156415937-f4b3e273-d6c0-4d26-b4db-dfecea7c0f3b-1722158883812-target
      source: '1722156415937'
      sourceHandle: f4b3e273-d6c0-4d26-b4db-dfecea7c0f3b
      target: '1722158883812'
      targetHandle: target
      type: custom
      zIndex: 0
    - data:
        isInIteration: false
        sourceType: if-else
        targetType: answer
      id: 1722156415937-36d6a5dc-ecc4-4d6b-a39a-fda90299d8e0-1722158892900-target
      source: '1722156415937'
      sourceHandle: 36d6a5dc-ecc4-4d6b-a39a-fda90299d8e0
      target: '1722158892900'
      targetHandle: target
      type: custom
      zIndex: 0
    - data:
        isInIteration: false
        sourceType: if-else
        targetType: answer
      id: 1722156415937-72d2340c-ba1d-4523-9349-1112b7142073-1722158900298-target
      source: '1722156415937'
      sourceHandle: 72d2340c-ba1d-4523-9349-1112b7142073
      target: '1722158900298'
      targetHandle: target
      type: custom
      zIndex: 0
    - data:
        isInIteration: false
        sourceType: if-else
        targetType: answer
      id: 1722156415937-d8b9c50e-c2b8-431b-8139-a79f2863d021-1722158907426-target
      source: '1722156415937'
      sourceHandle: d8b9c50e-c2b8-431b-8139-a79f2863d021
      target: '1722158907426'
      targetHandle: target
      type: custom
      zIndex: 0
    - data:
        isInIteration: false
        sourceType: if-else
        targetType: answer
      id: 1722156415937-f4ad167f-209e-435c-b878-1d93c3921c94-1722158913312-target
      source: '1722156415937'
      sourceHandle: f4ad167f-209e-435c-b878-1d93c3921c94
      target: '1722158913312'
      targetHandle: target
      type: custom
      zIndex: 0
    - data:
        isInIteration: false
        sourceType: if-else
        targetType: answer
      id: 1722156415937-4cbdfc23-4440-4a16-9909-1dccc591c83f-1722158919884-target
      source: '1722156415937'
      sourceHandle: 4cbdfc23-4440-4a16-9909-1dccc591c83f
      target: '1722158919884'
      targetHandle: target
      type: custom
      zIndex: 0
    - data:
        isInIteration: false
        sourceType: if-else
        targetType: answer
      id: 1722156415937-false-1722158926002-target
      source: '1722156415937'
      sourceHandle: 'false'
      target: '1722158926002'
      targetHandle: target
      type: custom
      zIndex: 0
    - data:
        isInIteration: false
        sourceType: tool
        targetType: code
      id: 1722158746894-source-1722168774441-target
      source: '1722158746894'
      sourceHandle: source
      target: '1722168774441'
      targetHandle: target
      type: custom
      zIndex: 0
    - data:
        isInIteration: false
        sourceType: code
        targetType: if-else
      id: 1722168774441-source-1722170023759-target
      source: '1722168774441'
      sourceHandle: source
      target: '1722170023759'
      targetHandle: target
      type: custom
      zIndex: 0
    - data:
        isInIteration: false
        sourceType: if-else
        targetType: answer
      id: 1722170023759-true-1722169803437-target
      source: '1722170023759'
      sourceHandle: 'true'
      target: '1722169803437'
      targetHandle: target
      type: custom
      zIndex: 0
    - data:
        isInIteration: false
        sourceType: if-else
        targetType: answer
      id: 1722170023759-false-1722170079186-target
      source: '1722170023759'
      sourceHandle: 'false'
      target: '1722170079186'
      targetHandle: target
      type: custom
      zIndex: 0
    - data:
        isInIteration: false
        sourceType: tool
        targetType: code
      id: 1722158844159-source-1722170178743-target
      source: '1722158844159'
      sourceHandle: source
      target: '1722170178743'
      targetHandle: target
      type: custom
      zIndex: 0
    - data:
        isInIteration: false
        sourceType: code
        targetType: if-else
      id: 1722170178743-source-1722170155664-target
      source: '1722170178743'
      sourceHandle: source
      target: '1722170155664'
      targetHandle: target
      type: custom
      zIndex: 0
    - data:
        isInIteration: false
        sourceType: if-else
        targetType: answer
      id: 1722170155664-true-1722170256689-target
      source: '1722170155664'
      sourceHandle: 'true'
      target: '1722170256689'
      targetHandle: target
      type: custom
      zIndex: 0
    - data:
        isInIteration: false
        sourceType: if-else
        targetType: answer
      id: 1722170155664-false-1722170308023-target
      source: '1722170155664'
      sourceHandle: 'false'
      target: '1722170308023'
      targetHandle: target
      type: custom
      zIndex: 0
    nodes:
    - data:
        desc: ''
        selected: false
        title: Start
        type: start
        variables:
        - label: Enable Financial Question
          max_length: 48
          options:
          - enabled
          - disabled
          required: true
          type: text-input
          variable: enable_financial_question
      height: 90
      id: '1722154838779'
      position:
        x: 79.09209800642338
        y: 282
      positionAbsolute:
        x: 79.09209800642338
        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: openai
        prompt_template:
        - id: 54f6913c-894e-4696-b9f2-e8ac975dc0ff
          role: system
          text: "### Command Classifier\n**Role:** Command Classifier for Tarot Check-In\
            \ Game\n**Background:** As the command classifier, your role is to understand\
            \ and classify user inputs into appropriate commands for the tarot game.\
            \ You are familiar with the game rules, mechanics, and available commands.\n\
            \n### Commands List\n1. **draw (non-specific)**: Draw a daily tarot card\
            \ without a specific question.\n   - Note: This command should be triggered\
            \ by any regular tarot question or daily check-in requests without a specific\
            \ question.\n2. **draw (specific)**: Draw a tarot card for a specific\
            \ question.\n   - Note: This command should be triggered by tarot questions\
            \ that include specific inquiries or concerns.\n3. **show cards**: List\
            \ all collected cards.\n4. **upgrade [card]**: Upgrade a card by consuming\
            \ duplicates and resources.\n5. **set lineup [cards]**: Set the 10 cards\
            \ for battles.\n   - Note: set lineup [card1, card2, card3, ...]\n6. **battle**:\
            \ Start a PVP battle with a random opponent.\n7. **status**: Show status,\
            \ including collected cards, most recent activities, and active lineup.\n\
            8. **help**: List rules, available commands and their usage.\n9. **others**:\
            \ Handle unclassified queries.\n\n### Input Format\nYou will receive player\
            \ inputs in plain text. Your task is to classify these inputs into the\
            \ appropriate command from the list above.\n\n### Example Input and Output\n\
            **Input:**\n\"Show me my cards.\"\n**Output:**\nshow cards\n\n**Input:**\n\
            \"Can you do a daily check-in for me?\"\n**Output:**\ndraw (non-specific)\n\
            \n**Input:**\n\"What does my tarot say today?\"\n**Output:**\ndraw (non-specific)\n\
            \n**Input:**\n\"Should I invest in this project?\"\n**Output:**\ndraw\
            \ (specific)\n\n**Input:**\n\"Help me understand the game rules.\"\n**Output:**\n\
            help\n\n**Input:**\n\"I want to upgrade my card The Fool.\"\n**Output:**\n\
            upgrade [The Fool]\n\n**Input:**\n\"Set my lineup to The Fool, The Magician,\
            \ and The High Priestess.\"\n**Output:**\nset lineup [The Fool, The Magician,\
            \ The High Priestess]"
        - id: 02ee30c1-a67d-4893-a371-9a09c1ca65d9
          role: user
          text: '{{#sys.query#}}'
        selected: false
        title: Command Classifier
        type: llm
        variables: []
        vision:
          configs:
            detail: high
          enabled: true
      height: 98
      id: '1722155515536'
      position:
        x: 377.1154153134882
        y: 282
      positionAbsolute:
        x: 377.1154153134882
        y: 282
      selected: false
      sourcePosition: right
      targetPosition: left
      type: custom
      width: 244
    - data:
        cases:
        - case_id: 'true'
          conditions:
          - comparison_operator: is
            id: 7c8733f7-2c87-4e08-95b7-f08aaadafc11
            value: draw (non-specific)
            varType: string
            variable_selector:
            - '1722155515536'
            - text
          id: 'true'
          logical_operator: and
        - case_id: e3a1846f-ea31-41e3-9212-69c033862889
          conditions:
          - comparison_operator: is
            id: 6878a9fb-ba0b-409a-9eac-99d17f36ae6e
            value: draw (specific)
            varType: string
            variable_selector:
            - '1722155515536'
            - text
          id: e3a1846f-ea31-41e3-9212-69c033862889
          logical_operator: and
        - case_id: f4b3e273-d6c0-4d26-b4db-dfecea7c0f3b
          conditions:
          - comparison_operator: is
            id: e3db06f5-3a75-4cf8-8586-59637e44cd9a
            value: show cards
            varType: string
            variable_selector:
            - '1722155515536'
            - text
          id: f4b3e273-d6c0-4d26-b4db-dfecea7c0f3b
          logical_operator: and
        - case_id: 36d6a5dc-ecc4-4d6b-a39a-fda90299d8e0
          conditions:
          - comparison_operator: start with
            id: 6a0c230f-d045-47d9-a51c-0f4b7e7faa9d
            value: upgrade
            varType: string
            variable_selector:
            - '1722155515536'
            - text
          id: 36d6a5dc-ecc4-4d6b-a39a-fda90299d8e0
          logical_operator: and
        - case_id: 72d2340c-ba1d-4523-9349-1112b7142073
          conditions:
          - comparison_operator: start with
            id: e6c93c2a-f9b9-4129-b917-fe9c2a03c459
            value: set lineup
            varType: string
            variable_selector:
            - '1722155515536'
            - text
          id: 72d2340c-ba1d-4523-9349-1112b7142073
          logical_operator: and
        - case_id: d8b9c50e-c2b8-431b-8139-a79f2863d021
          conditions:
          - comparison_operator: is
            id: 4782f166-cc47-4169-ae4e-18045c32bcdd
            value: battle
            varType: string
            variable_selector:
            - '1722155515536'
            - text
          id: d8b9c50e-c2b8-431b-8139-a79f2863d021
          logical_operator: and
        - case_id: f4ad167f-209e-435c-b878-1d93c3921c94
          conditions:
          - comparison_operator: is
            id: e7e1df75-1c29-4758-bec0-ef946d2b69e5
            value: status
            varType: string
            variable_selector:
            - '1722155515536'
            - text
          id: f4ad167f-209e-435c-b878-1d93c3921c94
          logical_operator: and
        - case_id: 4cbdfc23-4440-4a16-9909-1dccc591c83f
          conditions:
          - comparison_operator: is
            id: 53243211-3fed-4d3c-9904-68d8d36de48e
            value: help
            varType: string
            variable_selector:
            - '1722155515536'
            - text
          id: 4cbdfc23-4440-4a16-9909-1dccc591c83f
          logical_operator: and
        desc: ''
        selected: false
        title: IF/ELSE
        type: if-else
      height: 462
      id: '1722156415937'
      position:
        x: 681.016972754338
        y: 282
      positionAbsolute:
        x: 681.016972754338
        y: 282
      selected: false
      sourcePosition: right
      targetPosition: left
      type: custom
      width: 244
    - data:
        desc: ''
        provider_id: 60a44030-660e-4064-8ed6-10d2ab9b928a
        provider_name: Simple Tarot Draw
        provider_type: workflow
        selected: true
        title: Simple Tarot Draw
        tool_configurations: {}
        tool_label: Simple Tarot Draw
        tool_name: draw_tarot_tool
        tool_parameters:
          enable_financial_question:
            type: variable
            value:
            - '1722154838779'
            - enable_financial_question
          question:
            type: mixed
            value: What does my tarot say today?
        type: tool
      height: 54
      id: '1722158746894'
      position:
        x: 1000.7199096117981
        y: 92.25617963902397
      positionAbsolute:
        x: 1000.7199096117981
        y: 92.25617963902397
      selected: true
      sourcePosition: right
      targetPosition: left
      type: custom
      width: 244
    - data:
        desc: ''
        provider_id: 60a44030-660e-4064-8ed6-10d2ab9b928a
        provider_name: Simple Tarot Draw
        provider_type: workflow
        selected: false
        title: Simple Tarot Draw
        tool_configurations: {}
        tool_label: Simple Tarot Draw
        tool_name: draw_tarot_tool
        tool_parameters:
          enable_financial_question:
            type: variable
            value:
            - '1722154838779'
            - enable_financial_question
          question:
            type: mixed
            value: '{{#sys.query#}}'
        type: tool
      height: 54
      id: '1722158844159'
      position:
        x: 1000.7199096117981
        y: 229.74783406849417
      positionAbsolute:
        x: 1000.7199096117981
        y: 229.74783406849417
      selected: false
      sourcePosition: right
      targetPosition: left
      type: custom
      width: 244
    - data:
        answer: "{\n  \"user_query\": \"show cards\",\n  \"exec\": [\n    {\n    \
          \  \"action\": \"reply\",\n      \"message\": \"You can view your collected\
          \ cards soon. This feature is under development. Thanks for your patience!\"\
          \n    }\n  ]\n}"
        desc: ''
        selected: false
        title: Answer 3
        type: answer
        variables: []
      height: 184
      id: '1722158883812'
      position:
        x: 1000.7199096117981
        y: 318.45840105871554
      positionAbsolute:
        x: 1000.7199096117981
        y: 318.45840105871554
      selected: false
      sourcePosition: right
      targetPosition: left
      type: custom
      width: 244
    - data:
        answer: "{\n  \"user_query\": \"upgrade\",\n  \"exec\": [\n    {\n      \"\
          action\": \"reply\",\n      \"message\": \"You will soon be able to level\
          \ up your cards by forging. Stay tuned for update.\"\n    }\n  ]\n}"
        desc: ''
        selected: false
        title: Answer 4
        type: answer
        variables: []
      height: 168
      id: '1722158892900'
      position:
        x: 1000.7199096117981
        y: 528.5234142935013
      positionAbsolute:
        x: 1000.7199096117981
        y: 528.5234142935013
      selected: false
      sourcePosition: right
      targetPosition: left
      type: custom
      width: 244
    - data:
        answer: "{\n  \"user_query\": \"set lineup\",\n  \"exec\": [\n    {\n    \
          \  \"action\": \"reply\",\n      \"message\": \"You will soon be able to\
          \ level up battle with others. Stay tuned for update.\"\n    }\n  ]\n}"
        desc: ''
        selected: false
        title: Answer 5
        type: answer
        variables: []
      height: 168
      id: '1722158900298'
      position:
        x: 1000.7199096117981
        y: 712.3053736257658
      positionAbsolute:
        x: 1000.7199096117981
        y: 712.3053736257658
      selected: false
      sourcePosition: right
      targetPosition: left
      type: custom
      width: 244
    - data:
        answer: "{\n  \"user_query\": \"battle\",\n  \"exec\": [\n    {\n      \"\
          action\": \"reply\",\n      \"message\": \"You will soon be able to level\
          \ up battle with others. Stay tuned for update.\"\n    }\n  ]\n}"
        desc: ''
        selected: false
        title: Answer 6
        type: answer
        variables: []
      height: 168
      id: '1722158907426'
      position:
        x: 1000.7199096117981
        y: 895.4683228448718
      positionAbsolute:
        x: 1000.7199096117981
        y: 895.4683228448718
      selected: false
      sourcePosition: right
      targetPosition: left
      type: custom
      width: 244
    - data:
        answer: "{\n  \"user_query\": \"status\",\n  \"exec\": [\n    {\n      \"\
          action\": \"reply\",\n      \"message\": \"Status checking is being developed.\
          \ Stay tuned for update.\"\n    }\n  ]\n}"
        desc: ''
        selected: false
        title: Answer 7
        type: answer
        variables: []
      height: 152
      id: '1722158913312'
      position:
        x: 1000.7199096117981
        y: 1074.2313319872383
      positionAbsolute:
        x: 1000.7199096117981
        y: 1074.2313319872383
      selected: false
      sourcePosition: right
      targetPosition: left
      type: custom
      width: 244
    - data:
        answer: "{\n  \"user_query\": \"help\",\n  \"exec\": [\n    {\n      \"action\"\
          : \"reply\",\n      \"message\": \"Please visit https://promptinc.sparkle.fun/\
          \ for help.\"\n    }\n  ]\n}"
        desc: ''
        selected: false
        title: Answer 8
        type: answer
        variables: []
      height: 152
      id: '1722158919884'
      position:
        x: 1000.7199096117981
        y: 1241.1940133451658
      positionAbsolute:
        x: 1000.7199096117981
        y: 1241.1940133451658
      selected: false
      sourcePosition: right
      targetPosition: left
      type: custom
      width: 244
    - data:
        answer: "{\n  \"user_query\": \"others\",\n  \"exec\": [\n    {\n      \"\
          action\": \"reply\",\n      \"message\": \"Hi, thanks for calling. But I\
          \ can't understand your question.\"\n    }\n  ]\n}"
        desc: ''
        selected: false
        title: Answer 9
        type: answer
        variables: []
      height: 152
      id: '1722158926002'
      position:
        x: 1000.7199096117981
        y: 1409.673653811274
      positionAbsolute:
        x: 1000.7199096117981
        y: 1409.673653811274
      selected: false
      sourcePosition: right
      targetPosition: left
      type: custom
      width: 244
    - data:
        code: "import json\nimport re\n\n# Function to remove direction from card\
          \ name\ndef extract_card_name(card_name):\n    return re.sub(r\" \\(.*\\\
          )\", \"\", card_name)\n\ndef main(arg1: str) -> dict:\n    obj = json.loads(arg1)\n\
          \    if 'interpretation' in obj:\n        return {\n            \"interpretation\"\
          : interpretation,\n            \"card1\": extract_card_name(obj['card1']),\n\
          \            \"card2\": extract_card_name(obj['card2']),\n            \"\
          card3\": extract_card_name(obj['card3']),\n            \"reason\": \"\"\
          ,\n            \"suggested_question\": \"\",\n        }\n    else:     \
          \   \n        return {\n            \"reason\": obj['reason'],\n       \
          \     \"suggested_question\": obj['suggested_question'],\n            \"\
          interpretation\": \"\",\n            \"card1\": \"\",\n            \"card2\"\
          : \"\",\n            \"card3\": \"\",\n        }"
        code_language: python3
        desc: ''
        outputs:
          card1:
            children: null
            type: string
          card2:
            children: null
            type: string
          card3:
            children: null
            type: string
          interpretation:
            children: null
            type: string
          reason:
            children: null
            type: string
          suggested_question:
            children: null
            type: string
        selected: false
        title: Code
        type: code
        variables:
        - value_selector:
          - '1722158746894'
          - text
          variable: arg1
      height: 54
      id: '1722168774441'
      position:
        x: 1304.7199096117981
        y: 92.25617963902397
      positionAbsolute:
        x: 1304.7199096117981
        y: 92.25617963902397
      selected: false
      sourcePosition: right
      targetPosition: left
      type: custom
      width: 244
    - data:
        answer: "{\n  \"user_query\": \"draw (non-specific)\",\n  \"exec\": [\n  \
          \  {\n      \"action\": \"receive_cards\",\n      \"cards\": [\"{{#1722168774441.card1#}}\"\
          , \"{{#1722168774441.card2#}}\", \"{{#1722168774441.card3#}}\"]\n    },\n\
          \    {\n      \"action\": \"reply\",\n      \"message\": \"{{#1722168774441.interpretation#}}\"\
          \n    }\n  ]\n}"
        desc: ''
        selected: false
        title: Answer 9
        type: answer
        variables: []
      height: 228
      id: '1722169803437'
      position:
        x: 2020.2135296211782
        y: -361.14179898341615
      positionAbsolute:
        x: 2020.2135296211782
        y: -361.14179898341615
      selected: false
      sourcePosition: right
      targetPosition: left
      type: custom
      width: 244
    - data:
        cases:
        - case_id: 'true'
          conditions:
          - comparison_operator: not empty
            id: 0400d296-e7d9-48b5-9a29-5c41893a1514
            value: ''
            varType: string
            variable_selector:
            - '1722168774441'
            - interpretation
          id: 'true'
          logical_operator: and
        desc: ''
        selected: false
        title: Valid Result - No Specific Question
        type: if-else
      height: 126
      id: '1722170023759'
      position:
        x: 1633.3165516569368
        y: 92.25617963902397
      positionAbsolute:
        x: 1633.3165516569368
        y: 92.25617963902397
      selected: false
      sourcePosition: right
      targetPosition: left
      type: custom
      width: 244
    - data:
        answer: "{\n  \"user_query\": \"draw (non-specific)\",\n  \"exec\": [\n  \
          \  {\n      \"action\": \"reply\",\n      \"message\": \"This question isn't\
          \ suited for tarot readings. Please try other question like:  {{#1722168774441.suggested_question#}}\"\
          \n    }\n  ]\n}"
        desc: ''
        selected: false
        title: Answer 10
        type: answer
        variables: []
      height: 187
      id: '1722170079186'
      position:
        x: 2020.2135296211782
        y: -115.97485122131951
      positionAbsolute:
        x: 2020.2135296211782
        y: -115.97485122131951
      selected: false
      sourcePosition: right
      targetPosition: left
      type: custom
      width: 244
    - data:
        cases:
        - case_id: 'true'
          conditions:
          - comparison_operator: not empty
            id: 63cb47c8-187a-41c2-8eae-18e9a73a0ae8
            value: ''
            varType: string
            variable_selector:
            - '1722170178743'
            - interpretation
          id: 'true'
          logical_operator: and
        desc: ''
        selected: false
        title: IF/ELSE 3
        type: if-else
      height: 126
      id: '1722170155664'
      position:
        x: 1633.3165516569368
        y: 229.74783406849417
      positionAbsolute:
        x: 1633.3165516569368
        y: 229.74783406849417
      selected: false
      sourcePosition: right
      targetPosition: left
      type: custom
      width: 244
    - data:
        code: "import json\nimport re\n\n# Function to remove direction from card\
          \ name\ndef extract_card_name(card_name):\n    return re.sub(r\" \\(.*\\\
          )\", \"\", card_name)\n\ndef main(arg1: str) -> dict:\n    obj = json.loads(arg1)\n\
          \    if 'interpretation' in obj:\n        return {\n            \"interpretation\"\
          : interpretation,\n            \"card1\": extract_card_name(obj['card1']),\n\
          \            \"card2\": extract_card_name(obj['card2']),\n            \"\
          card3\": extract_card_name(obj['card3']),\n            \"reason\": \"\"\
          ,\n            \"suggested_question\": \"\",\n        }\n    else:     \
          \   \n        return {\n            \"reason\": obj['reason'],\n       \
          \     \"suggested_question\": obj['suggested_question'],\n            \"\
          interpretation\": \"\",\n            \"card1\": \"\",\n            \"card2\"\
          : \"\",\n            \"card3\": \"\",\n        }"
        code_language: python3
        desc: ''
        outputs:
          card1:
            children: null
            type: string
          card2:
            children: null
            type: string
          card3:
            children: null
            type: string
          interpretation:
            children: null
            type: string
          reason:
            children: null
            type: string
          suggested_question:
            children: null
            type: string
        selected: false
        title: Code 2
        type: code
        variables:
        - value_selector:
          - '1722158844159'
          - text
          variable: arg1
      height: 54
      id: '1722170178743'
      position:
        x: 1304.7199096117981
        y: 229.74783406849417
      positionAbsolute:
        x: 1304.7199096117981
        y: 229.74783406849417
      selected: false
      sourcePosition: right
      targetPosition: left
      type: custom
      width: 244
    - data:
        answer: "{\n  \"user_query\": \"draw (specific)\",\n  \"exec\": [\n    {\n\
          \      \"action\": \"receive_cards\",\n      \"cards\": [\"{{#1722170178743.card1#}}\"\
          , \"{{#1722170178743.card2#}}\", \"{{#1722170178743.card3#}}\"]\n    },\n\
          \    {\n      \"action\": \"reply\",\n      \"message\": \"{{#1722170178743.interpretation#}}\"\
          \n    }\n  ]\n}"
        desc: ''
        selected: false
        title: Answer 10
        type: answer
        variables: []
      height: 212
      id: '1722170256689'
      position:
        x: 2020.2135296211782
        y: 60.85699860510002
      positionAbsolute:
        x: 2020.2135296211782
        y: 60.85699860510002
      selected: false
      sourcePosition: right
      targetPosition: left
      type: custom
      width: 244
    - data:
        answer: "{\n  \"user_query\": \"draw (specific)\",\n  \"exec\": [\n    {\n\
          \      \"action\": \"reply\",\n      \"message\": \"This question isn't\
          \ suited for tarot readings. Please try other question like: {{#1722170178743.suggested_question#}}\"\
          \n    }\n  ]\n}"
        desc: ''
        selected: false
        title: Answer 11
        type: answer
        variables: []
      height: 187
      id: '1722170308023'
      position:
        x: 2020.2135296211782
        y: 293.31839727729005
      positionAbsolute:
        x: 2020.2135296211782
        y: 293.31839727729005
      selected: false
      sourcePosition: right
      targetPosition: left
      type: custom
      width: 244
    viewport:
      x: -627.964226411987
      y: 46.771933227164254
      zoom: 0.8601887838451424
delvin-sparkle commented 2 months ago

Based on the error from the console, it seems that there is a configuration in the DSL that is causing an error during parsing by Dify.

image

image

It should normally be a string, but Dify is interpreting it as an array.

delvin-sparkle commented 2 months ago

We've been unable to operate this workflow on the Dify interface, and we're quite anxious about it. Thanks !!!

crazywoola commented 2 months ago

Can you try this in the Cloud version. @delvin-sparkle Can you provide the OpenAPI as well? The DSL you provided didn't show the errors above.