Spaces:
Paused
Paused
Fix input detection: prioritize URL input even when method state is incorrect
Browse files186 unmodified lines1871881891901911921937 unmodified lines20120220320420520620720820320921021121220721321421521650 unmodified lines2672682692702712722736 unmodified lines280281282283284285286276287288289290280291292293294186 unmodified lines input_type = "text" input_text = ""
# Determine which input source has actual content if input_method == "Завантаження файлу": if not file_input: return "❌ Помилка: Будь ласка, завантажте файл", None, session_id7 unmodified lines input_type = "url" input_text = url_input else: # Default to text input, but check if URL is provided instead if url_input and url_input.strip(): input_type = "url" input_text = url_input else: input_text = text_input input_text = text_input
# Check if input is empty and provide specific error message if not input_text or not input_text.strip(): if input_method == "URL посилання": if input_method == "URL посилання" or (url_input and url_input.strip()): return "❌ Помилка: Будь ласка, введіть URL посилання на судове рішення", None, session_id elif input_method == "Текстовий ввід": return "❌ Помилка: Будь ласка, введіть текст судового рішення", None, session_id50 unmodified lines """Process raw text search and update necessary states.""" try: input_text = "" # Determine which input source has actual content if method == "Завантаження файлу": if not file: return "❌ Помилка: Будь ласка, завантажте файл", None, state_lp_json6 unmodified lines elif method == "URL посилання": input_text = url else: # Default to text input, but check if URL is provided instead if url and url.strip(): input_text = url else: input_text = text input_text = text
# Check if input is empty and provide specific error message if not input_text or not input_text.strip(): if method == "URL посилання": if method == "URL посилання" or (url and url.strip()): return "❌ Помилка: Будь ласка, введіть URL посилання на судове рішення", None, state_lp_json elif method == "Текстовий ввід": return "❌ Помилка: Будь ласка, введіть текст судового рішення", None, state_lp_jsoninterface.py+15-4