Closes#870. query.split()[0] in _generate_with_llm raised IndexError
when the LLM response 'query' field passed the keyword-startswith guard
but split to an empty list (e.g. if the guard is ever weakened during
refactoring). Compute parts once, return None when empty, and reuse
parts[0] for the query_type read.
Signed-off-by: SAY-5 <saiasish.cnp@gmail.com>