Package io.nutrient.domain.ai
Interface AiAssistant
-
- All Implemented Interfaces:
public interface AiAssistant
Interface defining the contract for an AI Assistant. This interface declares the methods that any AI Assistant implementation must provide.
-
-
Method Summary
Modifier and Type Method Description abstract AiAssistantRemoteClient.AiAssistantResponse<IngestionResponse>
ingestDocument(DataProvider dataProvider, String jwt)
Ingests a document by uploading it to the server. abstract AiAssistantRemoteClient.AiAssistantResponse<None>
checkIfDocumentIsAlreadyIngested(String documentId, String fileHash)
Checks if a document is already ingested by verifying its ID and file hash. abstract AiAssistantRemoteClient.AiAssistantResponse<List<CompletionResponse>>
getSessionHistory()
Retrieves the session history for a given session ID. abstract Unit
initializeSocketConnection(Boolean includeSessionHistory)
Initializes a socket connection with the given text. abstract Unit
initialize(DataProvider dataProvider, DocumentIdentifiers documentIdentifiers, Boolean withSessionHistory)
Initializes the assistant with the given data. abstract Unit
update(DocumentIdentifiers documentIdentifiers)
Updates the assistant with the latest data. abstract Unit
update(AiAssistantConfiguration configuration)
Updates the assistant with the latest data. abstract Unit
emitMessage(String message, String documentId)
Emits a message to the server. abstract Unit
terminate()
Terminates the assistant. abstract AiAssistantConfiguration
getConfiguration()
The current AiAssistant configuration. abstract DocumentIdentifiers
getIdentifiers()
The current document identifiers. abstract DataProvider
getDataProvider()
The current data provider. abstract Flow<CompletionResponse>
getResponseState()
The current response state. -
-
Method Detail
-
ingestDocument
abstract AiAssistantRemoteClient.AiAssistantResponse<IngestionResponse> ingestDocument(DataProvider dataProvider, String jwt)
Ingests a document by uploading it to the server.
- Parameters:
dataProvider
- The data provider for the document.jwt
- The JWT token for authentication.- Returns:
The result of the ingestion operation.
-
checkIfDocumentIsAlreadyIngested
abstract AiAssistantRemoteClient.AiAssistantResponse<None> checkIfDocumentIsAlreadyIngested(String documentId, String fileHash)
Checks if a document is already ingested by verifying its ID and file hash.
- Parameters:
documentId
- The ID of the document.fileHash
- The hash of the file.- Returns:
The result of the check operation.
-
getSessionHistory
abstract AiAssistantRemoteClient.AiAssistantResponse<List<CompletionResponse>> getSessionHistory()
Retrieves the session history for a given session ID.
- Returns:
The session history.
-
initializeSocketConnection
abstract Unit initializeSocketConnection(Boolean includeSessionHistory)
Initializes a socket connection with the given text.
- Parameters:
includeSessionHistory
- A flag to indicate if the session history should be included in the response.
-
initialize
abstract Unit initialize(DataProvider dataProvider, DocumentIdentifiers documentIdentifiers, Boolean withSessionHistory)
Initializes the assistant with the given data.
- Parameters:
dataProvider
- The data provider for the document.documentIdentifiers
- The document identifiers.withSessionHistory
- A flag to indicate if the session history should be included in the response.
-
update
abstract Unit update(DocumentIdentifiers documentIdentifiers)
Updates the assistant with the latest data.
- Parameters:
documentIdentifiers
- The document identifiers.
-
update
abstract Unit update(AiAssistantConfiguration configuration)
Updates the assistant with the latest data.
- Parameters:
configuration
- The configuration to update.
-
emitMessage
abstract Unit emitMessage(String message, String documentId)
Emits a message to the server.
- Parameters:
message
- The text to emit.documentId
- The documentId to emit the message to.
-
getConfiguration
abstract AiAssistantConfiguration getConfiguration()
The current AiAssistant configuration.
-
getIdentifiers
abstract DocumentIdentifiers getIdentifiers()
The current document identifiers.
-
getDataProvider
abstract DataProvider getDataProvider()
The current data provider.
-
getResponseState
abstract Flow<CompletionResponse> getResponseState()
The current response state.
-
-
-
-