AiAssistant

interface AiAssistant

Interface defining the contract for an AI Assistant. This interface declares the methods that any AI Assistant implementation must provide.

Properties

Link copied to clipboard

The current AiAssistant configuration.

Link copied to clipboard
abstract val dataProvider: DataProvider?

The current data provider.

Link copied to clipboard

The current document identifiers.

Link copied to clipboard
abstract val responseState: Flow<CompletionResponse?>

The current response state.

Functions

Link copied to clipboard
abstract suspend fun checkIfDocumentIsAlreadyIngested(documentId: String, fileHash: String): AiAssistantRemoteClient.AiAssistantResponse<None>

Checks if a document is already ingested by verifying its ID and file hash.

Link copied to clipboard
abstract fun emitMessage(message: String, documentId: String)

Emits a message to the server.

Link copied to clipboard
abstract suspend fun getSessionHistory(): AiAssistantRemoteClient.AiAssistantResponse<List<CompletionResponse>>

Retrieves the session history for a given session ID.

Link copied to clipboard
abstract suspend fun ingestDocument(dataProvider: DataProvider, jwt: String): AiAssistantRemoteClient.AiAssistantResponse<IngestionResponse>

Ingests a document by uploading it to the server.

Link copied to clipboard
abstract suspend fun initialize(dataProvider: DataProvider, documentIdentifiers: DocumentIdentifiers, withSessionHistory: Boolean = true)

Initializes the assistant with the given data.

Link copied to clipboard
abstract suspend fun initializeSocketConnection(includeSessionHistory: Boolean = true)

Initializes a socket connection with the given text.

Link copied to clipboard
abstract fun terminate()

Terminates the assistant.

Link copied to clipboard
abstract suspend fun update(configuration: AiAssistantConfiguration)
abstract suspend fun update(documentIdentifiers: DocumentIdentifiers)

Updates the assistant with the latest data.