app:
  description: 用 Code 工具精算房貸，再由 LLM 白話解讀並給建議。
  icon: 🏦
  icon_background: '#DBEAFE'
  icon_type: emoji
  mode: workflow
  name: 房貸試算與理財建議
  use_icon_as_answer_icon: false
dependencies:
- current_identifier: null
  type: marketplace
  value:
    marketplace_plugin_unique_identifier: langgenius/anthropic:0.3.24@c5e50da8c13c7ac75348df5ac75b9418c79736eb506064669dd7ca06cbd83537
    version: null
kind: app
version: 0.6.0
workflow:
  conversation_variables: []
  environment_variables: []
  features:
    file_upload:
      allowed_file_extensions:
      - .JPG
      allowed_file_types:
      - image
      allowed_file_upload_methods:
      - local_file
      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
      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: tool
      id: 22s-22tool
      source: 22s
      sourceHandle: source
      target: 22tool
      targetHandle: target
      type: custom
      zIndex: 0
    - data:
        isInIteration: false
        isInLoop: false
        sourceType: tool
        targetType: llm
      id: 22tool-22l
      source: 22tool
      sourceHandle: source
      target: 22l
      targetHandle: target
      type: custom
      zIndex: 0
    - data:
        isInIteration: false
        isInLoop: false
        sourceType: llm
        targetType: end
      id: 22l-22e
      source: 22l
      sourceHandle: source
      target: 22e
      targetHandle: target
      type: custom
      zIndex: 0
    nodes:
    - data:
        selected: false
        title: 開始
        type: start
        variables:
        - default: ''
          hint: ''
          label: 貸款金額(元)
          options: []
          placeholder: 例：10000000
          required: true
          type: number
          variable: principal
        - default: ''
          hint: ''
          label: 年利率(%)
          options: []
          placeholder: 例：2.1
          required: true
          type: number
          variable: rate
        - default: ''
          hint: ''
          label: 貸款年數
          options: []
          placeholder: 例：30
          required: true
          type: number
          variable: years
      height: 150
      id: 22s
      position:
        x: 60
        y: 282
      positionAbsolute:
        x: 60
        y: 282
      selected: false
      sourcePosition: right
      targetPosition: left
      type: custom
      width: 244
    - data:
        provider_id: code
        provider_name: code
        provider_type: builtin
        selected: false
        title: Code 精算
        tool_configurations: {}
        tool_label: Code Interpreter
        tool_name: simple_code
        tool_node_version: '2'
        tool_parameters:
          code:
            type: mixed
            value: "p=float(\"{{#22s.principal#}}\")\nr=float(\"{{#22s.rate#}}\")/100/12\n\
              n=int(\"{{#22s.years#}}\")*12\nif r==0:\n    m=p/n\nelse:\n    m=p*r*(1+r)**n/((1+r)**n-1)\n\
              total=m*n\nprint(f\"每月應繳本息：{m:,.0f} 元\")\nprint(f\"還款期數：{n} 期（{n//12}\
              \ 年）\")\nprint(f\"總還款金額：{total:,.0f} 元\")\nprint(f\"總利息支出：{total-p:,.0f}\
              \ 元\")\nprint(f\"利息佔本金比例：{(total-p)/p*100:.1f}%\")\n"
          language:
            type: constant
            value: python3
        type: tool
      height: 120
      id: 22tool
      position:
        x: 360
        y: 282
      positionAbsolute:
        x: 360
        y: 282
      selected: true
      sourcePosition: right
      targetPosition: left
      type: custom
      width: 244
    - data:
        context:
          enabled: false
          variable_selector: []
        model:
          completion_params:
            temperature: 0.3
          mode: chat
          name: claude-sonnet-5
          provider: langgenius/anthropic/anthropic
        prompt_template:
        - id: s22
          role: system
          text: '你是貸款理財顧問。下方是系統用精算工具算出的房貸試算結果（數字精確、請勿改動）。

            請用白話向使用者解讀，並給出 2-3 點實用建議（例如利息佔比觀察、可否考慮縮短年限或提前還款的取捨），一律使用繁體中文與 Markdown。


            【精算結果】

            {{#22tool.text#}}


            輸入條件：貸款 {{#22s.principal#}} 元、年利率 {{#22s.rate#}}%、{{#22s.years#}} 年。'
        - id: u22
          role: user
          text: 請解讀這份試算並給建議。
        selected: false
        title: LLM 解讀
        type: llm
        vision:
          enabled: false
      height: 98
      id: 22l
      position:
        x: 660
        y: 282
      positionAbsolute:
        x: 660
        y: 282
      selected: false
      sourcePosition: right
      targetPosition: left
      type: custom
      width: 244
    - data:
        outputs:
        - value_selector:
          - 22tool
          - text
          value_type: string
          variable: calc
        - value_selector:
          - 22l
          - text
          value_type: string
          variable: advice
        selected: false
        title: 輸出
        type: end
      height: 120
      id: 22e
      position:
        x: 960
        y: 282
      positionAbsolute:
        x: 960
        y: 282
      selected: false
      sourcePosition: right
      targetPosition: left
      type: custom
      width: 244
    viewport:
      x: 20
      y: 40
      zoom: 0.85
  rag_pipeline_variables: []
