Allow upcasting to be optional in tools
>>> [!note] Migrated issue
<!-- Drupal.org comment -->
<!-- Migrated from issue #3533321. -->
Reported by: [akhil babu](https://www.drupal.org/user/3632866)
Related to !782
>>>
<h3 id="summary-problem-motivation">Problem/Motivation</h3>
<p><span class="drupalorg-gitlab-issue-link project-issue-status-info project-issue-status-7"><a href="https://www.drupal.org/project/ai/issues/3512100" title="Status: Closed (fixed)">#3512100: Create AI DataTypeConverter for complex data types</a></span> introduced data type conversion capabilities for tools. Now, various <code>AiDataTypeConverter </code>plugins are available to automatically convert tool parameters to their expected data_type format. For example, <code>Drupal\ai\Plugin\AiDataTypeConverter\EntityConverter</code> can directly provide the full node object to the execute() method of an AI tool (i.e. AiFunctionCall plugin) when a parameter like node:1 is passed.</p>
<p>However, in some cases, this automatic conversion is not needed. The arguments passed to the tool should be used as is. <a href="https://www.drupal.org/project/ai/issues/3532517#comment-16171229" title="https://www.drupal.org/project/ai/issues/3532517#comment-16171229">This comment highlights one such scenario.</a></p>
<p><a href="https://www.drupal.org/project/ai/issues/3532517#comment-16171306" title="https://www.drupal.org/project/ai/issues/3532517#comment-16171306">As suggested here</a>, it would be helpful to provide a way for developers to opt out of this conversion when it's not desired.</p>
<h4 id="summary-steps-reproduce">Steps to reproduce (required for bugs, but not feature requests)</h4>
<h3 id="summary-proposed-resolution">Proposed resolution</h3>
<h3 id="summary-remaining-tasks">Remaining tasks</h3>
<h3>Optional: Other details as applicable (e.g., User interface changes, API changes, Data model changes</h3>
> Related issue: [Issue #3512100](https://www.drupal.org/node/3512100)
issue