apupier commented on code in PR #20979:
URL: https://github.com/apache/camel/pull/20979#discussion_r2716738753


##########
components/camel-ai/camel-docling/src/main/java/org/apache/camel/component/docling/DoclingProducer.java:
##########
@@ -395,45 +399,16 @@ private DocumentMetadata extractMetadataUsingApi(String 
inputPath) throws IOExce
                 }
             }
 
-            // Try to extract metadata from the JSON structure
-            if (rootNode.has(DoclingMetadataFields.METADATA)) {
-                JsonNode metadataNode = 
rootNode.get(DoclingMetadataFields.METADATA);
-                extractMetadataFieldsFromJson(metadata, metadataNode);
-            }
-
-            // Look for document-level information
-            if (rootNode.has(DoclingMetadataFields.DOCUMENT)) {
-                JsonNode docNode = 
rootNode.get(DoclingMetadataFields.DOCUMENT);
-                if (docNode.has(DoclingMetadataFields.NAME) && 
metadata.getTitle() == null) {
-                    
metadata.setTitle(docNode.get(DoclingMetadataFields.NAME).asText());
-                }
-            }
+            metadata.setPageCount(doclingDocument.getPages().size());

Review Comment:
   maybe need to check fo rnon-nulliness of doclingDocument.getPages()



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to