Fatal error recreating Dries-note demo

Created on 13 November 2024, 9 days ago

Problem/Motivation

Following the Dries-note presentation's demo, I went off topic when asking the AI to add an image field to the Wine Tours content type: I asked if images could be reusable, and it offered to set up a media reference field instead. I told it to do this and it went fine. I went back to Dries' prompts, but triggered a fatal error when asking if the LLM could make it so only high resolution images could be uploaded.

The website encountered an unexpected error. Try again later.

Error: Call to a member function getSettings() on null in Drupal\aiagents\Plugin\AiAgent\FieldType->solve() (line 419 of modules/contrib/aiagents/src/Plugin/AiAgent/FieldType.php).

Drupal\aiagents\Plugin\AiAssistantAction\AgentAction->triggerAction() (Line: 405)
Drupal\aiassistantapi\AiAssistantApiRunner->process() (Line: 127)
Drupal\aichatbot\Form\ChatForm->submitForm()
calluserfuncarray() (Line: 129)
Drupal\Core\Form\FormSubmitter->executeSubmitHandlers() (Line: 67)
Drupal\Core\Form\FormSubmitter->doSubmitForm() (Line: 597)
Drupal\Core\Form\FormBuilder->processForm() (Line: 144)
Drupal\autosaveform\Form\AutosaveFormBuilder->processForm() (Line: 326)
Drupal\Core\Form\FormBuilder->buildForm() (Line: 97)
Drupal\autosaveform\Form\AutosaveFormBuilder->buildForm() (Line: 242)
Drupal\aichatbot\Plugin\Block\ChatFormBlock->build() (Line: 171)
Drupal\block\BlockViewBuilder::preRender()
calluserfunc_array() (Line: 113)
Drupal\Core\Render\Renderer->doTrustedCallback() (Line: 870)
Drupal\Core\Render\Renderer->doCallback() (Line: 432)
Drupal\Core\Render\Renderer->doRender() (Line: 504)
Drupal\Core\Render\Renderer->doRender() (Line: 248)
Drupal\Core\Render\Renderer->render() (Line: 476)
Drupal\Core\Template\TwigExtension->escapeFilter() (Line: 163)
_TwigTemplatea6daddf5db7afd38bdd7a28820cbf4a7->doDisplay() (Line: 393)
Twig\Template->yield() (Line: 48)
_TwigTemplate29bb6c3561cec0eccba6aeecf8efe02a->doDisplay() (Line: 393)
Twig\Template->yield() (Line: 349)
Twig\Template->display() (Line: 364)
Twig\Template->render() (Line: 35)
Twig\TemplateWrapper->render() (Line: 33)
twigrendertemplate() (Line: 348)
Drupal\Core\Theme\ThemeManager->render() (Line: 491)
Drupal\Core\Render\Renderer->doRender() (Line: 248)
Drupal\Core\Render\Renderer->render() (Line: 476)
Drupal\Core\Template\TwigExtension->escapeFilter() (Line: 92)
_TwigTemplatec80b4cee356caa7a247354cd1c770e6b->doDisplay() (Line: 393)
Twig\Template->yield() (Line: 349)
Twig\Template->display() (Line: 364)
Twig\Template->render() (Line: 35)
Twig\TemplateWrapper->render() (Line: 33)
twigrendertemplate() (Line: 348)
Drupal\Core\Theme\ThemeManager->render() (Line: 491)
Drupal\Core\Render\Renderer->doRender() (Line: 248)
Drupal\Core\Render\Renderer->render() (Line: 158)
Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent{closure}() (Line: 638)
Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 153)
Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse() (Line: 90)
Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray()
call¨C12Cfunc() (Line: 111)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch() (Line: 186)
Symfony\Component\HttpKernel\HttpKernel->handleRaw() (Line: 76)
Symfony\Component\HttpKernel\HttpKernel->handle() (Line: 53)
Drupal\Core\StackMiddleware\Session->handle() (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle() (Line: 28)
Drupal\Core\StackMiddleware\ContentLength->handle() (Line: 32)
Drupal\big¨C13Ccache\StackMiddleware\PageCache->pass() (Line: 90)
Drupal\page_cache\StackMiddleware\PageCache->handle() (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle() (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle() (Line: 36)
Drupal\Core\StackMiddleware\AjaxPageState->handle() (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle() (Line: 741)
Drupal\Core\DrupalKernel->handle() (Line: 19)

Steps to reproduce

Follow these prompts:

- Can you change the name Event to Wine tour?
- I want images on a wine tour. Can you help?
- Can I make the images reusable?
- Could you make sure that only high-definition images can be uploaded to a wine tour?

Error message displays using OpenAi set to all Starshot-set defaults.

Proposed resolution

Don't know if this is a case of the agent needing to be aware of Media Reference fields or something less intensive to resolve, but at the very least I'd expect any fatal errors to be caught and a less dangerous, more meaningful message displayed to the user about something going wrong.

πŸ› Bug report
Status

Active

Version

1.0

Component

Code

Created by

πŸ‡¬πŸ‡§United Kingdom MrDaleSmith

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

Comments & Activities

Production build 0.71.5 2024