Prompt ignored in vision plugin

Created on 28 March 2025, about 2 months ago

Problem/Motivation

The definition of the Drupal\ai_agents\Plugin\AiFunctionCall\Vision functioon call allows the provision of a prompt string, but the code in the execute() method immediately overrides it:

    // Collect the context values.
    $prompt = $this->getContextValue('prompt');
    $image_id = $this->getContextValue('image_id');
    $default = $this->aiProviderManager->getDefaultProviderForOperationType('chat_with_image_vision');
    $provider = $this->aiProviderManager->createInstance($default['provider_id']);
    $prompt = "Could you describe this image?\n";

Proposed resolution

Either the prompt in the definition should be removed and the hardcoded prompt relied on, or else the prompt from the definition should be used and only overwritten if it is not set.

🐛 Bug report
Status

Active

Version

1.1

Component

Code

Created by

🇬🇧United Kingdom MrDaleSmith

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