Cline+DeepSeekでDifyのymlの仕様書を抜き出す
お疲れ様です波浪です。
今日は Difyの共通仕様をClineで抜き出してもらいます。
前日のClineからDeepSeekを使えるようにした記事はこちら
まずDifyのテンプレート生成から適当にワークフローを作り、複数のymlファイルを作成します。

テンプレートから適当に生成したワークフローをexportして一つのディレクトリに集めます。
そこでCline(Deepseek chat)さんに
カレントディレクトリにあるymlは全てDifyのワークフローのymlです。
これらのファイルからDifyのワークフローの共通して書かれている仕様を抜き出してください、
つまり必ず指定されている項目は何か、
どのような形式で入っているか、
それらを抜き出してDifyワークフローのスケルトンymlと
別ファイルとして仕様の書かれたMarkdownを生成して書き出してください。
みたいな雑な指示をなげつけます
.
.
.

Oh...ファイルが多すぎたみたいですね
auto approveの許容数を伸ばしつつカレントディレクトリのファイルも減らしておきましょう。

↑一番下のところがauto approve可能な数です。自分は$2しか入れてないので最悪使い込まれてもいいやのお気持ちなので適当に増やしてます。
はい、では再実行
.
.
.
はい、2ファイルできましたね
スケルトンyml
app:
description: ''
icon: ''
icon_background: ''
mode: workflow
name: ''
use_icon_as_answer_icon: false
kind: app
version: 0.1.5
workflow:
conversation_variables: []
environment_variables: []
features:
file_upload:
image:
enabled: false
number_limits: 3
transfer_methods:
- local_file
- remote_url
opening_statement: ''
retriever_resource:
enabled: false
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: []
nodes: []
仕様.md
Dify Workflow Specification
Overview
Dify workflows are defined using YAML files with a specific structure. This document outlines the required fields and common configurations.
Required Fields
Top-Level Fields
-
app: Application metadata -
kind: Must be "app" -
version: Version number (e.g., 0.1.5) -
workflow: Contains the workflow configuration
App Section
-
description: Short description of the workflow -
icon: Emoji or icon identifier -
icon_background: Hex color code -
mode: Must be "workflow" -
name: Workflow name -
use_icon_as_answer_icon: Boolean flag
Workflow Section
-
conversation_variables: List of conversation variables -
environment_variables: List of environment variables -
features: Feature configurations -
graph: Workflow logic definition
Features Configuration
The features section contains optional configurations with default values:
features:
file_upload:
image:
enabled: false
number_limits: 3
transfer_methods:
- local_file
- remote_url
opening_statement: ''
retriever_resource:
enabled: false
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: ''
Workflow Graph
The graph section defines the workflow logic using nodes and edges:
graph:
edges: [] # Connections between nodes
nodes: [] # Workflow components
Node Types
-
start: Entry point -
end: Exit point -
llm: Language model node -
tool: External tool integration
Example Workflow
See the skeleton template for a complete example:
# See dify_workflow_skeleton.yml
Versioning
Workflows should specify their version number. Current version: 0.1.5
ついでに
Dify Workflow Specification を日本語訳した
Dify Workflow Specification jp を新規ファイルで作成
で日本語版も作ってもらいます。
仕様.jp.md
Difyワークフロー仕様書
概要
Difyワークフローは特定の構造を持つYAMLファイルで定義されます。このドキュメントでは必須フィールドと一般的な設定について説明します。
必須フィールド
トップレベルフィールド
-
app: アプリケーションメタデータ -
kind: "app"を指定 -
version: バージョン番号 (例: 0.1.5) -
workflow: ワークフロー設定を含む
Appセクション
-
description: ワークフローの簡単な説明 -
icon: 絵文字またはアイコン識別子 -
icon_background: 16進数カラーコード -
mode: "workflow"を指定 -
name: ワークフロー名 -
use_icon_as_answer_icon: 真偽値フラグ
Workflowセクション
-
conversation_variables: 会話変数のリスト -
environment_variables: 環境変数のリスト -
features: 機能設定 -
graph: ワークフローロジック定義
機能設定
featuresセクションにはデフォルト値を持つオプション設定が含まれます:
features:
file_upload:
image:
enabled: false
number_limits: 3
transfer_methods:
- local_file
- remote_url
opening_statement: ''
retriever_resource:
enabled: false
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セクションはノードとエッジを使用してワークフローロジックを定義します:
graph:
edges: [] # ノード間の接続
nodes: [] # ワークフローコンポーネント
ノードタイプ
-
start: 開始点 -
end: 終了点 -
llm: 言語モデルノード -
tool: 外部ツール統合
ワークフロー例
完全な例についてはスケルトンテンプレートを参照:
# dify_workflow_skeleton.ymlを参照
バージョン管理
ワークフローはバージョン番号を指定する必要があります。現在のバージョン: 0.1.5
所要時間5分くらいでここまでいけましたね、ううむ...叩き台としては十分すぎますね。
猫ですらさっき用意した朝のご飯を食べ終わってない...
このはじめのとっかかりをやるのが面倒でやってないことってたくさんあるんですが、今後はとっかかり部分はこいつがやってくれちゃうから、やらない理由を「初動の運動量を稼ぐのが辛い」以外に用意しないと言い訳ができなくなっちゃいますね。
はー2025年は今までより頑張らないと、年末に今年はがんばったなーって言えなくなりますねほんま。
Discussion