Markdown does not seem to work

Created on 8 May 2024, 7 months ago
Updated 23 May 2024, 6 months ago

Problem/Motivation

I am trying to use unstructured to get markdown.

The website encountered an unexpected error. Please try again later.

TypeError: Drupal\ai_interpolator_unstructured\Formatters\MarkdownFormatter::formatType(): Argument #1 ($data) must be of type array, string given, called in /var/www/html/web/modules/contrib/unstructured/modules/ai_interpolator_unstructured/src/Formatters/MarkdownFormatter.php on line 46 in Drupal\ai_interpolator_unstructured\Formatters\MarkdownFormatter->formatType() (line 63 of modules/contrib/unstructured/modules/ai_interpolator_unstructured/src/Formatters/MarkdownFormatter.php).

Drupal\ai_interpolator_unstructured\Formatters\MarkdownFormatter->format(Array, 'none') (Line: 247)
Drupal\ai_interpolator_unstructured\FileToTextBase->generate(Object, Object, Array) (Line: 60)
Drupal\ai_interpolator\AiInterpolatorRuleRunner->generateResponse(Object, Object, Array) (Line: 69)
Drupal\ai_interpolator\Plugin\AiInterpolatorProcess\DirectSaveProcessing->modify(Object, Object, Array) (Line: 186)
Drupal\ai_interpolator\AiInterpolatorEntityModifier->markFieldForProcessing(Object, Object, Array, Object) (Line: 103)
Drupal\ai_interpolator\AiInterpolatorEntityModifier->saveEntity(Object) (Line: 31)
ai_interpolator_entity_presave(Object)
call_user_func_array(Object, Array) (Line: 409)
Drupal\Core\Extension\ModuleHandler->Drupal\Core\Extension\{closure}(Object, 'ai_interpolator') (Line: 388)
Drupal\Core\Extension\ModuleHandler->invokeAllWith('entity_presave', Object) (Line: 416)
Drupal\Core\Extension\ModuleHandler->invokeAll('entity_presave', Array) (Line: 217)
Drupal\Core\Entity\EntityStorageBase->invokeHook('presave', Object) (Line: 900)
Drupal\Core\Entity\ContentEntityStorageBase->invokeHook('presave', Object) (Line: 529)
Drupal\Core\Entity\EntityStorageBase->doPreSave(Object) (Line: 753)
Drupal\Core\Entity\ContentEntityStorageBase->doPreSave(Object) (Line: 483)
Drupal\Core\Entity\EntityStorageBase->save(Object) (Line: 806)
Drupal\Core\Entity\Sql\SqlContentEntityStorage->save(Object) (Line: 29)
Drupal\media\MediaStorage->save(Object) (Line: 339)
Drupal\Core\Entity\EntityBase->save() (Line: 293)
Drupal\Core\Entity\EntityForm->save(Array, Object) (Line: 61)
Drupal\media\MediaForm->save(Array, Object)
call_user_func_array(Array, Array) (Line: 114)
Drupal\Core\Form\FormSubmitter->executeSubmitHandlers(Array, Object) (Line: 52)
Drupal\Core\Form\FormSubmitter->doSubmitForm(Array, Object) (Line: 597)
Drupal\Core\Form\FormBuilder->processForm('media_minutes_parsing_add_form', Array, Object) (Line: 325)
Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 73)
Drupal\Core\Controller\FormController->getContentResult(Object, Object) (Line: 39)
Drupal\layout_builder\Controller\LayoutBuilderHtmlEntityFormController->getContentResult(Object, Object) (Line: 94)
Drupal\mercury_editor\Controller\MercuryEditorHtmlEntityFormController->getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 592)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 181)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 76)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 38)
Drupal\mercury_editor\StackMiddleware\AjaxPageState->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 704)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

Steps to reproduce

Create media with a file field and a plain text field.
Configure field with the following settings
Unstructured api file to string
base mode
Direct
Narrative Text
List Item
Title
Header
Footer
Uncategorized

Output Markdown
No Split
Auto
Don't extract images
Bypass

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

πŸ“Œ Task
Status

Fixed

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States nicxvan

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024