diff --git a/agent_v0/server_v1/api_stream.py b/agent_v0/server_v1/api_stream.py index 76fc36776..ade8acc97 100644 --- a/agent_v0/server_v1/api_stream.py +++ b/agent_v0/server_v1/api_stream.py @@ -4580,7 +4580,14 @@ def _resolve_by_grounding( return None # Prompt natif Qwen2.5-VL — format bbox_2d (le seul fiable) - prompt = f"Detect '{description}' in this image with a bounding box." + # Ajouter la position relative pour désambiguïser (ex: deux "Rechercher" à l'écran) + original_pos = target_spec.get("original_position", {}) + pos_hint = "" + y_rel = original_pos.get("y_relative", "") + x_rel = original_pos.get("x_relative", "") + if y_rel or x_rel: + pos_hint = f" located {y_rel} {x_rel} of the screen".strip() + prompt = f"Detect '{description}'{pos_hint} in this image with a bounding box." # Le grounding nécessite un modèle entraîné pour les coordonnées (bbox_2d). # Qwen2.5-VL est le seul qui retourne des positions précises.