Skip to main content
In knowledge pipelines, the Knowledge Base node supports input in two multimodal data formats: multimodal-Parent-Child and multimodal-General. When developing a tool plugin for multimodal data processing, to ensure that the plugin’s multimodal output (such as text, images, audio, video, etc.) can be correctly recognized and embedded by the Knowledge Base node, you need to complete the following configuration:
  • In the tool code file, call the tool session interface to upload files and construct the files object.
  • In the tool provider YAML file, declare the output_schema as either multimodal-Parent-Child or multimodal-General.

Upload Files and Construct File Objects

When processing multimodal data (such as images), you need to first upload the file using Dify’s tool session tool to obtain the file metadata. The following example uses the official Dify plugin, Dify Extractor, to demonstrate how to upload a file and construct a files object.
The upload interface returns an UploadFileResponse object containing the file information. Its structure is as follows:
You can map the file information (such as name, size, extension, mime_type, etc.) to the files field in the multimodal output structure.

Declare Multimodal Output Structure

The structure of multimodal data is defined by Dify’s official JSON schema. To enable the Knowledge Base node to recognize the plugin’s multimodal output type, you need to point the result field under output_schema in the plugin’s provider YAML file to the corresponding official schema URL.
Taking multimodal-Parent-Child as an example, a complete YAML configuration is as follows: