File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -208,11 +208,21 @@ def respond(
208208 model_name = model_config .get ("name" )
209209 base_url_override = model_config .get ("base_url" ) # Can be None for OpenAI
210210 log .info (f"Model config: { model } -> name={ model_name } , base_url={ base_url_override } " )
211+
212+ effective_paths = file_paths or (state .last_files or [])
213+
214+ if not effective_paths :
215+ reply .text += (
216+ "⚠️ Please upload an image first (or re-upload). "
217+ "I need at least one image to recommend tools for your data."
218+ )
219+ state .conversation_history .append (f"Assistant: { reply .text } " )
220+ return reply , state
211221
212222 try :
213223 agent_result = run_agent (
214224 clean_message ,
215- image_paths = file_paths ,
225+ image_paths = effective_paths ,
216226 image_bytes = image_bytes , # Pass image bytes to VLM
217227 excluded = list (state .banlist ),
218228 conversation_history = state .conversation_history ,
You can’t perform that action at this time.
0 commit comments