@marcus Thank you! I've successfully configured a json_field with "LLM: JSON field" automator type and got the structured data. Then I tried to configure a heavier-weight automator for a text field to further extract a key-value from the json_field data. But the json_field does not show up in the "Automator Base Field" under base mode. Then I swithed to the "Advanced mode(token)", then use the prompt as below:
Extract the value for the key "full_name" from the JSON data below. Do not output anything else.
# JSON Data
[node:field_json_data]</cod>
Then create a new node. The below error occured:
<code>
InvalidArgumentException: Field is unknown. in Drupal\Core\Entity\ContentEntityBase->getTranslatedField() (line 617 of /var/www/html/testu/web/core/lib/Drupal/Core/Entity/ContentEntityBase.php).
#0 /var/www/html/testu/web/core/lib/Drupal/Core/Entity/ContentEntityBase.php(597): Drupal\Core\Entity\ContentEntityBase->getTranslatedField()
#1 /var/www/html/testu/web/modules/contrib/ai/modules/ai_automators/src/AiAutomatorEntityModifier.php(283): Drupal\Core\Entity\ContentEntityBase->get()
#2 /var/www/html/testu/web/modules/contrib/ai/modules/ai_automators/src/AiAutomatorEntityModifier.php(248): Drupal\ai_automators\AiAutomatorEntityModifier->baseShouldSave()
#3 /var/www/html/testu/web/modules/contrib/ai/modules/ai_automators/src/AiAutomatorEntityModifier.php(149): Drupal\ai_automators\AiAutomatorEntityModifier->markFieldForProcessing()
#4 /var/www/html/testu/web/modules/contrib/ai/modules/ai_automators/ai_automators.module(31): Drupal\ai_automators\AiAutomatorEntityModifier->saveEntity()
#5 [internal function]: ai_automators_entity_presave()
#6 /var/www/html/testu/web/core/lib/Drupal/Core/Extension/ModuleHandler.php(404): call_user_func_array()
#7 /var/www/html/testu/web/core/lib/Drupal/Core/Extension/ModuleHandler.php(357): Drupal\Core\Extension\ModuleHandler->Drupal\Core\Extension\{closure}()
#8 /var/www/html/testu/web/core/lib/Drupal/Core/Extension/ModuleHandler.php(403): Drupal\Core\Extension\ModuleHandler->invokeAllWith()
#9 /var/www/html/testu/web/core/lib/Drupal/Core/Entity/EntityStorageBase.php(217): Drupal\Core\Extension\ModuleHandler->invokeAll()
#10 /var/www/html/testu/web/core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php(915): Drupal\Core\Entity\EntityStorageBase->invokeHook()
#11 /var/www/html/testu/web/core/lib/Drupal/Core/Entity/EntityStorageBase.php(530): Drupal\Core\Entity\ContentEntityStorageBase->invokeHook()
#12 /var/www/html/testu/web/core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php(760): Drupal\Core\Entity\EntityStorageBase->doPreSave()
#13 /var/www/html/testu/web/core/lib/Drupal/Core/Entity/EntityStorageBase.php(484): Drupal\Core\Entity\ContentEntityStorageBase->doPreSave()
#14 /var/www/html/testu/web/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php(804): Drupal\Core\Entity\EntityStorageBase->save()
#15 /var/www/html/testu/web/core/lib/Drupal/Core/Entity/EntityBase.php(370): Drupal\Core\Entity\Sql\SqlContentEntityStorage->save()
#16 /var/www/html/testu/web/core/modules/node/src/Form/NodeForm.php(281): Drupal\Core\Entity\EntityBase->save()
#17 [internal function]: Drupal\node\Form\NodeForm->save()
#18 /var/www/html/testu/web/core/lib/Drupal/Core/Form/FormSubmitter.php(105): call_user_func_array()
#19 /var/www/html/testu/web/core/lib/Drupal/Core/Form/FormSubmitter.php(43): Drupal\Core\Form\FormSubmitter->executeSubmitHandlers()
#20 /var/www/html/testu/web/core/lib/Drupal/Core/Form/FormBuilder.php(589): Drupal\Core\Form\FormSubmitter->doSubmitForm()
#21 /var/www/html/testu/web/core/lib/Drupal/Core/Form/FormBuilder.php(321): Drupal\Core\Form\FormBuilder->processForm()
#22 /var/www/html/testu/web/core/lib/Drupal/Core/Controller/FormController.php(73): Drupal\Core\Form\FormBuilder->buildForm()
#23 /var/www/html/testu/web/modules/contrib/schemadotorg/modules/schemadotorg_additional_type/src/Controller/SchemaDotOrgAdditionalTypeHtmlEntityFormController.php(151): Drupal\Core\Controller\FormController->getContentResult()
#24 /var/www/html/testu/web/modules/contrib/schemadotorg/modules/schemadotorg_additional_type/src/Controller/SchemaDotOrgAdditionalTypeHtmlEntityFormController.php(63): Drupal\schemadotorg_additional_type\Controller\SchemaDotOrgAdditionalTypeHtmlEntityFormController->buildNodeForm()
#25 [internal function]: Drupal\schemadotorg_additional_type\Controller\SchemaDotOrgAdditionalTypeHtmlEntityFormController->getContentResult()
#26 /var/www/html/testu/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array()
#27 /var/www/html/testu/web/core/lib/Drupal/Core/Render/Renderer.php(627): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#28 /var/www/html/testu/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(121): Drupal\Core\Render\Renderer->executeInRenderContext()
#29 /var/www/html/testu/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext()
#30 /var/www/html/testu/vendor/symfony/http-kernel/HttpKernel.php(183): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#31 /var/www/html/testu/vendor/symfony/http-kernel/HttpKernel.php(76): Symfony\Component\HttpKernel\HttpKernel->handleRaw()
#32 /var/www/html/testu/web/core/lib/Drupal/Core/StackMiddleware/Session.php(53): Symfony\Component\HttpKernel\HttpKernel->handle()
#33 /var/www/html/testu/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle()
#34 /var/www/html/testu/web/core/lib/Drupal/Core/StackMiddleware/ContentLength.php(28): Drupal\Core\StackMiddleware\KernelPreHandle->handle()
#35 /var/www/html/testu/web/core/modules/big_pipe/src/StackMiddleware/ContentLength.php(32): Drupal\Core\StackMiddleware\ContentLength->handle()
#36 /var/www/html/testu/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(116): Drupal\big_pipe\StackMiddleware\ContentLength->handle()
#37 /var/www/html/testu/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(90): Drupal\page_cache\StackMiddleware\PageCache->pass()
#38 /var/www/html/testu/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\page_cache\StackMiddleware\PageCache->handle()
#39 /var/www/html/testu/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle()
#40 /var/www/html/testu/web/core/lib/Drupal/Core/StackMiddleware/AjaxPageState.php(53): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle()
#41 /var/www/html/testu/web/core/lib/Drupal/Core/StackMiddleware/StackedHttpKernel.php(51): Drupal\Core\StackMiddleware\AjaxPageState->handle()
#42 /var/www/html/testu/web/core/lib/Drupal/Core/DrupalKernel.php(715): Drupal\Core\StackMiddleware\StackedHttpKernel->handle()
#43 /var/www/html/testu/web/index.php(19): Drupal\Core\DrupalKernel->handle()
#44 {main}
@jrockowitz I reinstalled the schemadotorg_media module with the help of module config_delete. It works now. Thank you!
@jrockowitz Thank you! I checked the status of schemadotorg_media module before posting here. It is enabled.
@jrockowitz Sorry I still cannot understand and get it done. Please tell me how to configure in Drupal (maybe on the page: /admin/config/schemadotorg/settings/jsonld) for your example → to set up? And what to render in the
tag?@graber Thank you! I know that. However, no records received from Moolde. Now I find in recent log messages:
InvalidArgumentException: Invalid statement JSON: - context missing in the given statement. - object missing in the given statement. - verb missing in the given statement. in Drupal\lrs_xapi\XapiStatementStorage->setStatement() (line 80 of /var/www/html/drupaltest/web/modules/contrib/lms_xapi/modules/lrs_xapi/src/XapiStatementStorage.php).
#0 /var/www/html/drupaltest/web/modules/contrib/lms_xapi/modules/lrs_xapi/src/Controller/LrsXapiEndpoint.php(89): Drupal\lrs_xapi\XapiStatementStorage->setStatement()
#1 [internal function]: Drupal\lrs_xapi\Controller\LrsXapiEndpoint->statements()
#2 /var/www/html/drupaltest/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array()
#3 /var/www/html/drupaltest/web/core/lib/Drupal/Core/Render/Renderer.php(627): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#4 /var/www/html/drupaltest/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(121): Drupal\Core\Render\Renderer->executeInRenderContext()
#5 /var/www/html/drupaltest/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext()
#6 /var/www/html/drupaltest/vendor/symfony/http-kernel/HttpKernel.php(183): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#7 /var/www/html/drupaltest/vendor/symfony/http-kernel/HttpKernel.php(76): Symfony\Component\HttpKernel\HttpKernel->handleRaw()
#8 /var/www/html/drupaltest/web/core/lib/Drupal/Core/StackMiddleware/Session.php(53): Symfony\Component\HttpKernel\HttpKernel->handle()
#9 /var/www/html/drupaltest/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle()
#10 /var/www/html/drupaltest/web/core/lib/Drupal/Core/StackMiddleware/ContentLength.php(28): Drupal\Core\StackMiddleware\KernelPreHandle->handle()
#11 /var/www/html/drupaltest/web/core/modules/big_pipe/src/StackMiddleware/ContentLength.php(32): Drupal\Core\StackMiddleware\ContentLength->handle()
#12 /var/www/html/drupaltest/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(116): Drupal\big_pipe\StackMiddleware\ContentLength->handle()
#13 /var/www/html/drupaltest/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(90): Drupal\page_cache\StackMiddleware\PageCache->pass()
#14 /var/www/html/drupaltest/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\page_cache\StackMiddleware\PageCache->handle()
#15 /var/www/html/drupaltest/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle()
#16 /var/www/html/drupaltest/web/core/lib/Drupal/Core/StackMiddleware/AjaxPageState.php(53): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle()
#17 /var/www/html/drupaltest/web/core/lib/Drupal/Core/StackMiddleware/StackedHttpKernel.php(51): Drupal\Core\StackMiddleware\AjaxPageState->handle()
#18 /var/www/html/drupaltest/web/core/lib/Drupal/Core/DrupalKernel.php(715): Drupal\Core\StackMiddleware\StackedHttpKernel->handle()
#19 /var/www/html/drupaltest/web/index.php(19): Drupal\Core\DrupalKernel->handle()
#20 {main}
Drupal latest 11.x, PHP 8.3
@mkalkbrenner Thank you!
However, it still does not work.
I strictly follow your link README, the error occured when:
sudo -u solr /opt/solr/bin/solr create_core -c transdisnew -d /var/www/html/transdis/solrconfig -n transdisnew
Neither --zk-host or --solr-url parameters provided so assuming solr url is http://localhost:8984.
ERROR: Error from server at http://localhost:8984/solr/admin/cores?action=CREATE&name=transdisnew&instanceDir=transdisnew&wt=javabin&version=2: Error CREATEing SolrCore 'transdisnew': Unable to create core [transdisnew] Caused by: Can't find resource 'solrconfig.xml' in classpath or '/var/solr/data/transdisnew'
Thne I manaully create the folder /var/solr/data/transdisnew as below:
sudo su
mkdir /var/solr/data/transdisnew
chown -R solr: /var/solr/data/transdisnew
Then re-run the command:
sudo -u solr /opt/solr/bin/solr create_core -c transdisnew -d /var/www/html/transdis/solrconfig -n transdisnew
Neither --zk-host or --solr-url parameters provided so assuming solr url is http://localhost:8984.
ERROR:
Core 'transdisnew' already exists!
Checked core existence using Core API command
Stucked.
My Solr Version: 9.8.1
PLEASE provide a really working detailed steps. MANY MANY thanks!
fishfree → created an issue.
fishfree → created an issue.
fishfree → created an issue.
fishfree → created an issue.
fishfree → created an issue.
fishfree → created an issue.
For Drupal 10.4.3, the latest version of this module and #85 patch does not work. Even both running composer require phpoffice/phpword under the Drupal project root and this module folder, still no options can be selected for the field "Word Document" on the /admin/config/content/entityprint
fishfree → created an issue.
fishfree → created an issue.
fishfree → created an issue.
fishfree → created an issue.
fishfree → created an issue.
fishfree → created an issue.
fishfree → created an issue.
fishfree → created an issue.
@jrockowitz Thank you! My exported Schemadotorg Mapping configs also lost as the screenshot below:
Actually, the node.place item was recreated after my post #1.
fishfree → created an issue.
@jurgenhaas Thank you! But now the more critical problem is that the JS library file cannot be loaded. I cannot figure it out, 'cause there is no selectedly loading codes in module files.
@jurgenhaas I haven't see any theme names in the codes. Why this moudle are still not theme-agnostic?
@jurgenhaas Thank you! I set it, but it still didn't work as expected as the screenshot → . I checked the HTML source of both the Oliver and Claro themes of the page, no views_exposed_range_slider.js file loaded.
@jurgenhaas T'hank you very much! Now I enabled it there, however, I still cannot see any changes. I also tried configuring a number(integer) exposed fileld filter, no related configs there.
@bluegeek9 No, no luck.
fishfree → created an issue.
The same problem for Ollama models, even I selected the Arbitrary key.
fishfree → created an issue.
@seogow OK, THANK YOU!
fishfree → created an issue.
fishfree → created an issue.
fishfree → created an issue.
@scott, After pathing your commit, it seems working now. Many thanks!
fishfree → created an issue.
@scott Thank you! I run your code snippet as below:
function token_page_attachments_alter() {
$text = '我是一名退休教师,退休前我很难抽出时间去运动和锻炼,那时感觉自己处在一种亚健康的状态。退休后,我的时间充裕了,经过几年的坚持锻炼,我现在的身体素质比退休前还要好。单位每年组织体检,我的各项指标基本可以达标。在这里,我呼吁老年朋友多运动,多锻炼。立冬时气温降低,老年人外出运动时一定要穿着保暖透气的衣服,运动前做好准备活动,先热身、后运动。选择运动方式时,一定要适合自己。在运动中释放自己,保持好心情。';
/** @var \Drupal\ai\Utility\TextChunker $chunker */
$chunker = \Drupal::service('ai.text_chunker');
$chunker->setModel('openai__gpt-3.5-turbo');
$chunks = $chunker->chunkText($text, 100, 0);
dpm($chunks);
}
It printed out as below:
array:3 [
0 => "我是一名退休教师,退休前我很难抽出时间去运动和锻炼,那时感觉自己处在一种亚健康的状态。退休后,我的时间充裕了,经过几年的坚持锻炼"
1 => ",我现在的身体素质比退休前还要好。单位每年组织体检,我的各项指标基本可以达标。在这里,我呼吁老年朋友多运动,多锻炼。立冬时气温降低"
2 => ",老年人外出运动时一定要穿着保暖透气的衣服,运动前做好准备活动,先热身、后运动。选择运动方式时,一定要适合自己。在运动中释放自己,保持好心情。"
]
The output 3 chunks have no overlappings.
@scott I'm willing to help debug and test. On the page /devel/php in my site, I ran your code snippet, it showed errors: Typed property Drupal\ai\Utility\Tokenizer::$encoder must not be accessed before initialization
Will you pls provide a whole working code snippet for me to run with devel_php module in my site? Many thanks!
Any update here? :-)
@seogow I followed your tip for temporary fixing, changed the ai_search milvus server config, then cleard all index and re-index, it occurred error:
Error: Typed property Drupal\ai_search\Base\EmbeddingStrategyPluginBase::$chunkMinOverlap must not be accessed before initialization in Drupal\ai_search\Plugin\EmbeddingStrategy\EmbeddingBase->getChunks() (line 254 of /var/www/html/drupal/web/modules/contrib/ai/modules/ai_search/src/Plugin/EmbeddingStrategy/EmbeddingBase.php).
@cilefen Thank you! No, there isn't.
fishfree → created an issue.
fishfree → created an issue.
fishfree → created an issue.
@scott Thank you! I just installed the latest dev version of ai module, and set the index options. I seemed having progress. However, new errors occured:
Failed to determine non-UTF8 encoding to attempt to auto-convert chunk: # 君强 君强 �组织
Hence the other error:
Exception: Failed to insert into collection: can only accept json format request, the request body should be nil, however {} is valid in Drupal\vdb_provider_milvus\Plugin\VdbProvider\MilvusProvider->insertIntoCollection() (line 402 of /var/www/html/drupal/web/modules/contrib/ai/modules/vdb_providers/vdb_provider_milvus/src/Plugin/VdbProvider/MilvusProvider.php)
I think even there are some failures from UTF8 converting or encoding, we should just ignore that chunck and continue. It seems the current code acts this way, but why still the whole indexing progress failed? Because when I only index one node, it succeeded, the node should have no garbled character like �.
@Scott @Marcus would you pls help me? I still have no progress.
For me, the problem still exists after upgrading to the latest dev version of rdf_sync and running vendor/bin/drush php:script ./my-script.php
.
@marcus @scott
Thank you!
In fact I had tried the both explorer before posting here, they worked. I just test them again, still working.
When my config is as below, as what I said in #4 before applying your refactoring, the indexing will work.
If I set them with index options as below, as selecting the embeddings field type before your refactoring, the indexing will fail with the error log as #11.
@scott Thank you. However for me, after pulling latest dev and running updb, the problem exists the same. I confirmed I set the collection before I post this issue. My Ollama is the latest version.
Yes. Thank you!
@scott My detailed log had been flushed. I pull the latest 1.0-dev. Then I change all the index fields from string to embeddings, then re-index, new error occured:
TypeError: Drupal\vdb_provider_milvus\Plugin\VdbProvider\MilvusProvider::getVdbIds(): Argument #1 ($collection_name) must be of type string, null given, called in /var/www/html/drupal/web/modules/contrib/ai/src/Base/AiVdbProviderClientBase.php on line 323 in Drupal\vdb_provider_milvus\Plugin\VdbProvider\MilvusProvider->getVdbIds() (line 473 of /var/www/html/drupal/web/modules/contrib/ai/modules/vdb_providers/vdb_provider_milvus/src/Plugin/VdbProvider/MilvusProvider.php).
#0 /var/www/html/drupal/web/modules/contrib/ai/src/Base/AiVdbProviderClientBase.php(323): Drupal\vdb_provider_milvus\Plugin\VdbProvider\MilvusProvider->getVdbIds()
#1 /var/www/html/drupal/web/modules/contrib/ai/src/Base/AiVdbProviderClientBase.php(316): Drupal\ai\Base\AiVdbProviderClientBase->deleteItems()
#2 /var/www/html/drupal/web/modules/contrib/ai/src/Base/AiVdbProviderClientBase.php(246): Drupal\ai\Base\AiVdbProviderClientBase->deleteIndexItems()
#3 /var/www/html/drupal/web/modules/contrib/ai/modules/ai_search/src/Plugin/search_api/backend/SearchApiAiSearchBackend.php(305): Drupal\ai\Base\AiVdbProviderClientBase->indexItems()
#4 /var/www/html/drupal/web/modules/contrib/search_api/src/Entity/Server.php(350): Drupal\ai_search\Plugin\search_api\backend\SearchApiAiSearchBackend->indexItems()
#5 /var/www/html/drupal/web/modules/contrib/search_api/src/Entity/Index.php(1008): Drupal\search_api\Entity\Server->indexItems()
#6 /var/www/html/drupal/web/modules/contrib/search_api/src/Entity/Index.php(937): Drupal\search_api\Entity\Index->indexSpecificItems()
#7 /var/www/html/drupal/web/modules/contrib/search_api/src/IndexBatchHelper.php(160): Drupal\search_api\Entity\Index->indexItems()
#8 /var/www/html/drupal/web/core/includes/batch.inc(296): Drupal\search_api\IndexBatchHelper::process()
#9 /var/www/html/drupal/web/core/includes/batch.inc(138): _batch_process()
#10 /var/www/html/drupal/web/core/includes/batch.inc(94): _batch_do()
#11 /var/www/html/drupal/web/core/modules/system/src/Controller/BatchController.php(52): _batch_page()
#12 [internal function]: Drupal\system\Controller\BatchController->batchPage()
#13 /var/www/html/drupal/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array()
#14 /var/www/html/drupal/web/core/lib/Drupal/Core/Render/Renderer.php(638): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#15 /var/www/html/drupal/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(121): Drupal\Core\Render\Renderer->executeInRenderContext()
#16 /var/www/html/drupal/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext()
#17 /var/www/html/drupal/vendor/symfony/http-kernel/HttpKernel.php(181): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#18 /var/www/html/drupal/vendor/symfony/http-kernel/HttpKernel.php(76): Symfony\Component\HttpKernel\HttpKernel->handleRaw()
#19 /var/www/html/drupal/web/core/lib/Drupal/Core/StackMiddleware/Session.php(53): Symfony\Component\HttpKernel\HttpKernel->handle()
#20 /var/www/html/drupal/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle()
#21 /var/www/html/drupal/web/core/lib/Drupal/Core/StackMiddleware/ContentLength.php(28): Drupal\Core\StackMiddleware\KernelPreHandle->handle()
#22 /var/www/html/drupal/web/core/modules/big_pipe/src/StackMiddleware/ContentLength.php(32): Drupal\Core\StackMiddleware\ContentLength->handle()
#23 /var/www/html/drupal/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\big_pipe\StackMiddleware\ContentLength->handle()
#24 /var/www/html/drupal/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass()
#25 /var/www/html/drupal/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\page_cache\StackMiddleware\PageCache->handle()
#26 /var/www/html/drupal/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle()
#27 /var/www/html/drupal/web/core/lib/Drupal/Core/StackMiddleware/AjaxPageState.php(36): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle()
#28 /var/www/html/drupal/web/core/lib/Drupal/Core/StackMiddleware/StackedHttpKernel.php(51): Drupal\Core\StackMiddleware\AjaxPageState->handle()
#29 /var/www/html/drupal/web/core/lib/Drupal/Core/DrupalKernel.php(741): Drupal\Core\StackMiddleware\StackedHttpKernel->handle()
#30 /var/www/html/drupal/web/index.php(19): Drupal\Core\DrupalKernel->handle()
#31 {main}
I have to say I modified the a few lines of the code for being compatible with the new Ollama embeddings provider API:
modules/providers/provider_ollama/src/OllamaControlApi.php如下:
- $result = json_decode($this->makeRequest("api/embeddings", [], 'POST', [
+ $result = json_decode($this->makeRequest("api/embed", [], 'POST', [
- 'prompt' => $text,
+ 'input' => $text,
'model' => $model,
modules/providers/provider_ollama/src/Plugin/AiProvider/OllamaProvider.php:
- return new EmbeddingsOutput($response['embedding'], $response, []);
+ return new EmbeddingsOutput($response['embeddings'][0], $response, []);
@wouters_f Thank you! It works now with your MR.
@scott_euser Thank you! I tried that before. If changed to the embeddings field type, indexing would fail with error log as below:
Drupal\ai\Exception\AiBadRequestException: Error invoking client: Client error: `POST http://10.2.91.48:11434/api/embed` resulted in a `400 Bad Request` response: {"error":"missing request body"} in Drupal\ai\Plugin\ProviderProxy->wrapperCall() (line 155 of /var/www/html/drupal/web/modules/contrib/ai/src/Plugin/ProviderProxy.php).
@andileco Thank you very much! It works!
@knurg Thank you all the same for taking time to talk with me!
The schemadotorg module is much easier to use and has other many advantages :-)
Of couse, the rdf_sync is applicable for all Drupal native entities, while WissKI is only applicable for ontology-based pathbuilders.
@knurg For example, the schemadotorg module can create https://schema.org -compliant RDF triples with the rdf_sync module. It's very hard to use WissKI pathbuilders to make it. I need both features and store them both in a single tirple-store server.
fishfree → created an issue.
You are right. But there are other stuff besides WissKI paths in my Drupal, which are required to synchronize to triple store.
fishfree → created an issue.
@marcus, your merge request works now! Thank you!
@knurg Thank you for your detailed explanation and sorry for replying late.
I asked this question here because I'd like to use WissKI and rdf_sync module together, the latter only supports Openlink Virtuoso and has a configuration of "Graph store path". If WissKI also supports Openlink Virtuoso, it would be great.
For me, I can disable SPARQL auth and accept anonymous writing access in Openlink Virtuoso, because I can use IP/TCP to only allow localhost access.
Thank you again!
The #6 patch works for me.
@marcus Thank you for your marvelous diligence!
I test the latest dev version after drush updb && drush cr
, the same problem still exists as below:
11 Add to Default shortcuts
Open configuration options
Prompt
user
Please extract text from this image:
Do not include any explanations, only provide a RFC8259 compliant JSON response following this format without deviation.
[{"value": "requested value"}]
Operation Type
chat
Provider
ollama
Model
llava:latest
Tags
chat
Response
{"id":"chatcmpl-0","object":"chat.completion","created":1727097978,"model":"llava:latest","systemFingerprint":"fp_ollama","choices":[{"index":0,"message":{"role":"assistant","content":" [[{\"value\": \"101-2021-03-31T10:00:00Z\"}]]] ","toolCalls":[],"functionCall":null},"finishReason":"stop"}],"usage":{"promptTokens":57,"completionTokens":34,"totalTokens":91}}
Configuration
max_tokens:
1024
temperature:
1
top_p:
1
Extra Data
[]
Authored on
Mon, 09/23/2024 - 21:26
fishfree → created an issue.
fishfree → created an issue.
@marcus Thank you! I can select image field. But it request failed. The AI log said:
Prompt
user
Please extract text from this image:
Do not include any explanations, only provide a RFC8259 compliant JSON response following this format without deviation.
[{"value": "requested value"}]
Operation Type
chat
Provider
ollama
Model
llava:latest
Tags
chat
Response
{"id":"chatcmpl-291","object":"chat.completion","created":1727049200,"model":"llava:latest","systemFingerprint":"fp_ollama","choices":[{"index":0,"message":{"role":"assistant","content":" ```json\n}[{\"value\": \"No request was made.\"}]\n``` ","toolCalls":[],"functionCall":null},"finishReason":"stop"}],"usage":{"promptTokens":57,"completionTokens":19,"totalTokens":76}}
Configuration
max_tokens:
1024
temperature:
1
top_p:
1
Extra Data
[]
Authored on
Mon, 09/23/2024 - 07:53
If you succeeded, pls share me a screenshot of configuration.
fishfree → created an issue.
@christianadamski Thank you very much! I add a new simple geolocation field, it works now as the doc.
fishfree → created an issue.
fishfree → created an issue.
@marcus_johansson Thank you! I installed ai_agent module. I guess I'd better post my issue there.
My fault. Pls ignore it.
fishfree → created an issue.
fishfree → created an issue.
@christianadamski Thank you! I added a few words. If you followed my steps, you can reproduce it. Or, the official doc should be upgraded to be aligned with the module's changes?
fishfree → created an issue.
fishfree → created an issue.