> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dify.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# ノード

> プラグインからパラメータ抽出ノードと質問分類ノードを呼び出す

> このドキュメントは AI によって自動翻訳されています。不正確な部分がある場合は、[英語版](/en/develop-plugin/features-and-specs/advanced-development/reverse-invocation-node) を参照してください。

プラグインは、Dify Chatflow/ワークフローアプリケーション内の特定のノードの機能を逆呼び出しできます。

プラグインは `ParameterExtractor` および `QuestionClassifier` ノードを呼び出せます。これらのノードは複雑なプロンプトとコードロジックをカプセル化しており、LLM を使ってハードコーディングされたルールでは解決が難しいタスクを処理します。

## パラメータ抽出ノードの呼び出し

### エントリーポイント

```python theme={null}
    self.session.workflow_node.parameter_extractor
```

### インターフェース

```python theme={null}
    def invoke(
        self,
        parameters: list[ParameterConfig],
        model: ModelConfig,
        query: str,
        instruction: str = "",
    ) -> NodeResponse
        pass
```

* **`parameters`**: 抽出するパラメータのリストです。
* **`model`**: `LLMModelConfig` 仕様に準拠します。
* **`query`**: パラメータ抽出のソーステキストです。
* **`instruction`**: LLM に必要な追加の指示です。

`NodeResponse` の構造については、[一般仕様の定義](/ja/develop-plugin/features-and-specs/plugin-types/general-specifications#noderesponse) を参照してください。

### ユースケース

次の例では、会話から人物の名前を抽出します。

```python theme={null}
from collections.abc import Generator
from dify_plugin import Tool
from dify_plugin.entities.tool import ToolInvokeMessage
from dify_plugin.entities.workflow_node import ModelConfig, NodeResponse, ParameterConfig


class ParameterExtractorTool(Tool):
    def _invoke(
        self, tool_parameters: dict
    ) -> Generator[ToolInvokeMessage, None, None]:
        response: NodeResponse = self.session.workflow_node.parameter_extractor.invoke(
            parameters=[
                ParameterConfig(
                    name="name",
                    description="name of the person",
                    required=True,
                    type="string",
                )
            ],
            model=ModelConfig(
                provider="langgenius/openai/openai",
                name="gpt-4o-mini",
                completion_params={},
            ),
            query="My name is John Doe",
            instruction="Extract the name of the person",
        )

        extracted_name = response.outputs.get("name", "Name not found")
        yield self.create_text_message(extracted_name)
```

`NodeResponse` は `dify_plugin.entities.workflow_node` で定義された Pydantic モデルで、`process_data`、`inputs`、`outputs` の 3 つの辞書フィールドを持ちます。抽出された値は `response.outputs` に格納されます。

## 質問分類ノードの呼び出し

### エントリーポイント

```python theme={null}
    self.session.workflow_node.question_classifier
```

### インターフェース

```python theme={null}
    def invoke(
        self,
        classes: list[ClassConfig],
        model: ModelConfig,
        query: str,
        instruction: str = "",
    ) -> NodeResponse:
        pass
```

`ClassConfig` も `dify_plugin.entities.workflow_node` からエクスポートされます。インターフェースのパラメータは `ParameterExtractor` と一致しており、最終結果は `response.outputs["class_name"]` に格納されます。
