Interface AiDataLoadService

All Known Implementing Classes:
AiDataLoadServiceImpl

public interface AiDataLoadService
Entry point of the LLM-powered natural-language data-load flow. Supports two modes: Methods without conversationId run statelessly and do not persist chat history.
  • Method Summary

    Modifier and Type
    Method
    Description
    loadData(String userText)
    Generates a JPQL query for the given natural-language request, executes it and returns the query that ran (or failed validation), its validation result and the fetched rows.
    @Nullable String
    send(String message)
    Sends a stateless message to the data-load chat and blocks until the full reply is produced.
    reactor.core.publisher.Flux<String>
    stream(String message)
    Streams a stateless reply to the data-load chat as a flux of text chunks.
  • Method Details

    • send

      @Nullable String send(String message)
      Sends a stateless message to the data-load chat and blocks until the full reply is produced. Chat history is not persisted.
      Parameters:
      message - user message in natural language
      Returns:
      natural-language reply from the LLM
    • stream

      reactor.core.publisher.Flux<String> stream(String message)
      Streams a stateless reply to the data-load chat as a flux of text chunks. Chat history is not persisted.
      Parameters:
      message - user message in natural language
      Returns:
      flux emitting reply chunks in order
    • loadData

      EntityDataLoadResult loadData(String userText)
      Generates a JPQL query for the given natural-language request, executes it and returns the query that ran (or failed validation), its validation result and the fetched rows. Runs statelessly without persisting chat history.

      The query runs as the current user, so the rows hold only the records that user may see. A related record hidden from the user reads as an absent one: an empty reference does not prove that the data is missing.

      Parameters:
      userText - user request in natural language
      Returns:
      result containing the executed query or the one that failed validation, its validation result and the fetched rows