- Issue created by @marcus_johansson
- ๐ฉ๐ชGermany marcus_johansson
Major, since its breaking 1.2.x-dev usage currently
- ๐ฎ๐ณIndia anjaliprasannan
marcus_johansson โ credited anjaliprasannan โ .
- Merge request !701Resolve #3532517 "Remove aidatatypeconverterpluginmanager from" โ (Merged) created by marcus_johansson
- ๐ฎ๐ณIndia annmarysruthy
@marcus_johansson Reviewed the changes. getting a fatal error in /admin/structure/ai_agent/add:
Fatal error: Type of Drupal\ai\Plugin\AiFunctionCall\ActionPluginBase::$data_type_converter_manager must be ?Drupal\ai\PluginManager\AiDataTypeConverterPluginManager (as in class Drupal\ai\Base\FunctionCallBase) in /var/www/html/modules/contrib/ai/src/Plugin/AiFunctionCall/ActionPluginBase.php on line 28
This could be fixed by updating the property type in ActionPluginBase to match the parent:
protected AiDataTypeConverterPluginManager $data_type_converter_manager,
to
protected ?AiDataTypeConverterPluginManager $data_type_converter_manager,
- ๐ฉ๐ชGermany marcus_johansson
Sorry, should have set it back to needs work. Got feedback from Artem on Slack and I'm just pushing those changes.
- ๐ช๐ธSpain gxleano Cรกceres
In the meantime, I'm testing the recent changes, but previous updates to RagTool are breaking my testing scenario.
Previously, everything was working fine with the default Umami version. After searching for an existing recipe, it correctly returned the expected content. However, after applying the latest changes included in version
1.2.x
, RagTool can no longer return any results when performing a search. Instead, it simply reports that no matches were found.If we test with RagTool code coming from
1.1.x
, everything works as expected. - ๐ช๐ธSpain gxleano Cรกceres
After adding latest change related with RagTool, everything works fine from my side.
- ๐ฎ๐ณIndia Akhil Babu Chengannur
Not sure if it's an actual bug
In โจ Introduce AI Agents and tools to Build Pages from Single Directory Components Active , I have created a tool that accepts a yml string from the ai agent.
The context definition is added like thiscontext_definitions: [ 'component_structure' => new ContextDefinition( data_type: 'string', label: new TranslatableMarkup("Component structure in yml format"), description: new TranslatableMarkup("The component structure to store, in yml."), required: TRUE, ), ],
$component_structure = $this->getContextValue('component_structure');
always returns the yml string. But now,Drupal\ai\PluginManager\AiDataTypeConverterPluginManager::convert()
converts it into an array as it callsDrupal\ai\Plugin\AiDataTypeConverter\YamlDeserializer::appliesToDataType()
. Since the data_type is set as string in context definition, this results in error 'This value should be of the correct primitive type.' - ๐ฉ๐ชGermany marcus_johansson
@akhil babu - we should probably add an possibility of optionality there. We have "upcasters" now, so if you get a node:1 in the parameter, it will actually give node 1 into the execute function etc - and that is what is happening here.
Should we add a separate issue for it and merge this?
- ๐ฎ๐ณIndia Akhil Babu Chengannur
@marcus_johansson, Sure, Iโll go ahead and create a new issue for this. The upcasting feature sounds really useful. If I understood it correctly, when a parameter like node:1 is passed, we automatically get the corresponding node entity in the tool: similar to how routes work.
Just out of curiosity, what should the 'data_type' be in such cases? I tried using entity:node, but it didnโt seem to work, because of this check in
Drupal\Core\Plugin\Context\ContextDefinition::__construct()
assert(!str_starts_with($data_type, 'entity:') || $this instanceof EntityContextDefinition);
-
marcus_johansson โ
committed d72065c4 on 1.2.x
Resolve #3532517 "Remove aidatatypeconverterpluginmanager from"
-
marcus_johansson โ
committed d72065c4 on 1.2.x