Pre-requisites
Run the following command to enable watsonx Orchestrate Developer Edition to process documents:BASH
Note:
You need to configure a minimum allocation of 20GB RAM to your Docker engine during installation of watsonx Orchestrate Developer edition to support document processing features.
Configuring document processing in flows
In your agentic workflow, include a call to the ‘docproc()’ method to process a document. This method accepts the following input arguments:
The input to a
docproc node uses the DocProcInput type from the ibm_watsonx_orchestrate.flow_builder.types module. You can optionally configure the kvp_schemas parameter to define key-value pair input schemas. For more information, see Semantic Key-Value Pair (KVP) Extraction.
Example use of the docproc node in a agentic workflow:
Python
Semantic Key-Value Pair (KVP) Extraction
Use thekvp_schemas parameter in the text extraction task to extract semantic key-value pairs from input documents.
You can define this parameter in two places:
-
Node specification: Set
kvp_schemasin the node configuration. The node supports semantic KVP extraction in the following cases:- If you define
kvp_schemasin the input, the node uses those schemas. If you pass an empty array, it falls back to default schemas. - If you don’t define
kvp_schemasin the input but include them in the node specification, the node uses the specification-defined schemas. Again, if the array is empty, it defaults to the built-in schemas.
kvp_schemasis configured as a JSON object. The following example shows how to definekvp_schemasin a node configuration.Python - If you define
-
Runtime input: Set
kvp_schemasin the input payload. The following example shows how to define akvp_schemasin the input payload.Python
kvp_schemas is null. If you define the parameter in both places, the runtime input takes precedence and overrides the node specification. To use predefined extraction schemas, pass an empty array (kvp_schemas: []).
Use kvp_force_schema_name to specify the schema name for KVP extraction. Use kvp_enable_text_hints to enable or disable text hints during extraction. Configure both settings inside the docproc() node.
Python

