Package io.jmix.aitools.dataload
Interface AiDataLoadService
- All Known Implementing Classes:
AiDataLoadServiceImpl
public interface AiDataLoadService
Entry point of the LLM-powered natural-language data-load flow. Supports two modes:
-
conversational -
send(java.lang.String)/stream(java.lang.String)let the LLM answer free-form questions about the application's data and return a natural-language reply; -
data loading -
loadData(java.lang.String)generates a JPQL query for the user's request, executes it and returns the structuredEntityDataLoadResult.
conversationId run statelessly and do not persist chat history.-
Method Summary
Modifier and TypeMethodDescriptionGenerates 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 StringSends a stateless message to the data-load chat and blocks until the full reply is produced.reactor.core.publisher.Flux<String> Streams a stateless reply to the data-load chat as a flux of text chunks.
-
Method Details
-
send
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
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
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
-