From 535b818f48157e4c43fc074b3a9dc5a073f39495 Mon Sep 17 00:00:00 2001 From: David Vega Lichacz <7826728+realdavidvega@users.noreply.github.com> Date: Mon, 30 Sep 2024 17:55:46 +0200 Subject: [PATCH] feat: make functions suspend if we want to use some effect --- .../com/xebia/functional/xef/llm/assistants/CachedTool.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/commonMain/kotlin/com/xebia/functional/xef/llm/assistants/CachedTool.kt b/core/src/commonMain/kotlin/com/xebia/functional/xef/llm/assistants/CachedTool.kt index 0835d0d53..ddb1e3352 100644 --- a/core/src/commonMain/kotlin/com/xebia/functional/xef/llm/assistants/CachedTool.kt +++ b/core/src/commonMain/kotlin/com/xebia/functional/xef/llm/assistants/CachedTool.kt @@ -28,7 +28,7 @@ abstract class CachedTool( * * @return true if the cache should be used. */ - open fun shouldUseCache(input: Input): Boolean = true + open suspend fun shouldUseCache(input: Input): Boolean = true /** * Criteria to check if the result should be cached based on the given [input] and [output]. By @@ -36,7 +36,7 @@ abstract class CachedTool( * * @return true if the result should be cached. */ - open fun shouldCacheOutput(input: Input, output: Output): Boolean = true + open suspend fun shouldCacheOutput(input: Input, output: Output): Boolean = true /** * Caches the result of [onCacheMissed] if [shouldCacheOutput] returns true. Otherwise, returns