AIAgentStorageAPI

Functions

Link copied to clipboard
abstract suspend fun clear()

Clears all data from the storage.

Link copied to clipboard
abstract suspend fun <T : Any> get(key: AIAgentStorageKey<T>): T?

Retrieves the value associated with the given key from the storage.

Link copied to clipboard
abstract suspend fun <T : Any> getValue(key: AIAgentStorageKey<T>): T

Retrieves the non-null value associated with the given key from the storage. If the key does not exist in the storage, a NoSuchElementException is thrown.

Link copied to clipboard
abstract suspend fun putAll(map: Map<AIAgentStorageKey<*>, Any>)

Adds all key-value pairs from the given map to the storage.

Link copied to clipboard
abstract suspend fun <T : Any> remove(key: AIAgentStorageKey<T>): T?

Removes the value associated with the given key from the storage.

Link copied to clipboard
abstract suspend fun <T : Any> set(key: AIAgentStorageKey<T>, value: T)

Sets the value associated with the given key in the storage.

Link copied to clipboard
abstract suspend fun toMap(): Map<AIAgentStorageKey<*>, Any>

Converts the storage to a map representation.