public String getPrompt(Query query) {
        // Look for prompt with or without prefix given in query
        String prompt = lookupPropertyWithOrWithoutPrefix(PROMPT_PROPERTY, p -> query.properties().getString(p));
        if (prompt != null)
            return prompt;

        // Look for prompt defined in config
        if (this.prompt != null && ! this.prompt.isEmpty())
            return this.prompt;

        // If not found, use query directly
        prompt = query.getModel().getQueryString();
        if (prompt != null)
            return prompt;

        // If not, throw exception
        throw new IllegalArgumentException("Could not find prompt found for query. Tried looking for " +
                "'" + propertyPrefix + "." + PROMPT_PROPERTY + "', '" + PROMPT_PROPERTY + "' or '@query'.");
    }
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