private void handleException(EventStream eventStream, Throwable exception) {
        int errorCode = 400;
        if (exception instanceof LanguageModelException languageModelException) {
            errorCode = languageModelException.code();
        } else if (exception.getCause() instanceof LanguageModelException) {
            errorCode = ((LanguageModelException) exception.getCause()).code();
        }
        eventStream.error(languageModelId, new ErrorMessage(errorCode, "Error in LLM text generation", com.yahoo.yolean.Exceptions.toMessageString(exception)));
    }
Base class for LLM searchers. Provides utilities for calling LLMs and handling properties.

@author lesters
container-search/src/main/java/ai/vespa/search/llm/LLMSearcher.java