diff --git a/core/src/commonMain/kotlin/com/xebia/functional/xef/AIError.kt b/core/src/commonMain/kotlin/com/xebia/functional/xef/AIError.kt index f7eaa549f..bcb40e5bf 100644 --- a/core/src/commonMain/kotlin/com/xebia/functional/xef/AIError.kt +++ b/core/src/commonMain/kotlin/com/xebia/functional/xef/AIError.kt @@ -1,7 +1,6 @@ package com.xebia.functional.xef import arrow.core.NonEmptyList -import com.xebia.functional.xef.llm.models.chat.Message import kotlin.jvm.JvmOverloads sealed class AIError @JvmOverloads constructor(message: String, cause: Throwable? = null) : @@ -9,24 +8,6 @@ sealed class AIError @JvmOverloads constructor(message: String, cause: Throwable class NoResponse : AIError("No response from the AI") - data class MessagesExceedMaxTokenLength( - val messages: List, - val promptTokens: Int, - val maxTokens: Int - ) : - AIError( - "Prompt exceeds max token length: $promptTokens + $maxTokens = ${promptTokens + maxTokens}" - ) - - data class PromptExceedsMaxTokenLength( - val prompt: String, - val promptTokens: Int, - val maxTokens: Int - ) : - AIError( - "Prompt exceeds max token length: $promptTokens + $maxTokens = ${promptTokens + maxTokens}" - ) - data class PromptExceedsMaxRemainingTokenLength(val promptTokens: Int, val maxTokens: Int) : AIError( "Prompt exceeds max remaining token length: $promptTokens + $maxTokens = ${promptTokens + maxTokens}" diff --git a/core/src/commonMain/kotlin/com/xebia/functional/xef/auto/AiDsl.kt b/core/src/commonMain/kotlin/com/xebia/functional/xef/auto/AiDsl.kt deleted file mode 100644 index aa19f97b9..000000000 --- a/core/src/commonMain/kotlin/com/xebia/functional/xef/auto/AiDsl.kt +++ /dev/null @@ -1,3 +0,0 @@ -package com.xebia.functional.xef.auto - -@DslMarker annotation class AiDsl diff --git a/core/src/commonMain/kotlin/com/xebia/functional/xef/conversation/AiDsl.kt b/core/src/commonMain/kotlin/com/xebia/functional/xef/conversation/AiDsl.kt new file mode 100644 index 000000000..ad3b06720 --- /dev/null +++ b/core/src/commonMain/kotlin/com/xebia/functional/xef/conversation/AiDsl.kt @@ -0,0 +1,3 @@ +package com.xebia.functional.xef.conversation + +@DslMarker annotation class AiDsl diff --git a/core/src/commonMain/kotlin/com/xebia/functional/xef/auto/AutoClose.kt b/core/src/commonMain/kotlin/com/xebia/functional/xef/conversation/AutoClose.kt similarity index 96% rename from core/src/commonMain/kotlin/com/xebia/functional/xef/auto/AutoClose.kt rename to core/src/commonMain/kotlin/com/xebia/functional/xef/conversation/AutoClose.kt index 033e20659..baa9900cb 100644 --- a/core/src/commonMain/kotlin/com/xebia/functional/xef/auto/AutoClose.kt +++ b/core/src/commonMain/kotlin/com/xebia/functional/xef/conversation/AutoClose.kt @@ -1,4 +1,4 @@ -package com.xebia.functional.xef.auto +package com.xebia.functional.xef.conversation import arrow.atomic.Atomic import arrow.atomic.update diff --git a/core/src/commonMain/kotlin/com/xebia/functional/xef/auto/Conversation.kt b/core/src/commonMain/kotlin/com/xebia/functional/xef/conversation/Conversation.kt similarity index 94% rename from core/src/commonMain/kotlin/com/xebia/functional/xef/auto/Conversation.kt rename to core/src/commonMain/kotlin/com/xebia/functional/xef/conversation/Conversation.kt index ffa9411a0..8a589d534 100644 --- a/core/src/commonMain/kotlin/com/xebia/functional/xef/auto/Conversation.kt +++ b/core/src/commonMain/kotlin/com/xebia/functional/xef/conversation/Conversation.kt @@ -1,4 +1,4 @@ -package com.xebia.functional.xef.auto +package com.xebia.functional.xef.conversation import com.xebia.functional.xef.AIError import com.xebia.functional.xef.llm.Chat @@ -7,8 +7,8 @@ import com.xebia.functional.xef.llm.Images import com.xebia.functional.xef.llm.models.functions.CFunction import com.xebia.functional.xef.llm.models.images.ImagesGenerationResponse import com.xebia.functional.xef.prompt.Prompt -import com.xebia.functional.xef.vectorstores.ConversationId -import com.xebia.functional.xef.vectorstores.VectorStore +import com.xebia.functional.xef.store.ConversationId +import com.xebia.functional.xef.store.VectorStore import kotlin.jvm.JvmSynthetic import kotlinx.coroutines.flow.Flow import kotlinx.serialization.KSerializer diff --git a/core/src/commonMain/kotlin/com/xebia/functional/xef/auto/Description.kt b/core/src/commonMain/kotlin/com/xebia/functional/xef/conversation/Description.kt similarity index 90% rename from core/src/commonMain/kotlin/com/xebia/functional/xef/auto/Description.kt rename to core/src/commonMain/kotlin/com/xebia/functional/xef/conversation/Description.kt index da294e875..e9c7a870a 100644 --- a/core/src/commonMain/kotlin/com/xebia/functional/xef/auto/Description.kt +++ b/core/src/commonMain/kotlin/com/xebia/functional/xef/conversation/Description.kt @@ -1,4 +1,4 @@ -package com.xebia.functional.xef.auto +package com.xebia.functional.xef.conversation import kotlinx.serialization.ExperimentalSerializationApi import kotlinx.serialization.SerialInfo diff --git a/core/src/commonMain/kotlin/com/xebia/functional/xef/auto/MessagePolicy.kt b/core/src/commonMain/kotlin/com/xebia/functional/xef/conversation/MessagePolicy.kt similarity index 93% rename from core/src/commonMain/kotlin/com/xebia/functional/xef/auto/MessagePolicy.kt rename to core/src/commonMain/kotlin/com/xebia/functional/xef/conversation/MessagePolicy.kt index 9c809ce68..d664c24f5 100644 --- a/core/src/commonMain/kotlin/com/xebia/functional/xef/auto/MessagePolicy.kt +++ b/core/src/commonMain/kotlin/com/xebia/functional/xef/conversation/MessagePolicy.kt @@ -1,4 +1,4 @@ -package com.xebia.functional.xef.auto +package com.xebia.functional.xef.conversation import kotlinx.serialization.Serializable diff --git a/core/src/commonMain/kotlin/com/xebia/functional/xef/auto/PlatformConversation.kt b/core/src/commonMain/kotlin/com/xebia/functional/xef/conversation/PlatformConversation.kt similarity index 62% rename from core/src/commonMain/kotlin/com/xebia/functional/xef/auto/PlatformConversation.kt rename to core/src/commonMain/kotlin/com/xebia/functional/xef/conversation/PlatformConversation.kt index 90931bc4d..9b122aee8 100644 --- a/core/src/commonMain/kotlin/com/xebia/functional/xef/auto/PlatformConversation.kt +++ b/core/src/commonMain/kotlin/com/xebia/functional/xef/conversation/PlatformConversation.kt @@ -1,7 +1,7 @@ -package com.xebia.functional.xef.auto +package com.xebia.functional.xef.conversation -import com.xebia.functional.xef.vectorstores.ConversationId -import com.xebia.functional.xef.vectorstores.VectorStore +import com.xebia.functional.xef.store.ConversationId +import com.xebia.functional.xef.store.VectorStore expect abstract class PlatformConversation( store: VectorStore, diff --git a/core/src/commonMain/kotlin/com/xebia/functional/xef/llm/Chat.kt b/core/src/commonMain/kotlin/com/xebia/functional/xef/llm/Chat.kt index dddc4d14a..15b737175 100644 --- a/core/src/commonMain/kotlin/com/xebia/functional/xef/llm/Chat.kt +++ b/core/src/commonMain/kotlin/com/xebia/functional/xef/llm/Chat.kt @@ -2,8 +2,8 @@ package com.xebia.functional.xef.llm import com.xebia.functional.tokenizer.ModelType import com.xebia.functional.xef.AIError -import com.xebia.functional.xef.auto.AiDsl -import com.xebia.functional.xef.auto.Conversation +import com.xebia.functional.xef.conversation.AiDsl +import com.xebia.functional.xef.conversation.Conversation import com.xebia.functional.xef.llm.models.chat.* import com.xebia.functional.xef.prompt.Prompt import kotlinx.coroutines.flow.Flow diff --git a/core/src/commonMain/kotlin/com/xebia/functional/xef/llm/ChatWithFunctions.kt b/core/src/commonMain/kotlin/com/xebia/functional/xef/llm/ChatWithFunctions.kt index 294a57a10..7b620bc64 100644 --- a/core/src/commonMain/kotlin/com/xebia/functional/xef/llm/ChatWithFunctions.kt +++ b/core/src/commonMain/kotlin/com/xebia/functional/xef/llm/ChatWithFunctions.kt @@ -3,8 +3,8 @@ package com.xebia.functional.xef.llm import arrow.core.nonFatalOrThrow import arrow.core.raise.catch import com.xebia.functional.xef.AIError -import com.xebia.functional.xef.auto.AiDsl -import com.xebia.functional.xef.auto.Conversation +import com.xebia.functional.xef.conversation.AiDsl +import com.xebia.functional.xef.conversation.Conversation import com.xebia.functional.xef.llm.models.chat.ChatCompletionRequestWithFunctions import com.xebia.functional.xef.llm.models.chat.ChatCompletionResponseWithFunctions import com.xebia.functional.xef.llm.models.functions.CFunction diff --git a/core/src/commonMain/kotlin/com/xebia/functional/xef/llm/Images.kt b/core/src/commonMain/kotlin/com/xebia/functional/xef/llm/Images.kt index 2ff0a56f8..ce10a6a55 100644 --- a/core/src/commonMain/kotlin/com/xebia/functional/xef/llm/Images.kt +++ b/core/src/commonMain/kotlin/com/xebia/functional/xef/llm/Images.kt @@ -3,7 +3,7 @@ package com.xebia.functional.xef.llm import com.xebia.functional.xef.llm.models.images.ImagesGenerationRequest import com.xebia.functional.xef.llm.models.images.ImagesGenerationResponse import com.xebia.functional.xef.prompt.Prompt -import com.xebia.functional.xef.vectorstores.VectorStore +import com.xebia.functional.xef.store.VectorStore interface Images : LLM { suspend fun createImages(request: ImagesGenerationRequest): ImagesGenerationResponse diff --git a/core/src/commonMain/kotlin/com/xebia/functional/xef/llm/MemoryManagement.kt b/core/src/commonMain/kotlin/com/xebia/functional/xef/llm/MemoryManagement.kt index a62cf34a7..b7ecbb7c3 100644 --- a/core/src/commonMain/kotlin/com/xebia/functional/xef/llm/MemoryManagement.kt +++ b/core/src/commonMain/kotlin/com/xebia/functional/xef/llm/MemoryManagement.kt @@ -1,8 +1,8 @@ package com.xebia.functional.xef.llm -import com.xebia.functional.xef.auto.Conversation +import com.xebia.functional.xef.conversation.Conversation import com.xebia.functional.xef.llm.models.chat.* -import com.xebia.functional.xef.vectorstores.Memory +import com.xebia.functional.xef.store.Memory import io.ktor.util.date.* internal object MemoryManagement { diff --git a/core/src/commonMain/kotlin/com/xebia/functional/xef/llm/PromptCalculator.kt b/core/src/commonMain/kotlin/com/xebia/functional/xef/llm/PromptCalculator.kt index 3f5f9ae2e..92f9b6982 100644 --- a/core/src/commonMain/kotlin/com/xebia/functional/xef/llm/PromptCalculator.kt +++ b/core/src/commonMain/kotlin/com/xebia/functional/xef/llm/PromptCalculator.kt @@ -2,11 +2,11 @@ package com.xebia.functional.xef.llm import com.xebia.functional.tokenizer.truncateText import com.xebia.functional.xef.AIError -import com.xebia.functional.xef.auto.Conversation +import com.xebia.functional.xef.conversation.Conversation import com.xebia.functional.xef.llm.models.chat.Message import com.xebia.functional.xef.prompt.Prompt import com.xebia.functional.xef.prompt.templates.assistant -import com.xebia.functional.xef.vectorstores.Memory +import com.xebia.functional.xef.store.Memory internal object PromptCalculator { diff --git a/core/src/commonMain/kotlin/com/xebia/functional/xef/llm/models/functions/JsonSchema.kt b/core/src/commonMain/kotlin/com/xebia/functional/xef/llm/models/functions/JsonSchema.kt index 4b317beaa..df7ee3c7b 100644 --- a/core/src/commonMain/kotlin/com/xebia/functional/xef/llm/models/functions/JsonSchema.kt +++ b/core/src/commonMain/kotlin/com/xebia/functional/xef/llm/models/functions/JsonSchema.kt @@ -13,7 +13,7 @@ which states the following: // TODO: We should consider a fork and maintain it ourselves. */ -import com.xebia.functional.xef.auto.Description +import com.xebia.functional.xef.conversation.Description import kotlin.jvm.JvmMultifileClass import kotlin.jvm.JvmName import kotlinx.serialization.ExperimentalSerializationApi diff --git a/core/src/commonMain/kotlin/com/xebia/functional/xef/prompt/configuration/PromptConfiguration.kt b/core/src/commonMain/kotlin/com/xebia/functional/xef/prompt/configuration/PromptConfiguration.kt index ff0c5cf11..dda37f123 100644 --- a/core/src/commonMain/kotlin/com/xebia/functional/xef/prompt/configuration/PromptConfiguration.kt +++ b/core/src/commonMain/kotlin/com/xebia/functional/xef/prompt/configuration/PromptConfiguration.kt @@ -1,6 +1,6 @@ package com.xebia.functional.xef.prompt.configuration -import com.xebia.functional.xef.auto.MessagePolicy +import com.xebia.functional.xef.conversation.MessagePolicy import com.xebia.functional.xef.llm.models.chat.Role import kotlin.jvm.JvmField import kotlin.jvm.JvmOverloads diff --git a/core/src/commonMain/kotlin/com/xebia/functional/xef/prompt/evaluator/PromptEvaluator.kt b/core/src/commonMain/kotlin/com/xebia/functional/xef/prompt/evaluator/PromptEvaluator.kt index 7a844d037..6e483f47e 100644 --- a/core/src/commonMain/kotlin/com/xebia/functional/xef/prompt/evaluator/PromptEvaluator.kt +++ b/core/src/commonMain/kotlin/com/xebia/functional/xef/prompt/evaluator/PromptEvaluator.kt @@ -1,6 +1,6 @@ package com.xebia.functional.xef.prompt.evaluator -import com.xebia.functional.xef.auto.Conversation +import com.xebia.functional.xef.conversation.Conversation import com.xebia.functional.xef.llm.Chat import com.xebia.functional.xef.prompt.Prompt import com.xebia.functional.xef.prompt.templates.system diff --git a/core/src/commonMain/kotlin/com/xebia/functional/xef/prompt/expressions/Expression.kt b/core/src/commonMain/kotlin/com/xebia/functional/xef/prompt/expressions/Expression.kt index a15a30eaf..07bdaa325 100644 --- a/core/src/commonMain/kotlin/com/xebia/functional/xef/prompt/expressions/Expression.kt +++ b/core/src/commonMain/kotlin/com/xebia/functional/xef/prompt/expressions/Expression.kt @@ -1,6 +1,6 @@ package com.xebia.functional.xef.prompt.expressions -import com.xebia.functional.xef.auto.Conversation +import com.xebia.functional.xef.conversation.Conversation import com.xebia.functional.xef.llm.ChatWithFunctions import com.xebia.functional.xef.llm.models.chat.Message import com.xebia.functional.xef.prompt.Prompt diff --git a/core/src/commonMain/kotlin/com/xebia/functional/xef/prompt/expressions/ReplacedValues.kt b/core/src/commonMain/kotlin/com/xebia/functional/xef/prompt/expressions/ReplacedValues.kt index 8b0cc2276..e54d23724 100644 --- a/core/src/commonMain/kotlin/com/xebia/functional/xef/prompt/expressions/ReplacedValues.kt +++ b/core/src/commonMain/kotlin/com/xebia/functional/xef/prompt/expressions/ReplacedValues.kt @@ -1,6 +1,6 @@ package com.xebia.functional.xef.prompt.expressions -import com.xebia.functional.xef.auto.Description +import com.xebia.functional.xef.conversation.Description import kotlinx.serialization.Serializable @Serializable diff --git a/core/src/commonMain/kotlin/com/xebia/functional/xef/prompt/expressions/Replacement.kt b/core/src/commonMain/kotlin/com/xebia/functional/xef/prompt/expressions/Replacement.kt index 6e91bad68..7927adb22 100644 --- a/core/src/commonMain/kotlin/com/xebia/functional/xef/prompt/expressions/Replacement.kt +++ b/core/src/commonMain/kotlin/com/xebia/functional/xef/prompt/expressions/Replacement.kt @@ -1,6 +1,6 @@ package com.xebia.functional.xef.prompt.expressions -import com.xebia.functional.xef.auto.Description +import com.xebia.functional.xef.conversation.Description import kotlinx.serialization.Serializable @Serializable diff --git a/core/src/commonMain/kotlin/com/xebia/functional/xef/prompt/lang/Infer.kt b/core/src/commonMain/kotlin/com/xebia/functional/xef/prompt/lang/Infer.kt index b86eff9c0..656cca2d5 100644 --- a/core/src/commonMain/kotlin/com/xebia/functional/xef/prompt/lang/Infer.kt +++ b/core/src/commonMain/kotlin/com/xebia/functional/xef/prompt/lang/Infer.kt @@ -1,6 +1,6 @@ package com.xebia.functional.xef.prompt.lang -import com.xebia.functional.xef.auto.Conversation +import com.xebia.functional.xef.conversation.Conversation import com.xebia.functional.xef.llm.ChatWithFunctions import com.xebia.functional.xef.prompt.Prompt import com.xebia.functional.xef.prompt.templates.system diff --git a/core/src/commonMain/kotlin/com/xebia/functional/xef/prompt/lang/Program.kt b/core/src/commonMain/kotlin/com/xebia/functional/xef/prompt/lang/Program.kt deleted file mode 100644 index abddd23a2..000000000 --- a/core/src/commonMain/kotlin/com/xebia/functional/xef/prompt/lang/Program.kt +++ /dev/null @@ -1,21 +0,0 @@ -package com.xebia.functional.xef.prompt.lang - -import com.xebia.functional.xef.auto.Conversation -import com.xebia.functional.xef.llm.ChatWithFunctions -import com.xebia.functional.xef.prompt.Prompt -import com.xebia.functional.xef.prompt.templates.user -import kotlinx.serialization.serializer - -class Program( - val model: ChatWithFunctions, - val conversation: Conversation, - val description: String, -) { - suspend inline operator fun invoke(input: A): B { - return model.prompt( - prompt = Prompt { +user(input) }, - scope = conversation, - serializer = serializer(), - ) - } -} diff --git a/core/src/commonMain/kotlin/com/xebia/functional/xef/vectorstores/CombinedVectorStore.kt b/core/src/commonMain/kotlin/com/xebia/functional/xef/store/CombinedVectorStore.kt similarity index 96% rename from core/src/commonMain/kotlin/com/xebia/functional/xef/vectorstores/CombinedVectorStore.kt rename to core/src/commonMain/kotlin/com/xebia/functional/xef/store/CombinedVectorStore.kt index 9546c37fc..b9018c393 100644 --- a/core/src/commonMain/kotlin/com/xebia/functional/xef/vectorstores/CombinedVectorStore.kt +++ b/core/src/commonMain/kotlin/com/xebia/functional/xef/store/CombinedVectorStore.kt @@ -1,4 +1,4 @@ -package com.xebia.functional.xef.vectorstores +package com.xebia.functional.xef.store import com.xebia.functional.xef.embeddings.Embedding diff --git a/core/src/commonMain/kotlin/com/xebia/functional/xef/vectorstores/ConversationId.kt b/core/src/commonMain/kotlin/com/xebia/functional/xef/store/ConversationId.kt similarity index 50% rename from core/src/commonMain/kotlin/com/xebia/functional/xef/vectorstores/ConversationId.kt rename to core/src/commonMain/kotlin/com/xebia/functional/xef/store/ConversationId.kt index d689a832e..b5c30a76b 100644 --- a/core/src/commonMain/kotlin/com/xebia/functional/xef/vectorstores/ConversationId.kt +++ b/core/src/commonMain/kotlin/com/xebia/functional/xef/store/ConversationId.kt @@ -1,3 +1,3 @@ -package com.xebia.functional.xef.vectorstores +package com.xebia.functional.xef.store data class ConversationId(val value: String) diff --git a/core/src/commonMain/kotlin/com/xebia/functional/xef/vectorstores/LocalVectorStore.kt b/core/src/commonMain/kotlin/com/xebia/functional/xef/store/LocalVectorStore.kt similarity index 98% rename from core/src/commonMain/kotlin/com/xebia/functional/xef/vectorstores/LocalVectorStore.kt rename to core/src/commonMain/kotlin/com/xebia/functional/xef/store/LocalVectorStore.kt index d513bfd17..d1cc6b6cd 100644 --- a/core/src/commonMain/kotlin/com/xebia/functional/xef/vectorstores/LocalVectorStore.kt +++ b/core/src/commonMain/kotlin/com/xebia/functional/xef/store/LocalVectorStore.kt @@ -1,4 +1,4 @@ -package com.xebia.functional.xef.vectorstores +package com.xebia.functional.xef.store import arrow.atomic.Atomic import arrow.atomic.getAndUpdate diff --git a/core/src/commonMain/kotlin/com/xebia/functional/xef/vectorstores/Memory.kt b/core/src/commonMain/kotlin/com/xebia/functional/xef/store/Memory.kt similarity index 90% rename from core/src/commonMain/kotlin/com/xebia/functional/xef/vectorstores/Memory.kt rename to core/src/commonMain/kotlin/com/xebia/functional/xef/store/Memory.kt index 504708c65..b27019884 100644 --- a/core/src/commonMain/kotlin/com/xebia/functional/xef/vectorstores/Memory.kt +++ b/core/src/commonMain/kotlin/com/xebia/functional/xef/store/Memory.kt @@ -1,4 +1,4 @@ -package com.xebia.functional.xef.vectorstores +package com.xebia.functional.xef.store import com.xebia.functional.xef.llm.models.chat.Message diff --git a/core/src/commonMain/kotlin/com/xebia/functional/xef/vectorstores/MemoryUtils.kt b/core/src/commonMain/kotlin/com/xebia/functional/xef/store/MemoryUtils.kt similarity index 88% rename from core/src/commonMain/kotlin/com/xebia/functional/xef/vectorstores/MemoryUtils.kt rename to core/src/commonMain/kotlin/com/xebia/functional/xef/store/MemoryUtils.kt index b8e7c9606..994216dbe 100644 --- a/core/src/commonMain/kotlin/com/xebia/functional/xef/vectorstores/MemoryUtils.kt +++ b/core/src/commonMain/kotlin/com/xebia/functional/xef/store/MemoryUtils.kt @@ -1,4 +1,4 @@ -package com.xebia.functional.xef.vectorstores +package com.xebia.functional.xef.store fun List.reduceByLimitToken(limitTokens: Int): List = fold(Pair(0, emptyList())) { (accTokens, list), memory -> diff --git a/core/src/commonMain/kotlin/com/xebia/functional/xef/vectorstores/VectorStore.kt b/core/src/commonMain/kotlin/com/xebia/functional/xef/store/VectorStore.kt similarity index 97% rename from core/src/commonMain/kotlin/com/xebia/functional/xef/vectorstores/VectorStore.kt rename to core/src/commonMain/kotlin/com/xebia/functional/xef/store/VectorStore.kt index 615166fcb..b2936a5c5 100644 --- a/core/src/commonMain/kotlin/com/xebia/functional/xef/vectorstores/VectorStore.kt +++ b/core/src/commonMain/kotlin/com/xebia/functional/xef/store/VectorStore.kt @@ -1,4 +1,4 @@ -package com.xebia.functional.xef.vectorstores +package com.xebia.functional.xef.store import com.xebia.functional.xef.embeddings.Embedding import kotlin.jvm.JvmStatic diff --git a/core/src/commonTest/kotlin/com/xebia/functional/xef/auto/ConversationSpec.kt b/core/src/commonTest/kotlin/com/xebia/functional/xef/conversation/ConversationSpec.kt similarity index 96% rename from core/src/commonTest/kotlin/com/xebia/functional/xef/auto/ConversationSpec.kt rename to core/src/commonTest/kotlin/com/xebia/functional/xef/conversation/ConversationSpec.kt index 380c34fc6..e4e3cd8e2 100644 --- a/core/src/commonTest/kotlin/com/xebia/functional/xef/auto/ConversationSpec.kt +++ b/core/src/commonTest/kotlin/com/xebia/functional/xef/conversation/ConversationSpec.kt @@ -1,4 +1,4 @@ -package com.xebia.functional.xef.auto +package com.xebia.functional.xef.conversation import com.xebia.functional.tokenizer.ModelType import com.xebia.functional.xef.data.TestEmbeddings @@ -6,8 +6,8 @@ import com.xebia.functional.xef.data.TestModel import com.xebia.functional.xef.llm.models.chat.Message import com.xebia.functional.xef.llm.models.chat.Role import com.xebia.functional.xef.prompt.Prompt -import com.xebia.functional.xef.vectorstores.ConversationId -import com.xebia.functional.xef.vectorstores.LocalVectorStore +import com.xebia.functional.xef.store.ConversationId +import com.xebia.functional.xef.store.LocalVectorStore import io.kotest.core.spec.style.StringSpec import io.kotest.matchers.ints.shouldBeLessThan import io.kotest.matchers.shouldBe diff --git a/core/src/commonTest/kotlin/com/xebia/functional/xef/auto/MessagesData.kt b/core/src/commonTest/kotlin/com/xebia/functional/xef/conversation/MessagesData.kt similarity index 94% rename from core/src/commonTest/kotlin/com/xebia/functional/xef/auto/MessagesData.kt rename to core/src/commonTest/kotlin/com/xebia/functional/xef/conversation/MessagesData.kt index f7ea3e264..d5cbbd8a6 100644 --- a/core/src/commonTest/kotlin/com/xebia/functional/xef/auto/MessagesData.kt +++ b/core/src/commonTest/kotlin/com/xebia/functional/xef/conversation/MessagesData.kt @@ -1,4 +1,4 @@ -package com.xebia.functional.xef.auto +package com.xebia.functional.xef.conversation val lorem = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum." diff --git a/core/src/commonTest/kotlin/com/xebia/functional/xef/vectorstores/CombinedVectorStoreSpec.kt b/core/src/commonTest/kotlin/com/xebia/functional/xef/store/CombinedVectorStoreSpec.kt similarity index 98% rename from core/src/commonTest/kotlin/com/xebia/functional/xef/vectorstores/CombinedVectorStoreSpec.kt rename to core/src/commonTest/kotlin/com/xebia/functional/xef/store/CombinedVectorStoreSpec.kt index 960818d57..a75bc0d6b 100644 --- a/core/src/commonTest/kotlin/com/xebia/functional/xef/vectorstores/CombinedVectorStoreSpec.kt +++ b/core/src/commonTest/kotlin/com/xebia/functional/xef/store/CombinedVectorStoreSpec.kt @@ -1,4 +1,4 @@ -package com.xebia.functional.xef.vectorstores +package com.xebia.functional.xef.store import com.xebia.functional.xef.data.TestEmbeddings import io.kotest.core.spec.style.StringSpec diff --git a/core/src/commonTest/kotlin/com/xebia/functional/xef/vectorstores/LocalVectorStoreSpec.kt b/core/src/commonTest/kotlin/com/xebia/functional/xef/store/LocalVectorStoreSpec.kt similarity index 98% rename from core/src/commonTest/kotlin/com/xebia/functional/xef/vectorstores/LocalVectorStoreSpec.kt rename to core/src/commonTest/kotlin/com/xebia/functional/xef/store/LocalVectorStoreSpec.kt index 3d97d15a5..37cedfb4c 100644 --- a/core/src/commonTest/kotlin/com/xebia/functional/xef/vectorstores/LocalVectorStoreSpec.kt +++ b/core/src/commonTest/kotlin/com/xebia/functional/xef/store/LocalVectorStoreSpec.kt @@ -1,4 +1,4 @@ -package com.xebia.functional.xef.vectorstores +package com.xebia.functional.xef.store import com.xebia.functional.xef.data.TestEmbeddings import io.kotest.core.spec.style.StringSpec diff --git a/core/src/commonTest/kotlin/com/xebia/functional/xef/vectorstores/MemoryData.kt b/core/src/commonTest/kotlin/com/xebia/functional/xef/store/MemoryData.kt similarity index 94% rename from core/src/commonTest/kotlin/com/xebia/functional/xef/vectorstores/MemoryData.kt rename to core/src/commonTest/kotlin/com/xebia/functional/xef/store/MemoryData.kt index 4cda59697..3c1827def 100644 --- a/core/src/commonTest/kotlin/com/xebia/functional/xef/vectorstores/MemoryData.kt +++ b/core/src/commonTest/kotlin/com/xebia/functional/xef/store/MemoryData.kt @@ -1,4 +1,4 @@ -package com.xebia.functional.xef.vectorstores +package com.xebia.functional.xef.store import com.xebia.functional.xef.llm.models.chat.Message import com.xebia.functional.xef.llm.models.chat.Role diff --git a/core/src/jsMain/kotlin/com/xebia/functional/xef/auto/Description.js.kt b/core/src/jsMain/kotlin/com/xebia/functional/xef/conversation/Description.js.kt similarity index 88% rename from core/src/jsMain/kotlin/com/xebia/functional/xef/auto/Description.js.kt rename to core/src/jsMain/kotlin/com/xebia/functional/xef/conversation/Description.js.kt index 5927d122b..9675c2739 100644 --- a/core/src/jsMain/kotlin/com/xebia/functional/xef/auto/Description.js.kt +++ b/core/src/jsMain/kotlin/com/xebia/functional/xef/conversation/Description.js.kt @@ -1,4 +1,4 @@ -package com.xebia.functional.xef.auto +package com.xebia.functional.xef.conversation import kotlinx.serialization.SerialInfo diff --git a/core/src/jsMain/kotlin/com/xebia/functional/xef/auto/JSConversation.kt b/core/src/jsMain/kotlin/com/xebia/functional/xef/conversation/JSConversation.kt similarity index 68% rename from core/src/jsMain/kotlin/com/xebia/functional/xef/auto/JSConversation.kt rename to core/src/jsMain/kotlin/com/xebia/functional/xef/conversation/JSConversation.kt index 5055f25f5..2b9373f78 100644 --- a/core/src/jsMain/kotlin/com/xebia/functional/xef/auto/JSConversation.kt +++ b/core/src/jsMain/kotlin/com/xebia/functional/xef/conversation/JSConversation.kt @@ -1,7 +1,7 @@ -package com.xebia.functional.xef.auto +package com.xebia.functional.xef.conversation -import com.xebia.functional.xef.vectorstores.ConversationId -import com.xebia.functional.xef.vectorstores.VectorStore +import com.xebia.functional.xef.store.ConversationId +import com.xebia.functional.xef.store.VectorStore class JSConversation( override val store: VectorStore, diff --git a/core/src/jsMain/kotlin/com/xebia/functional/xef/auto/PlatformConversation.js.kt b/core/src/jsMain/kotlin/com/xebia/functional/xef/conversation/PlatformConversation.js.kt similarity index 67% rename from core/src/jsMain/kotlin/com/xebia/functional/xef/auto/PlatformConversation.js.kt rename to core/src/jsMain/kotlin/com/xebia/functional/xef/conversation/PlatformConversation.js.kt index 0143e74fa..ab26f1363 100644 --- a/core/src/jsMain/kotlin/com/xebia/functional/xef/auto/PlatformConversation.js.kt +++ b/core/src/jsMain/kotlin/com/xebia/functional/xef/conversation/PlatformConversation.js.kt @@ -1,7 +1,7 @@ -package com.xebia.functional.xef.auto +package com.xebia.functional.xef.conversation -import com.xebia.functional.xef.vectorstores.ConversationId -import com.xebia.functional.xef.vectorstores.VectorStore +import com.xebia.functional.xef.store.ConversationId +import com.xebia.functional.xef.store.VectorStore actual abstract class PlatformConversation actual constructor(store: VectorStore, conversationId: ConversationId?) : Conversation, AutoClose { diff --git a/core/src/jvmMain/java/com/xebia/functional/xef/auto/jvm/Description.java b/core/src/jvmMain/java/com/xebia/functional/xef/conversation/jvm/Description.java similarity index 83% rename from core/src/jvmMain/java/com/xebia/functional/xef/auto/jvm/Description.java rename to core/src/jvmMain/java/com/xebia/functional/xef/conversation/jvm/Description.java index 423c625fd..531e8bf3c 100644 --- a/core/src/jvmMain/java/com/xebia/functional/xef/auto/jvm/Description.java +++ b/core/src/jvmMain/java/com/xebia/functional/xef/conversation/jvm/Description.java @@ -1,4 +1,4 @@ -package com.xebia.functional.xef.auto.jvm; +package com.xebia.functional.xef.conversation.jvm; import java.lang.annotation.*; diff --git a/core/src/jvmMain/kotlin/com/xebia/functional/xef/auto/Description.jvm.kt b/core/src/jvmMain/kotlin/com/xebia/functional/xef/conversation/Description.jvm.kt similarity index 58% rename from core/src/jvmMain/kotlin/com/xebia/functional/xef/auto/Description.jvm.kt rename to core/src/jvmMain/kotlin/com/xebia/functional/xef/conversation/Description.jvm.kt index 190cf9cfa..d03103e2f 100644 --- a/core/src/jvmMain/kotlin/com/xebia/functional/xef/auto/Description.jvm.kt +++ b/core/src/jvmMain/kotlin/com/xebia/functional/xef/conversation/Description.jvm.kt @@ -1,6 +1,6 @@ -package com.xebia.functional.xef.auto +package com.xebia.functional.xef.conversation -import com.xebia.functional.xef.auto.jvm.Description +import com.xebia.functional.xef.conversation.jvm.Description /** * Description of a property to enhance the LLM prompt chances to get the data in the right format diff --git a/core/src/jvmMain/kotlin/com/xebia/functional/xef/auto/FromJson.kt b/core/src/jvmMain/kotlin/com/xebia/functional/xef/conversation/FromJson.kt similarity index 56% rename from core/src/jvmMain/kotlin/com/xebia/functional/xef/auto/FromJson.kt rename to core/src/jvmMain/kotlin/com/xebia/functional/xef/conversation/FromJson.kt index 3a49c21be..d24ae2a05 100644 --- a/core/src/jvmMain/kotlin/com/xebia/functional/xef/auto/FromJson.kt +++ b/core/src/jvmMain/kotlin/com/xebia/functional/xef/conversation/FromJson.kt @@ -1,4 +1,4 @@ -package com.xebia.functional.xef.auto +package com.xebia.functional.xef.conversation fun interface FromJson { fun fromJson(a: String): A diff --git a/core/src/jvmMain/kotlin/com/xebia/functional/xef/auto/JVMConversation.kt b/core/src/jvmMain/kotlin/com/xebia/functional/xef/conversation/JVMConversation.kt similarity index 65% rename from core/src/jvmMain/kotlin/com/xebia/functional/xef/auto/JVMConversation.kt rename to core/src/jvmMain/kotlin/com/xebia/functional/xef/conversation/JVMConversation.kt index f1758497d..c25a76333 100644 --- a/core/src/jvmMain/kotlin/com/xebia/functional/xef/auto/JVMConversation.kt +++ b/core/src/jvmMain/kotlin/com/xebia/functional/xef/conversation/JVMConversation.kt @@ -1,7 +1,7 @@ -package com.xebia.functional.xef.auto +package com.xebia.functional.xef.conversation -import com.xebia.functional.xef.vectorstores.ConversationId -import com.xebia.functional.xef.vectorstores.VectorStore +import com.xebia.functional.xef.store.ConversationId +import com.xebia.functional.xef.store.VectorStore import java.io.Closeable open class JVMConversation( diff --git a/core/src/jvmMain/kotlin/com/xebia/functional/xef/auto/PlatformConversation.jvm.kt b/core/src/jvmMain/kotlin/com/xebia/functional/xef/conversation/PlatformConversation.jvm.kt similarity index 94% rename from core/src/jvmMain/kotlin/com/xebia/functional/xef/auto/PlatformConversation.jvm.kt rename to core/src/jvmMain/kotlin/com/xebia/functional/xef/conversation/PlatformConversation.jvm.kt index 28b972795..0785c3da6 100644 --- a/core/src/jvmMain/kotlin/com/xebia/functional/xef/auto/PlatformConversation.jvm.kt +++ b/core/src/jvmMain/kotlin/com/xebia/functional/xef/conversation/PlatformConversation.jvm.kt @@ -1,14 +1,14 @@ -package com.xebia.functional.xef.auto +package com.xebia.functional.xef.conversation -import com.xebia.functional.xef.auto.serialization.JacksonSerialization +import com.xebia.functional.xef.conversation.serialization.JacksonSerialization import com.xebia.functional.xef.llm.Chat import com.xebia.functional.xef.llm.ChatWithFunctions import com.xebia.functional.xef.llm.Images import com.xebia.functional.xef.llm.models.functions.CFunction import com.xebia.functional.xef.llm.models.images.ImagesGenerationResponse import com.xebia.functional.xef.prompt.Prompt -import com.xebia.functional.xef.vectorstores.ConversationId -import com.xebia.functional.xef.vectorstores.VectorStore +import com.xebia.functional.xef.store.ConversationId +import com.xebia.functional.xef.store.VectorStore import java.util.concurrent.CompletableFuture import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.SupervisorJob diff --git a/core/src/jvmMain/kotlin/com/xebia/functional/xef/auto/futures/ExecutionContext.kt b/core/src/jvmMain/kotlin/com/xebia/functional/xef/conversation/futures/ExecutionContext.kt similarity index 96% rename from core/src/jvmMain/kotlin/com/xebia/functional/xef/auto/futures/ExecutionContext.kt rename to core/src/jvmMain/kotlin/com/xebia/functional/xef/conversation/futures/ExecutionContext.kt index 5ebbb28fb..c9fad09f4 100644 --- a/core/src/jvmMain/kotlin/com/xebia/functional/xef/auto/futures/ExecutionContext.kt +++ b/core/src/jvmMain/kotlin/com/xebia/functional/xef/conversation/futures/ExecutionContext.kt @@ -1,4 +1,4 @@ -package com.xebia.functional.xef.auto.futures +package com.xebia.functional.xef.conversation.futures import java.util.concurrent.CompletableFuture import java.util.concurrent.ExecutorService diff --git a/core/src/jvmMain/kotlin/com/xebia/functional/xef/auto/serialization/DescriptionModule.kt b/core/src/jvmMain/kotlin/com/xebia/functional/xef/conversation/serialization/DescriptionModule.kt similarity index 89% rename from core/src/jvmMain/kotlin/com/xebia/functional/xef/auto/serialization/DescriptionModule.kt rename to core/src/jvmMain/kotlin/com/xebia/functional/xef/conversation/serialization/DescriptionModule.kt index 0a980d33b..e20fad78b 100644 --- a/core/src/jvmMain/kotlin/com/xebia/functional/xef/auto/serialization/DescriptionModule.kt +++ b/core/src/jvmMain/kotlin/com/xebia/functional/xef/conversation/serialization/DescriptionModule.kt @@ -1,10 +1,10 @@ -package com.xebia.functional.xef.auto.serialization +package com.xebia.functional.xef.conversation.serialization import com.github.victools.jsonschema.generator.MemberScope import com.github.victools.jsonschema.generator.Module import com.github.victools.jsonschema.generator.SchemaGeneratorConfigBuilder import com.github.victools.jsonschema.generator.TypeScope -import com.xebia.functional.xef.auto.Description +import com.xebia.functional.xef.conversation.Description internal class DescriptionModule : Module { override fun applyToConfigBuilder(builder: SchemaGeneratorConfigBuilder) { diff --git a/core/src/jvmMain/kotlin/com/xebia/functional/xef/auto/serialization/JacksonSerialization.kt b/core/src/jvmMain/kotlin/com/xebia/functional/xef/conversation/serialization/JacksonSerialization.kt similarity index 94% rename from core/src/jvmMain/kotlin/com/xebia/functional/xef/auto/serialization/JacksonSerialization.kt rename to core/src/jvmMain/kotlin/com/xebia/functional/xef/conversation/serialization/JacksonSerialization.kt index e3bb02d5e..f2e80e5ad 100644 --- a/core/src/jvmMain/kotlin/com/xebia/functional/xef/auto/serialization/JacksonSerialization.kt +++ b/core/src/jvmMain/kotlin/com/xebia/functional/xef/conversation/serialization/JacksonSerialization.kt @@ -1,4 +1,4 @@ -package com.xebia.functional.xef.auto.serialization +package com.xebia.functional.xef.conversation.serialization import com.fasterxml.jackson.databind.ObjectMapper import com.github.victools.jsonschema.generator.* diff --git a/core/src/nativeMain/kotlin/com/xebia/functional/xef/auto/Description.native.kt b/core/src/nativeMain/kotlin/com/xebia/functional/xef/conversation/Description.native.kt similarity index 86% rename from core/src/nativeMain/kotlin/com/xebia/functional/xef/auto/Description.native.kt rename to core/src/nativeMain/kotlin/com/xebia/functional/xef/conversation/Description.native.kt index 5c2073bef..f18f9853e 100644 --- a/core/src/nativeMain/kotlin/com/xebia/functional/xef/auto/Description.native.kt +++ b/core/src/nativeMain/kotlin/com/xebia/functional/xef/conversation/Description.native.kt @@ -1,4 +1,4 @@ -package com.xebia.functional.xef.auto +package com.xebia.functional.xef.conversation /** * Description of a property to enhance the LLM prompt chances to get the data in the right format diff --git a/core/src/nativeMain/kotlin/com/xebia/functional/xef/auto/NativeConversation.kt b/core/src/nativeMain/kotlin/com/xebia/functional/xef/conversation/NativeConversation.kt similarity index 68% rename from core/src/nativeMain/kotlin/com/xebia/functional/xef/auto/NativeConversation.kt rename to core/src/nativeMain/kotlin/com/xebia/functional/xef/conversation/NativeConversation.kt index da4f1ead7..48954b611 100644 --- a/core/src/nativeMain/kotlin/com/xebia/functional/xef/auto/NativeConversation.kt +++ b/core/src/nativeMain/kotlin/com/xebia/functional/xef/conversation/NativeConversation.kt @@ -1,7 +1,7 @@ -package com.xebia.functional.xef.auto +package com.xebia.functional.xef.conversation -import com.xebia.functional.xef.vectorstores.ConversationId -import com.xebia.functional.xef.vectorstores.VectorStore +import com.xebia.functional.xef.store.ConversationId +import com.xebia.functional.xef.store.VectorStore class NativeConversation( override val store: VectorStore, diff --git a/core/src/nativeMain/kotlin/com/xebia/functional/xef/auto/PlatformConversation.native.kt b/core/src/nativeMain/kotlin/com/xebia/functional/xef/conversation/PlatformConversation.native.kt similarity index 68% rename from core/src/nativeMain/kotlin/com/xebia/functional/xef/auto/PlatformConversation.native.kt rename to core/src/nativeMain/kotlin/com/xebia/functional/xef/conversation/PlatformConversation.native.kt index 1a8d8b5b0..13723dc8a 100644 --- a/core/src/nativeMain/kotlin/com/xebia/functional/xef/auto/PlatformConversation.native.kt +++ b/core/src/nativeMain/kotlin/com/xebia/functional/xef/conversation/PlatformConversation.native.kt @@ -1,7 +1,7 @@ -package com.xebia.functional.xef.auto +package com.xebia.functional.xef.conversation -import com.xebia.functional.xef.vectorstores.ConversationId -import com.xebia.functional.xef.vectorstores.VectorStore +import com.xebia.functional.xef.store.ConversationId +import com.xebia.functional.xef.store.VectorStore actual abstract class PlatformConversation actual constructor(store: VectorStore, conversationId: ConversationId?) : diff --git a/docs/intro/java.md b/docs/intro/java.md index 3095b5fd8..2d16ccdc7 100644 --- a/docs/intro/java.md +++ b/docs/intro/java.md @@ -168,7 +168,7 @@ public class Weather { > ```java > package my.example; > -> import com.xebia.functional.xef.vectorstores.LuceneKt; +> import com.xebia.functional.xef.store.LuceneKt; > > import java.nio.file.Path; > import java.util.concurrent.CompletableFuture; diff --git a/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk21/ASCIIArt.java b/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk21/ASCIIArt.java index 4126e7460..538e8bcc4 100644 --- a/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk21/ASCIIArt.java +++ b/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk21/ASCIIArt.java @@ -1,7 +1,7 @@ package com.xebia.functional.xef.java.auto.jdk21; -import com.xebia.functional.xef.auto.PlatformConversation; -import com.xebia.functional.xef.auto.llm.openai.OpenAI; +import com.xebia.functional.xef.conversation.PlatformConversation; +import com.xebia.functional.xef.conversation.llm.openai.OpenAI; import com.xebia.functional.xef.prompt.Prompt; import java.util.concurrent.ExecutionException; diff --git a/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk21/Animals.java b/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk21/Animals.java index d6402682b..c13d39d14 100644 --- a/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk21/Animals.java +++ b/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk21/Animals.java @@ -1,7 +1,7 @@ package com.xebia.functional.xef.java.auto.jdk21; -import com.xebia.functional.xef.auto.PlatformConversation; -import com.xebia.functional.xef.auto.llm.openai.OpenAI; +import com.xebia.functional.xef.conversation.PlatformConversation; +import com.xebia.functional.xef.conversation.llm.openai.OpenAI; import com.xebia.functional.xef.prompt.Prompt; import java.util.concurrent.CompletableFuture; diff --git a/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk21/Book.java b/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk21/Book.java index 61587b6da..896b0c6e2 100644 --- a/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk21/Book.java +++ b/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk21/Book.java @@ -1,7 +1,7 @@ package com.xebia.functional.xef.java.auto.jdk21; -import com.xebia.functional.xef.auto.PlatformConversation; -import com.xebia.functional.xef.auto.llm.openai.OpenAI; +import com.xebia.functional.xef.conversation.PlatformConversation; +import com.xebia.functional.xef.conversation.llm.openai.OpenAI; import com.xebia.functional.xef.prompt.Prompt; import java.util.concurrent.ExecutionException; diff --git a/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk21/Books.java b/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk21/Books.java index cd07dc3e3..2210688f2 100644 --- a/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk21/Books.java +++ b/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk21/Books.java @@ -1,7 +1,7 @@ package com.xebia.functional.xef.java.auto.jdk21; -import com.xebia.functional.xef.auto.PlatformConversation; -import com.xebia.functional.xef.auto.llm.openai.OpenAI; +import com.xebia.functional.xef.conversation.PlatformConversation; +import com.xebia.functional.xef.conversation.llm.openai.OpenAI; import com.xebia.functional.xef.prompt.Prompt; import jakarta.validation.constraints.NotNull; diff --git a/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk21/BreakingNews.java b/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk21/BreakingNews.java index fb8a4a466..b8e5fbf4f 100644 --- a/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk21/BreakingNews.java +++ b/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk21/BreakingNews.java @@ -1,7 +1,7 @@ package com.xebia.functional.xef.java.auto.jdk21; -import com.xebia.functional.xef.auto.PlatformConversation; -import com.xebia.functional.xef.auto.llm.openai.OpenAI; +import com.xebia.functional.xef.conversation.PlatformConversation; +import com.xebia.functional.xef.conversation.llm.openai.OpenAI; import com.xebia.functional.xef.prompt.Prompt; import com.xebia.functional.xef.reasoning.serpapi.Search; @@ -9,7 +9,6 @@ import java.time.format.DateTimeFormatter; import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutionException; -import java.util.concurrent.Executors; public class BreakingNews { diff --git a/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk21/ChessAI.java b/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk21/ChessAI.java index 0379a97ec..2e23d427a 100644 --- a/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk21/ChessAI.java +++ b/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk21/ChessAI.java @@ -1,12 +1,11 @@ package com.xebia.functional.xef.java.auto.jdk21; -import com.xebia.functional.xef.auto.PlatformConversation; -import com.xebia.functional.xef.auto.llm.openai.OpenAI; +import com.xebia.functional.xef.conversation.PlatformConversation; +import com.xebia.functional.xef.conversation.llm.openai.OpenAI; import com.xebia.functional.xef.prompt.Prompt; import java.util.ArrayList; import java.util.concurrent.ExecutionException; -import java.util.concurrent.Executors; import java.util.stream.Collectors; public class ChessAI { diff --git a/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk21/Colors.java b/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk21/Colors.java index 0d8389dcb..3baf0149e 100644 --- a/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk21/Colors.java +++ b/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk21/Colors.java @@ -1,7 +1,7 @@ package com.xebia.functional.xef.java.auto.jdk21; -import com.xebia.functional.xef.auto.PlatformConversation; -import com.xebia.functional.xef.auto.llm.openai.OpenAI; +import com.xebia.functional.xef.conversation.PlatformConversation; +import com.xebia.functional.xef.conversation.llm.openai.OpenAI; import com.xebia.functional.xef.prompt.Prompt; import java.util.List; diff --git a/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk21/DivergentTasks.java b/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk21/DivergentTasks.java index bbde0c857..7daff2e2f 100644 --- a/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk21/DivergentTasks.java +++ b/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk21/DivergentTasks.java @@ -1,7 +1,7 @@ package com.xebia.functional.xef.java.auto.jdk21; -import com.xebia.functional.xef.auto.PlatformConversation; -import com.xebia.functional.xef.auto.llm.openai.OpenAI; +import com.xebia.functional.xef.conversation.PlatformConversation; +import com.xebia.functional.xef.conversation.llm.openai.OpenAI; import com.xebia.functional.xef.prompt.Prompt; import com.xebia.functional.xef.reasoning.serpapi.Search; diff --git a/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk21/Employees.java b/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk21/Employees.java index b6a6360f4..409bdd9e8 100644 --- a/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk21/Employees.java +++ b/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk21/Employees.java @@ -1,7 +1,7 @@ package com.xebia.functional.xef.java.auto.jdk21; -import com.xebia.functional.xef.auto.PlatformConversation; -import com.xebia.functional.xef.auto.llm.openai.OpenAI; +import com.xebia.functional.xef.conversation.PlatformConversation; +import com.xebia.functional.xef.conversation.llm.openai.OpenAI; import com.xebia.functional.xef.prompt.Prompt; import java.util.concurrent.ExecutionException; diff --git a/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk21/Fact.java b/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk21/Fact.java index bb3d998fe..d2e22bfbb 100644 --- a/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk21/Fact.java +++ b/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk21/Fact.java @@ -1,7 +1,7 @@ package com.xebia.functional.xef.java.auto.jdk21; -import com.xebia.functional.xef.auto.PlatformConversation; -import com.xebia.functional.xef.auto.llm.openai.OpenAI; +import com.xebia.functional.xef.conversation.PlatformConversation; +import com.xebia.functional.xef.conversation.llm.openai.OpenAI; import com.xebia.functional.xef.prompt.Prompt; import java.util.concurrent.ExecutionException; diff --git a/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk21/Love.java b/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk21/Love.java index 49feb2e16..07a1b1471 100644 --- a/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk21/Love.java +++ b/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk21/Love.java @@ -1,7 +1,7 @@ package com.xebia.functional.xef.java.auto.jdk21; -import com.xebia.functional.xef.auto.PlatformConversation; -import com.xebia.functional.xef.auto.llm.openai.OpenAI; +import com.xebia.functional.xef.conversation.PlatformConversation; +import com.xebia.functional.xef.conversation.llm.openai.OpenAI; import com.xebia.functional.xef.prompt.Prompt; import java.util.List; diff --git a/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk21/Markets.java b/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk21/Markets.java index ed9421e5f..ecf0c59e7 100644 --- a/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk21/Markets.java +++ b/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk21/Markets.java @@ -1,7 +1,7 @@ package com.xebia.functional.xef.java.auto.jdk21; -import com.xebia.functional.xef.auto.PlatformConversation; -import com.xebia.functional.xef.auto.llm.openai.OpenAI; +import com.xebia.functional.xef.conversation.PlatformConversation; +import com.xebia.functional.xef.conversation.llm.openai.OpenAI; import com.xebia.functional.xef.prompt.Prompt; import com.xebia.functional.xef.reasoning.serpapi.Search; @@ -10,7 +10,6 @@ import java.util.List; import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutionException; -import java.util.concurrent.Executors; public class Markets { diff --git a/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk21/MealPlan.java b/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk21/MealPlan.java index 34e2f0d6c..cdfc80856 100644 --- a/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk21/MealPlan.java +++ b/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk21/MealPlan.java @@ -1,7 +1,7 @@ package com.xebia.functional.xef.java.auto.jdk21; -import com.xebia.functional.xef.auto.PlatformConversation; -import com.xebia.functional.xef.auto.llm.openai.OpenAI; +import com.xebia.functional.xef.conversation.PlatformConversation; +import com.xebia.functional.xef.conversation.llm.openai.OpenAI; import com.xebia.functional.xef.prompt.Prompt; import com.xebia.functional.xef.reasoning.serpapi.Search; diff --git a/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk21/MeaningOfLife.java b/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk21/MeaningOfLife.java index f8ccc8031..13b7f4d11 100644 --- a/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk21/MeaningOfLife.java +++ b/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk21/MeaningOfLife.java @@ -1,7 +1,7 @@ package com.xebia.functional.xef.java.auto.jdk21; -import com.xebia.functional.xef.auto.PlatformConversation; -import com.xebia.functional.xef.auto.llm.openai.OpenAI; +import com.xebia.functional.xef.conversation.PlatformConversation; +import com.xebia.functional.xef.conversation.llm.openai.OpenAI; import com.xebia.functional.xef.prompt.Prompt; import java.util.List; diff --git a/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk21/Movies.java b/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk21/Movies.java index 8d22555e4..671bff77b 100644 --- a/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk21/Movies.java +++ b/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk21/Movies.java @@ -1,7 +1,7 @@ package com.xebia.functional.xef.java.auto.jdk21; -import com.xebia.functional.xef.auto.PlatformConversation; -import com.xebia.functional.xef.auto.llm.openai.OpenAI; +import com.xebia.functional.xef.conversation.PlatformConversation; +import com.xebia.functional.xef.conversation.llm.openai.OpenAI; import com.xebia.functional.xef.prompt.Prompt; import java.util.concurrent.ExecutionException; diff --git a/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk21/PDFDocument.java b/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk21/PDFDocument.java index 1116db120..27197c6d3 100644 --- a/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk21/PDFDocument.java +++ b/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk21/PDFDocument.java @@ -1,7 +1,7 @@ package com.xebia.functional.xef.java.auto.jdk21; -import com.xebia.functional.xef.auto.PlatformConversation; -import com.xebia.functional.xef.auto.llm.openai.OpenAI; +import com.xebia.functional.xef.conversation.PlatformConversation; +import com.xebia.functional.xef.conversation.llm.openai.OpenAI; import com.xebia.functional.xef.java.auto.jdk21.util.ConsoleUtil; import com.xebia.functional.xef.prompt.Prompt; import com.xebia.functional.xef.reasoning.pdf.PDF; diff --git a/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk21/Persons.java b/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk21/Persons.java index 74620a63f..596531028 100644 --- a/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk21/Persons.java +++ b/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk21/Persons.java @@ -1,7 +1,7 @@ package com.xebia.functional.xef.java.auto.jdk21; -import com.xebia.functional.xef.auto.PlatformConversation; -import com.xebia.functional.xef.auto.llm.openai.OpenAI; +import com.xebia.functional.xef.conversation.PlatformConversation; +import com.xebia.functional.xef.conversation.llm.openai.OpenAI; import com.xebia.functional.xef.prompt.Prompt; import java.util.concurrent.ExecutionException; diff --git a/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk21/Planets.java b/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk21/Planets.java index 47f80965b..a57f0d44c 100644 --- a/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk21/Planets.java +++ b/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk21/Planets.java @@ -1,7 +1,7 @@ package com.xebia.functional.xef.java.auto.jdk21; -import com.xebia.functional.xef.auto.PlatformConversation; -import com.xebia.functional.xef.auto.llm.openai.OpenAI; +import com.xebia.functional.xef.conversation.PlatformConversation; +import com.xebia.functional.xef.conversation.llm.openai.OpenAI; import com.xebia.functional.xef.prompt.Prompt; import java.util.List; diff --git a/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk21/Poems.java b/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk21/Poems.java index 79ee59726..63326495c 100644 --- a/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk21/Poems.java +++ b/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk21/Poems.java @@ -1,7 +1,7 @@ package com.xebia.functional.xef.java.auto.jdk21; -import com.xebia.functional.xef.auto.PlatformConversation; -import com.xebia.functional.xef.auto.llm.openai.OpenAI; +import com.xebia.functional.xef.conversation.PlatformConversation; +import com.xebia.functional.xef.conversation.llm.openai.OpenAI; import com.xebia.functional.xef.prompt.Prompt; import java.util.concurrent.ExecutionException; diff --git a/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk21/Populations.java b/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk21/Populations.java index 3f32395bd..acb6dec74 100644 --- a/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk21/Populations.java +++ b/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk21/Populations.java @@ -1,7 +1,7 @@ package com.xebia.functional.xef.java.auto.jdk21; -import com.xebia.functional.xef.auto.PlatformConversation; -import com.xebia.functional.xef.auto.llm.openai.OpenAI; +import com.xebia.functional.xef.conversation.PlatformConversation; +import com.xebia.functional.xef.conversation.llm.openai.OpenAI; import com.xebia.functional.xef.prompt.Prompt; import java.util.concurrent.ExecutionException; diff --git a/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk21/Recipes.java b/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk21/Recipes.java index d5791e505..ce859999e 100644 --- a/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk21/Recipes.java +++ b/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk21/Recipes.java @@ -1,7 +1,7 @@ package com.xebia.functional.xef.java.auto.jdk21; -import com.xebia.functional.xef.auto.PlatformConversation; -import com.xebia.functional.xef.auto.llm.openai.OpenAI; +import com.xebia.functional.xef.conversation.PlatformConversation; +import com.xebia.functional.xef.conversation.llm.openai.OpenAI; import com.xebia.functional.xef.prompt.Prompt; import java.util.List; diff --git a/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk21/TopAttractions.java b/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk21/TopAttractions.java index 5f06a135d..4d2cc0a69 100644 --- a/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk21/TopAttractions.java +++ b/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk21/TopAttractions.java @@ -1,7 +1,7 @@ package com.xebia.functional.xef.java.auto.jdk21; -import com.xebia.functional.xef.auto.PlatformConversation; -import com.xebia.functional.xef.auto.llm.openai.OpenAI; +import com.xebia.functional.xef.conversation.PlatformConversation; +import com.xebia.functional.xef.conversation.llm.openai.OpenAI; import com.xebia.functional.xef.prompt.Prompt; import java.util.Objects; diff --git a/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk21/TouristAttractions.java b/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk21/TouristAttractions.java index 0e38ebe65..accced341 100644 --- a/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk21/TouristAttractions.java +++ b/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk21/TouristAttractions.java @@ -1,7 +1,7 @@ package com.xebia.functional.xef.java.auto.jdk21; -import com.xebia.functional.xef.auto.PlatformConversation; -import com.xebia.functional.xef.auto.llm.openai.OpenAI; +import com.xebia.functional.xef.conversation.PlatformConversation; +import com.xebia.functional.xef.conversation.llm.openai.OpenAI; import com.xebia.functional.xef.prompt.Prompt; import java.util.concurrent.ExecutionException; diff --git a/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk21/Weather.java b/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk21/Weather.java index 0ac33e954..4afc43dc7 100644 --- a/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk21/Weather.java +++ b/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk21/Weather.java @@ -1,7 +1,7 @@ package com.xebia.functional.xef.java.auto.jdk21; -import com.xebia.functional.xef.auto.PlatformConversation; -import com.xebia.functional.xef.auto.llm.openai.OpenAI; +import com.xebia.functional.xef.conversation.PlatformConversation; +import com.xebia.functional.xef.conversation.llm.openai.OpenAI; import com.xebia.functional.xef.prompt.Prompt; import com.xebia.functional.xef.reasoning.serpapi.Search; diff --git a/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk21/gpt4all/Chat.java b/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk21/gpt4all/Chat.java index e330bfa4f..6c16baded 100644 --- a/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk21/gpt4all/Chat.java +++ b/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk21/gpt4all/Chat.java @@ -2,7 +2,7 @@ import com.xebia.functional.gpt4all.GPT4All; import com.xebia.functional.gpt4all.Gpt4AllModel; -import com.xebia.functional.xef.auto.llm.openai.OpenAI; +import com.xebia.functional.xef.conversation.llm.openai.OpenAI; import com.xebia.functional.xef.prompt.Prompt; import org.reactivestreams.Subscriber; import org.reactivestreams.Subscription; diff --git a/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk21/tot/ControlSignals.java b/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk21/tot/ControlSignals.java index b7885d9e6..82584872c 100644 --- a/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk21/tot/ControlSignals.java +++ b/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk21/tot/ControlSignals.java @@ -1,6 +1,6 @@ package com.xebia.functional.xef.java.auto.jdk21.tot; -import com.xebia.functional.xef.auto.llm.openai.OpenAI; +import com.xebia.functional.xef.conversation.llm.openai.OpenAI; import com.xebia.functional.xef.prompt.Prompt; import static com.xebia.functional.xef.java.auto.jdk21.tot.Rendering.renderHistory; diff --git a/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk21/tot/Critiques.java b/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk21/tot/Critiques.java index d435a0b0a..b835c0c69 100644 --- a/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk21/tot/Critiques.java +++ b/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk21/tot/Critiques.java @@ -1,6 +1,6 @@ package com.xebia.functional.xef.java.auto.jdk21.tot; -import com.xebia.functional.xef.auto.llm.openai.OpenAI; +import com.xebia.functional.xef.conversation.llm.openai.OpenAI; import com.xebia.functional.xef.prompt.Prompt; import static com.xebia.functional.xef.java.auto.jdk21.tot.Rendering.truncateText; diff --git a/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk21/tot/Problems.java b/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk21/tot/Problems.java index dfbc53e00..167225f00 100644 --- a/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk21/tot/Problems.java +++ b/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk21/tot/Problems.java @@ -1,12 +1,11 @@ package com.xebia.functional.xef.java.auto.jdk21.tot; -import com.xebia.functional.xef.auto.PlatformConversation; -import com.xebia.functional.xef.auto.llm.openai.OpenAI; +import com.xebia.functional.xef.conversation.PlatformConversation; +import com.xebia.functional.xef.conversation.llm.openai.OpenAI; import org.jetbrains.annotations.Nullable; import java.util.ArrayList; import java.util.List; -import java.util.concurrent.Executors; import java.util.stream.Stream; import static com.xebia.functional.xef.java.auto.jdk21.tot.Rendering.truncateText; diff --git a/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk21/tot/Solutions.java b/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk21/tot/Solutions.java index 05e612682..cdbe3cba9 100644 --- a/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk21/tot/Solutions.java +++ b/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk21/tot/Solutions.java @@ -1,6 +1,6 @@ package com.xebia.functional.xef.java.auto.jdk21.tot; -import com.xebia.functional.xef.auto.llm.openai.OpenAI; +import com.xebia.functional.xef.conversation.llm.openai.OpenAI; import com.xebia.functional.xef.prompt.Prompt; import static com.xebia.functional.xef.java.auto.jdk21.tot.Rendering.renderHistory; diff --git a/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk8/ASCIIArt.java b/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk8/ASCIIArt.java index 74d891eb0..b54276966 100644 --- a/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk8/ASCIIArt.java +++ b/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk8/ASCIIArt.java @@ -1,7 +1,7 @@ package com.xebia.functional.xef.java.auto.jdk8; -import com.xebia.functional.xef.auto.PlatformConversation; -import com.xebia.functional.xef.auto.llm.openai.OpenAI; +import com.xebia.functional.xef.conversation.PlatformConversation; +import com.xebia.functional.xef.conversation.llm.openai.OpenAI; import com.xebia.functional.xef.prompt.Prompt; import java.util.concurrent.ExecutionException; diff --git a/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk8/Animals.java b/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk8/Animals.java index 6ed6091d0..a9140defb 100644 --- a/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk8/Animals.java +++ b/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk8/Animals.java @@ -1,7 +1,7 @@ package com.xebia.functional.xef.java.auto.jdk8; -import com.xebia.functional.xef.auto.PlatformConversation; -import com.xebia.functional.xef.auto.llm.openai.OpenAI; +import com.xebia.functional.xef.conversation.PlatformConversation; +import com.xebia.functional.xef.conversation.llm.openai.OpenAI; import com.xebia.functional.xef.prompt.Prompt; import com.xebia.functional.xef.prompt.PromptBuilder; diff --git a/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk8/Book.java b/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk8/Book.java index e5b17bee9..15759e3b2 100644 --- a/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk8/Book.java +++ b/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk8/Book.java @@ -1,8 +1,8 @@ package com.xebia.functional.xef.java.auto.jdk8; -import com.xebia.functional.xef.auto.PlatformConversation; -import com.xebia.functional.xef.auto.jvm.Description; -import com.xebia.functional.xef.auto.llm.openai.OpenAI; +import com.xebia.functional.xef.conversation.PlatformConversation; +import com.xebia.functional.xef.conversation.jvm.Description; +import com.xebia.functional.xef.conversation.llm.openai.OpenAI; import com.xebia.functional.xef.prompt.Prompt; import java.util.concurrent.ExecutionException; diff --git a/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk8/Books.java b/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk8/Books.java index ef7f5c8ce..588bb76d4 100644 --- a/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk8/Books.java +++ b/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk8/Books.java @@ -1,7 +1,7 @@ package com.xebia.functional.xef.java.auto.jdk8; -import com.xebia.functional.xef.auto.PlatformConversation; -import com.xebia.functional.xef.auto.llm.openai.OpenAI; +import com.xebia.functional.xef.conversation.PlatformConversation; +import com.xebia.functional.xef.conversation.llm.openai.OpenAI; import com.xebia.functional.xef.prompt.Prompt; import jakarta.validation.constraints.NotNull; import java.util.concurrent.CompletableFuture; diff --git a/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk8/BreakingNews.java b/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk8/BreakingNews.java index c91bdf2c9..3477557d9 100644 --- a/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk8/BreakingNews.java +++ b/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk8/BreakingNews.java @@ -1,7 +1,7 @@ package com.xebia.functional.xef.java.auto.jdk8; -import com.xebia.functional.xef.auto.PlatformConversation; -import com.xebia.functional.xef.auto.llm.openai.OpenAI; +import com.xebia.functional.xef.conversation.PlatformConversation; +import com.xebia.functional.xef.conversation.llm.openai.OpenAI; import com.xebia.functional.xef.prompt.Prompt; import com.xebia.functional.xef.reasoning.serpapi.Search; diff --git a/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk8/ChessAI.java b/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk8/ChessAI.java index 7e0140fa6..9a9c1e801 100644 --- a/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk8/ChessAI.java +++ b/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk8/ChessAI.java @@ -1,7 +1,7 @@ package com.xebia.functional.xef.java.auto.jdk8; -import com.xebia.functional.xef.auto.PlatformConversation; -import com.xebia.functional.xef.auto.llm.openai.OpenAI; +import com.xebia.functional.xef.conversation.PlatformConversation; +import com.xebia.functional.xef.conversation.llm.openai.OpenAI; import com.xebia.functional.xef.prompt.Prompt; import java.util.ArrayList; diff --git a/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk8/Colors.java b/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk8/Colors.java index 11c64ba2b..2ee172972 100644 --- a/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk8/Colors.java +++ b/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk8/Colors.java @@ -1,7 +1,7 @@ package com.xebia.functional.xef.java.auto.jdk8; -import com.xebia.functional.xef.auto.PlatformConversation; -import com.xebia.functional.xef.auto.llm.openai.OpenAI; +import com.xebia.functional.xef.conversation.PlatformConversation; +import com.xebia.functional.xef.conversation.llm.openai.OpenAI; import com.xebia.functional.xef.prompt.Prompt; import java.util.List; diff --git a/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk8/DivergentTasks.java b/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk8/DivergentTasks.java index 2f49895bd..930aa43bb 100644 --- a/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk8/DivergentTasks.java +++ b/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk8/DivergentTasks.java @@ -1,7 +1,7 @@ package com.xebia.functional.xef.java.auto.jdk8; -import com.xebia.functional.xef.auto.PlatformConversation; -import com.xebia.functional.xef.auto.llm.openai.OpenAI; +import com.xebia.functional.xef.conversation.PlatformConversation; +import com.xebia.functional.xef.conversation.llm.openai.OpenAI; import com.xebia.functional.xef.prompt.Prompt; import com.xebia.functional.xef.reasoning.serpapi.Search; diff --git a/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk8/Employee.java b/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk8/Employee.java index 963bbd999..bbac5b119 100644 --- a/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk8/Employee.java +++ b/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk8/Employee.java @@ -1,7 +1,7 @@ package com.xebia.functional.xef.java.auto.jdk8; -import com.xebia.functional.xef.auto.PlatformConversation; -import com.xebia.functional.xef.auto.llm.openai.OpenAI; +import com.xebia.functional.xef.conversation.PlatformConversation; +import com.xebia.functional.xef.conversation.llm.openai.OpenAI; import com.xebia.functional.xef.prompt.Prompt; import java.util.concurrent.ExecutionException; diff --git a/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk8/Fact.java b/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk8/Fact.java index e179646a2..9bb3a8342 100644 --- a/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk8/Fact.java +++ b/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk8/Fact.java @@ -1,7 +1,7 @@ package com.xebia.functional.xef.java.auto.jdk8; -import com.xebia.functional.xef.auto.PlatformConversation; -import com.xebia.functional.xef.auto.llm.openai.OpenAI; +import com.xebia.functional.xef.conversation.PlatformConversation; +import com.xebia.functional.xef.conversation.llm.openai.OpenAI; import com.xebia.functional.xef.prompt.Prompt; import java.util.concurrent.ExecutionException; diff --git a/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk8/Love.java b/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk8/Love.java index 976aaf26a..040e7ebcd 100644 --- a/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk8/Love.java +++ b/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk8/Love.java @@ -1,7 +1,7 @@ package com.xebia.functional.xef.java.auto.jdk8; -import com.xebia.functional.xef.auto.PlatformConversation; -import com.xebia.functional.xef.auto.llm.openai.OpenAI; +import com.xebia.functional.xef.conversation.PlatformConversation; +import com.xebia.functional.xef.conversation.llm.openai.OpenAI; import com.xebia.functional.xef.prompt.Prompt; import java.util.List; diff --git a/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk8/Markets.java b/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk8/Markets.java index 22bbb2c7e..dbcf41e6a 100644 --- a/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk8/Markets.java +++ b/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk8/Markets.java @@ -1,7 +1,7 @@ package com.xebia.functional.xef.java.auto.jdk8; -import com.xebia.functional.xef.auto.PlatformConversation; -import com.xebia.functional.xef.auto.llm.openai.OpenAI; +import com.xebia.functional.xef.conversation.PlatformConversation; +import com.xebia.functional.xef.conversation.llm.openai.OpenAI; import com.xebia.functional.xef.prompt.Prompt; import com.xebia.functional.xef.reasoning.serpapi.Search; diff --git a/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk8/MealPlan.java b/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk8/MealPlan.java index 83edb69fb..af80a761d 100644 --- a/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk8/MealPlan.java +++ b/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk8/MealPlan.java @@ -1,7 +1,7 @@ package com.xebia.functional.xef.java.auto.jdk8; -import com.xebia.functional.xef.auto.PlatformConversation; -import com.xebia.functional.xef.auto.llm.openai.OpenAI; +import com.xebia.functional.xef.conversation.PlatformConversation; +import com.xebia.functional.xef.conversation.llm.openai.OpenAI; import com.xebia.functional.xef.prompt.Prompt; import com.xebia.functional.xef.reasoning.serpapi.Search; diff --git a/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk8/MeaningOfLife.java b/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk8/MeaningOfLife.java index ba5f6c770..5a3753d97 100644 --- a/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk8/MeaningOfLife.java +++ b/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk8/MeaningOfLife.java @@ -1,7 +1,7 @@ package com.xebia.functional.xef.java.auto.jdk8; -import com.xebia.functional.xef.auto.PlatformConversation; -import com.xebia.functional.xef.auto.llm.openai.OpenAI; +import com.xebia.functional.xef.conversation.PlatformConversation; +import com.xebia.functional.xef.conversation.llm.openai.OpenAI; import com.xebia.functional.xef.prompt.Prompt; import java.util.List; diff --git a/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk8/Movies.java b/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk8/Movies.java index dfb1582b6..49f3ae2dd 100644 --- a/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk8/Movies.java +++ b/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk8/Movies.java @@ -1,7 +1,7 @@ package com.xebia.functional.xef.java.auto.jdk8; -import com.xebia.functional.xef.auto.PlatformConversation; -import com.xebia.functional.xef.auto.llm.openai.OpenAI; +import com.xebia.functional.xef.conversation.PlatformConversation; +import com.xebia.functional.xef.conversation.llm.openai.OpenAI; import com.xebia.functional.xef.prompt.Prompt; import java.util.concurrent.ExecutionException; diff --git a/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk8/PDFDocument.java b/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk8/PDFDocument.java index 62502e910..92277a189 100644 --- a/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk8/PDFDocument.java +++ b/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk8/PDFDocument.java @@ -1,14 +1,10 @@ package com.xebia.functional.xef.java.auto.jdk8; -import static com.xebia.functional.xef.textsplitters.TokenTextSplitterKt.TokenTextSplitter; - -import com.xebia.functional.tokenizer.ModelType; -import com.xebia.functional.xef.auto.PlatformConversation; -import com.xebia.functional.xef.auto.llm.openai.OpenAI; +import com.xebia.functional.xef.conversation.PlatformConversation; +import com.xebia.functional.xef.conversation.llm.openai.OpenAI; import com.xebia.functional.xef.java.auto.jdk21.util.ConsoleUtil; import com.xebia.functional.xef.prompt.Prompt; import com.xebia.functional.xef.reasoning.pdf.PDF; -import com.xebia.functional.xef.textsplitters.TextSplitter; import java.util.List; import java.util.concurrent.CompletableFuture; diff --git a/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk8/Persons.java b/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk8/Persons.java index 344c4539b..cd0477f4b 100644 --- a/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk8/Persons.java +++ b/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk8/Persons.java @@ -1,7 +1,7 @@ package com.xebia.functional.xef.java.auto.jdk8; -import com.xebia.functional.xef.auto.PlatformConversation; -import com.xebia.functional.xef.auto.llm.openai.OpenAI; +import com.xebia.functional.xef.conversation.PlatformConversation; +import com.xebia.functional.xef.conversation.llm.openai.OpenAI; import com.xebia.functional.xef.prompt.Prompt; import java.util.concurrent.ExecutionException; diff --git a/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk8/Planets.java b/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk8/Planets.java index 11f37a140..a993b8978 100644 --- a/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk8/Planets.java +++ b/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk8/Planets.java @@ -1,7 +1,7 @@ package com.xebia.functional.xef.java.auto.jdk8; -import com.xebia.functional.xef.auto.PlatformConversation; -import com.xebia.functional.xef.auto.llm.openai.OpenAI; +import com.xebia.functional.xef.conversation.PlatformConversation; +import com.xebia.functional.xef.conversation.llm.openai.OpenAI; import com.xebia.functional.xef.prompt.Prompt; import java.util.List; diff --git a/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk8/Poems.java b/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk8/Poems.java index f64c32fc2..1d45f411c 100644 --- a/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk8/Poems.java +++ b/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk8/Poems.java @@ -1,7 +1,7 @@ package com.xebia.functional.xef.java.auto.jdk8; -import com.xebia.functional.xef.auto.PlatformConversation; -import com.xebia.functional.xef.auto.llm.openai.OpenAI; +import com.xebia.functional.xef.conversation.PlatformConversation; +import com.xebia.functional.xef.conversation.llm.openai.OpenAI; import com.xebia.functional.xef.prompt.Prompt; import java.util.concurrent.CompletableFuture; diff --git a/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk8/Populations.java b/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk8/Populations.java index 6a97ff1a6..1209dc0cd 100644 --- a/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk8/Populations.java +++ b/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk8/Populations.java @@ -1,7 +1,7 @@ package com.xebia.functional.xef.java.auto.jdk8; -import com.xebia.functional.xef.auto.PlatformConversation; -import com.xebia.functional.xef.auto.llm.openai.OpenAI; +import com.xebia.functional.xef.conversation.PlatformConversation; +import com.xebia.functional.xef.conversation.llm.openai.OpenAI; import com.xebia.functional.xef.prompt.Prompt; import java.util.concurrent.CompletableFuture; diff --git a/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk8/Recipes.java b/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk8/Recipes.java index 119b45052..16516e793 100644 --- a/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk8/Recipes.java +++ b/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk8/Recipes.java @@ -1,7 +1,7 @@ package com.xebia.functional.xef.java.auto.jdk8; -import com.xebia.functional.xef.auto.PlatformConversation; -import com.xebia.functional.xef.auto.llm.openai.OpenAI; +import com.xebia.functional.xef.conversation.PlatformConversation; +import com.xebia.functional.xef.conversation.llm.openai.OpenAI; import com.xebia.functional.xef.prompt.Prompt; import java.util.List; diff --git a/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk8/TopAttractions.java b/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk8/TopAttractions.java index 43ba5841b..ee9247f35 100644 --- a/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk8/TopAttractions.java +++ b/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk8/TopAttractions.java @@ -1,7 +1,7 @@ package com.xebia.functional.xef.java.auto.jdk8; -import com.xebia.functional.xef.auto.PlatformConversation; -import com.xebia.functional.xef.auto.llm.openai.OpenAI; +import com.xebia.functional.xef.conversation.PlatformConversation; +import com.xebia.functional.xef.conversation.llm.openai.OpenAI; import com.xebia.functional.xef.prompt.Prompt; import java.util.concurrent.ExecutionException; diff --git a/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk8/TouristAttractions.java b/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk8/TouristAttractions.java index 597e5106b..8808034e4 100644 --- a/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk8/TouristAttractions.java +++ b/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk8/TouristAttractions.java @@ -1,7 +1,7 @@ package com.xebia.functional.xef.java.auto.jdk8; -import com.xebia.functional.xef.auto.PlatformConversation; -import com.xebia.functional.xef.auto.llm.openai.OpenAI; +import com.xebia.functional.xef.conversation.PlatformConversation; +import com.xebia.functional.xef.conversation.llm.openai.OpenAI; import com.xebia.functional.xef.prompt.Prompt; import java.util.concurrent.ExecutionException; diff --git a/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk8/Weather.java b/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk8/Weather.java index e7deaaa7b..d49dac67e 100644 --- a/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk8/Weather.java +++ b/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk8/Weather.java @@ -1,7 +1,7 @@ package com.xebia.functional.xef.java.auto.jdk8; -import com.xebia.functional.xef.auto.PlatformConversation; -import com.xebia.functional.xef.auto.llm.openai.OpenAI; +import com.xebia.functional.xef.conversation.PlatformConversation; +import com.xebia.functional.xef.conversation.llm.openai.OpenAI; import com.xebia.functional.xef.prompt.Prompt; import com.xebia.functional.xef.reasoning.serpapi.Search; diff --git a/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk8/gpt4all/Chat.java b/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk8/gpt4all/Chat.java index 99cb4a4ea..b612f0b9a 100644 --- a/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk8/gpt4all/Chat.java +++ b/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk8/gpt4all/Chat.java @@ -2,7 +2,7 @@ import com.xebia.functional.gpt4all.GPT4All; import com.xebia.functional.gpt4all.Gpt4AllModel; -import com.xebia.functional.xef.auto.PlatformConversation; +import com.xebia.functional.xef.conversation.PlatformConversation; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; @@ -11,7 +11,7 @@ import java.util.Objects; import java.util.concurrent.ExecutionException; -import com.xebia.functional.xef.auto.llm.openai.OpenAI; +import com.xebia.functional.xef.conversation.llm.openai.OpenAI; import com.xebia.functional.xef.prompt.Prompt; import org.reactivestreams.Publisher; import org.reactivestreams.Subscriber; diff --git a/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk8/tot/ControlSignals.java b/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk8/tot/ControlSignals.java index 3a5ee77d5..a89838395 100644 --- a/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk8/tot/ControlSignals.java +++ b/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk8/tot/ControlSignals.java @@ -1,6 +1,6 @@ package com.xebia.functional.xef.java.auto.jdk8.tot; -import com.xebia.functional.xef.auto.llm.openai.OpenAI; +import com.xebia.functional.xef.conversation.llm.openai.OpenAI; import com.xebia.functional.xef.prompt.Prompt; import static com.xebia.functional.xef.java.auto.jdk8.tot.Rendering.renderHistory; diff --git a/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk8/tot/Critiques.java b/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk8/tot/Critiques.java index b4f478fa0..7ef514e01 100644 --- a/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk8/tot/Critiques.java +++ b/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk8/tot/Critiques.java @@ -1,6 +1,6 @@ package com.xebia.functional.xef.java.auto.jdk8.tot; -import com.xebia.functional.xef.auto.llm.openai.OpenAI; +import com.xebia.functional.xef.conversation.llm.openai.OpenAI; import com.xebia.functional.xef.prompt.Prompt; import static com.xebia.functional.xef.java.auto.jdk21.tot.Rendering.truncateText; diff --git a/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk8/tot/Problems.java b/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk8/tot/Problems.java index 84010f76c..25e81f365 100644 --- a/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk8/tot/Problems.java +++ b/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk8/tot/Problems.java @@ -2,12 +2,12 @@ import static com.xebia.functional.xef.java.auto.jdk21.tot.Rendering.truncateText; -import com.xebia.functional.xef.auto.PlatformConversation; +import com.xebia.functional.xef.conversation.PlatformConversation; import java.util.ArrayList; import java.util.List; import java.util.stream.Stream; -import com.xebia.functional.xef.auto.llm.openai.OpenAI; +import com.xebia.functional.xef.conversation.llm.openai.OpenAI; import org.jetbrains.annotations.Nullable; public class Problems { diff --git a/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk8/tot/Solutions.java b/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk8/tot/Solutions.java index 095fdb6d1..e874bd095 100644 --- a/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk8/tot/Solutions.java +++ b/examples/java/src/main/java/com/xebia/functional/xef/java/auto/jdk8/tot/Solutions.java @@ -1,6 +1,6 @@ package com.xebia.functional.xef.java.auto.jdk8.tot; -import com.xebia.functional.xef.auto.llm.openai.OpenAI; +import com.xebia.functional.xef.conversation.llm.openai.OpenAI; import com.xebia.functional.xef.prompt.Prompt; import static com.xebia.functional.xef.java.auto.jdk8.tot.Rendering.renderHistory; diff --git a/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/ASCIIArt.kt b/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/ASCIIArt.kt similarity index 55% rename from examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/ASCIIArt.kt rename to examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/ASCIIArt.kt index 07e3fab25..5d10a7a52 100644 --- a/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/ASCIIArt.kt +++ b/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/ASCIIArt.kt @@ -1,7 +1,7 @@ -package com.xebia.functional.xef.auto +package com.xebia.functional.xef.conversation -import com.xebia.functional.xef.auto.llm.openai.OpenAI -import com.xebia.functional.xef.auto.llm.openai.prompt +import com.xebia.functional.xef.conversation.llm.openai.OpenAI +import com.xebia.functional.xef.conversation.llm.openai.prompt import kotlinx.serialization.Serializable @Serializable data class ASCIIArt(val art: String) diff --git a/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/Animal.kt b/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/Animal.kt similarity index 86% rename from examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/Animal.kt rename to examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/Animal.kt index 67a68e278..8a78ee4df 100644 --- a/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/Animal.kt +++ b/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/Animal.kt @@ -1,7 +1,7 @@ -package com.xebia.functional.xef.auto +package com.xebia.functional.xef.conversation -import com.xebia.functional.xef.auto.llm.openai.OpenAI -import com.xebia.functional.xef.auto.llm.openai.prompt +import com.xebia.functional.xef.conversation.llm.openai.OpenAI +import com.xebia.functional.xef.conversation.llm.openai.prompt import kotlinx.serialization.Serializable @Serializable data class Animal(val name: String, val habitat: String, val diet: String) diff --git a/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/Book.kt b/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/Book.kt similarity index 74% rename from examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/Book.kt rename to examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/Book.kt index 95bbe4cae..a3074b2a1 100644 --- a/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/Book.kt +++ b/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/Book.kt @@ -1,7 +1,7 @@ -package com.xebia.functional.xef.auto +package com.xebia.functional.xef.conversation -import com.xebia.functional.xef.auto.llm.openai.OpenAI -import com.xebia.functional.xef.auto.llm.openai.prompt +import com.xebia.functional.xef.conversation.llm.openai.OpenAI +import com.xebia.functional.xef.conversation.llm.openai.prompt import kotlinx.serialization.Serializable @Serializable diff --git a/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/BreakingNews.kt b/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/BreakingNews.kt similarity index 79% rename from examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/BreakingNews.kt rename to examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/BreakingNews.kt index 6b99662e9..408cd85ff 100644 --- a/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/BreakingNews.kt +++ b/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/BreakingNews.kt @@ -1,7 +1,7 @@ -package com.xebia.functional.xef.auto +package com.xebia.functional.xef.conversation -import com.xebia.functional.xef.auto.llm.openai.OpenAI -import com.xebia.functional.xef.auto.llm.openai.prompt +import com.xebia.functional.xef.conversation.llm.openai.OpenAI +import com.xebia.functional.xef.conversation.llm.openai.prompt import com.xebia.functional.xef.reasoning.serpapi.Search import java.text.SimpleDateFormat import java.util.* diff --git a/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/ChessAI.kt b/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/ChessAI.kt similarity index 91% rename from examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/ChessAI.kt rename to examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/ChessAI.kt index ff665cc24..14975f07f 100644 --- a/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/ChessAI.kt +++ b/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/ChessAI.kt @@ -1,7 +1,7 @@ -package com.xebia.functional.xef.auto +package com.xebia.functional.xef.conversation -import com.xebia.functional.xef.auto.llm.openai.OpenAI -import com.xebia.functional.xef.auto.llm.openai.prompt +import com.xebia.functional.xef.conversation.llm.openai.OpenAI +import com.xebia.functional.xef.conversation.llm.openai.prompt import kotlinx.serialization.Serializable @Serializable data class ChessMove(val player: String, val move: String) diff --git a/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/Colors.kt b/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/Colors.kt similarity index 60% rename from examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/Colors.kt rename to examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/Colors.kt index cb952904a..f3db0a326 100644 --- a/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/Colors.kt +++ b/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/Colors.kt @@ -1,7 +1,7 @@ -package com.xebia.functional.xef.auto +package com.xebia.functional.xef.conversation -import com.xebia.functional.xef.auto.llm.openai.OpenAI -import com.xebia.functional.xef.auto.llm.openai.prompt +import com.xebia.functional.xef.conversation.llm.openai.OpenAI +import com.xebia.functional.xef.conversation.llm.openai.prompt import kotlinx.serialization.Serializable @Serializable data class Colors(val colors: List) diff --git a/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/Conversation.kt b/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/Conversation.kt similarity index 92% rename from examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/Conversation.kt rename to examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/Conversation.kt index 1575111a9..014de2801 100644 --- a/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/Conversation.kt +++ b/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/Conversation.kt @@ -1,7 +1,7 @@ -package com.xebia.functional.xef.auto +package com.xebia.functional.xef.conversation -import com.xebia.functional.xef.auto.llm.openai.OpenAI -import com.xebia.functional.xef.auto.llm.openai.promptMessage +import com.xebia.functional.xef.conversation.llm.openai.OpenAI +import com.xebia.functional.xef.conversation.llm.openai.promptMessage import com.xebia.functional.xef.prompt.Prompt suspend fun main() { diff --git a/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/DivergentTasks.kt b/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/DivergentTasks.kt similarity index 76% rename from examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/DivergentTasks.kt rename to examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/DivergentTasks.kt index 8828ab076..8abaa7838 100644 --- a/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/DivergentTasks.kt +++ b/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/DivergentTasks.kt @@ -1,7 +1,7 @@ -package com.xebia.functional.xef.auto +package com.xebia.functional.xef.conversation -import com.xebia.functional.xef.auto.llm.openai.OpenAI -import com.xebia.functional.xef.auto.llm.openai.prompt +import com.xebia.functional.xef.conversation.llm.openai.OpenAI +import com.xebia.functional.xef.conversation.llm.openai.prompt import com.xebia.functional.xef.reasoning.serpapi.Search import kotlinx.serialization.Serializable diff --git a/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/Employee.kt b/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/Employee.kt similarity index 87% rename from examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/Employee.kt rename to examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/Employee.kt index c6964355f..5cf744954 100644 --- a/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/Employee.kt +++ b/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/Employee.kt @@ -1,7 +1,7 @@ -package com.xebia.functional.xef.auto +package com.xebia.functional.xef.conversation -import com.xebia.functional.xef.auto.llm.openai.OpenAI -import com.xebia.functional.xef.auto.llm.openai.prompt +import com.xebia.functional.xef.conversation.llm.openai.OpenAI +import com.xebia.functional.xef.conversation.llm.openai.prompt import kotlinx.serialization.Serializable @Serializable diff --git a/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/Fact.kt b/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/Fact.kt similarity index 79% rename from examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/Fact.kt rename to examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/Fact.kt index 6c75c6697..9be842ad0 100644 --- a/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/Fact.kt +++ b/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/Fact.kt @@ -1,7 +1,7 @@ -package com.xebia.functional.xef.auto +package com.xebia.functional.xef.conversation -import com.xebia.functional.xef.auto.llm.openai.OpenAI -import com.xebia.functional.xef.auto.llm.openai.prompt +import com.xebia.functional.xef.conversation.llm.openai.OpenAI +import com.xebia.functional.xef.conversation.llm.openai.prompt import kotlinx.serialization.Serializable @Serializable data class Fact(val topic: String, val content: String) diff --git a/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/Love.kt b/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/Love.kt similarity index 53% rename from examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/Love.kt rename to examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/Love.kt index 59bcf8457..48aca88aa 100644 --- a/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/Love.kt +++ b/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/Love.kt @@ -1,7 +1,7 @@ -package com.xebia.functional.xef.auto +package com.xebia.functional.xef.conversation -import com.xebia.functional.xef.auto.llm.openai.OpenAI -import com.xebia.functional.xef.auto.llm.openai.prompt +import com.xebia.functional.xef.conversation.llm.openai.OpenAI +import com.xebia.functional.xef.conversation.llm.openai.prompt import com.xebia.functional.xef.prompt.Prompt suspend fun main() { diff --git a/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/Markets.kt b/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/Markets.kt similarity index 82% rename from examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/Markets.kt rename to examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/Markets.kt index 84ac2634b..bb9c91073 100644 --- a/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/Markets.kt +++ b/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/Markets.kt @@ -1,7 +1,7 @@ -package com.xebia.functional.xef.auto +package com.xebia.functional.xef.conversation -import com.xebia.functional.xef.auto.llm.openai.OpenAI -import com.xebia.functional.xef.auto.llm.openai.prompt +import com.xebia.functional.xef.conversation.llm.openai.OpenAI +import com.xebia.functional.xef.conversation.llm.openai.prompt import com.xebia.functional.xef.reasoning.serpapi.Search import java.text.SimpleDateFormat import java.util.Date diff --git a/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/MealPlan.kt b/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/MealPlan.kt similarity index 75% rename from examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/MealPlan.kt rename to examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/MealPlan.kt index ac53199d1..18cfce4ac 100644 --- a/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/MealPlan.kt +++ b/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/MealPlan.kt @@ -1,7 +1,7 @@ -package com.xebia.functional.xef.auto +package com.xebia.functional.xef.conversation -import com.xebia.functional.xef.auto.llm.openai.OpenAI -import com.xebia.functional.xef.auto.llm.openai.prompt +import com.xebia.functional.xef.conversation.llm.openai.OpenAI +import com.xebia.functional.xef.conversation.llm.openai.prompt import com.xebia.functional.xef.reasoning.serpapi.Search import kotlinx.serialization.Serializable diff --git a/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/MeaningOfLife.kt b/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/MeaningOfLife.kt similarity index 68% rename from examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/MeaningOfLife.kt rename to examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/MeaningOfLife.kt index eac0a7336..a33616a55 100644 --- a/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/MeaningOfLife.kt +++ b/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/MeaningOfLife.kt @@ -1,7 +1,7 @@ -package com.xebia.functional.xef.auto +package com.xebia.functional.xef.conversation -import com.xebia.functional.xef.auto.llm.openai.OpenAI -import com.xebia.functional.xef.auto.llm.openai.prompt +import com.xebia.functional.xef.conversation.llm.openai.OpenAI +import com.xebia.functional.xef.conversation.llm.openai.prompt import kotlinx.serialization.Serializable @Serializable data class MeaningOfLife(val mainTheories: List) diff --git a/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/Movie.kt b/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/Movie.kt similarity index 69% rename from examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/Movie.kt rename to examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/Movie.kt index c6bd4e240..ec0195c08 100644 --- a/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/Movie.kt +++ b/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/Movie.kt @@ -1,7 +1,7 @@ -package com.xebia.functional.xef.auto +package com.xebia.functional.xef.conversation -import com.xebia.functional.xef.auto.llm.openai.OpenAI -import com.xebia.functional.xef.auto.llm.openai.prompt +import com.xebia.functional.xef.conversation.llm.openai.OpenAI +import com.xebia.functional.xef.conversation.llm.openai.prompt import kotlinx.serialization.Serializable @Serializable data class Movie(val title: String, val genre: String, val director: String) diff --git a/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/PDFDocument.kt b/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/PDFDocument.kt similarity index 76% rename from examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/PDFDocument.kt rename to examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/PDFDocument.kt index d959495f0..69034bbbc 100644 --- a/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/PDFDocument.kt +++ b/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/PDFDocument.kt @@ -1,7 +1,7 @@ -package com.xebia.functional.xef.auto +package com.xebia.functional.xef.conversation -import com.xebia.functional.xef.auto.llm.openai.OpenAI -import com.xebia.functional.xef.auto.llm.openai.prompt +import com.xebia.functional.xef.conversation.llm.openai.OpenAI +import com.xebia.functional.xef.conversation.llm.openai.prompt import com.xebia.functional.xef.pdf.pdf import kotlinx.serialization.Serializable diff --git a/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/Person.kt b/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/Person.kt similarity index 62% rename from examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/Person.kt rename to examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/Person.kt index d35c749dd..e9eac75be 100644 --- a/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/Person.kt +++ b/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/Person.kt @@ -1,7 +1,7 @@ -package com.xebia.functional.xef.auto +package com.xebia.functional.xef.conversation -import com.xebia.functional.xef.auto.llm.openai.OpenAI -import com.xebia.functional.xef.auto.llm.openai.prompt +import com.xebia.functional.xef.conversation.llm.openai.OpenAI +import com.xebia.functional.xef.conversation.llm.openai.prompt import kotlinx.serialization.Serializable @Serializable data class Person(val name: String, val age: Int) diff --git a/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/Planet.kt b/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/Planet.kt similarity index 83% rename from examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/Planet.kt rename to examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/Planet.kt index cc0643aaf..06a81b5a7 100644 --- a/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/Planet.kt +++ b/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/Planet.kt @@ -1,7 +1,7 @@ -package com.xebia.functional.xef.auto +package com.xebia.functional.xef.conversation -import com.xebia.functional.xef.auto.llm.openai.OpenAI -import com.xebia.functional.xef.auto.llm.openai.prompt +import com.xebia.functional.xef.conversation.llm.openai.OpenAI +import com.xebia.functional.xef.conversation.llm.openai.prompt import kotlinx.serialization.Serializable @Serializable diff --git a/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/Poem.kt b/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/Poem.kt similarity index 83% rename from examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/Poem.kt rename to examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/Poem.kt index c06ba8328..3275911c1 100644 --- a/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/Poem.kt +++ b/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/Poem.kt @@ -1,7 +1,7 @@ -package com.xebia.functional.xef.auto +package com.xebia.functional.xef.conversation -import com.xebia.functional.xef.auto.llm.openai.OpenAI -import com.xebia.functional.xef.auto.llm.openai.prompt +import com.xebia.functional.xef.conversation.llm.openai.OpenAI +import com.xebia.functional.xef.conversation.llm.openai.prompt import kotlinx.serialization.Serializable @Serializable data class Poem(val title: String, val content: String) diff --git a/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/Recipe.kt b/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/Recipe.kt similarity index 64% rename from examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/Recipe.kt rename to examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/Recipe.kt index 532df03b3..49ddcd7e5 100644 --- a/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/Recipe.kt +++ b/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/Recipe.kt @@ -1,7 +1,7 @@ -package com.xebia.functional.xef.auto +package com.xebia.functional.xef.conversation -import com.xebia.functional.xef.auto.llm.openai.OpenAI -import com.xebia.functional.xef.auto.llm.openai.prompt +import com.xebia.functional.xef.conversation.llm.openai.OpenAI +import com.xebia.functional.xef.conversation.llm.openai.prompt import kotlinx.serialization.Serializable @Serializable data class Recipe(val name: String, val ingredients: List) diff --git a/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/StructuredInput.kt b/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/StructuredInput.kt similarity index 76% rename from examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/StructuredInput.kt rename to examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/StructuredInput.kt index 42f24dd4d..1e28db71d 100644 --- a/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/StructuredInput.kt +++ b/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/StructuredInput.kt @@ -1,7 +1,7 @@ -package com.xebia.functional.xef.auto +package com.xebia.functional.xef.conversation -import com.xebia.functional.xef.auto.llm.openai.OpenAI -import com.xebia.functional.xef.auto.llm.openai.prompt +import com.xebia.functional.xef.conversation.llm.openai.OpenAI +import com.xebia.functional.xef.conversation.llm.openai.prompt import com.xebia.functional.xef.prompt.Prompt import com.xebia.functional.xef.prompt.templates.user import kotlinx.serialization.Serializable diff --git a/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/TopAttraction.kt b/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/TopAttraction.kt similarity index 84% rename from examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/TopAttraction.kt rename to examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/TopAttraction.kt index 74398f31e..79e8f433f 100644 --- a/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/TopAttraction.kt +++ b/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/TopAttraction.kt @@ -1,7 +1,7 @@ -package com.xebia.functional.xef.auto +package com.xebia.functional.xef.conversation -import com.xebia.functional.xef.auto.llm.openai.OpenAI -import com.xebia.functional.xef.auto.llm.openai.prompt +import com.xebia.functional.xef.conversation.llm.openai.OpenAI +import com.xebia.functional.xef.conversation.llm.openai.prompt import kotlinx.serialization.Serializable @Serializable diff --git a/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/TouristAttraction.kt b/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/TouristAttraction.kt similarity index 73% rename from examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/TouristAttraction.kt rename to examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/TouristAttraction.kt index fdcc5d4c8..d2e82a461 100644 --- a/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/TouristAttraction.kt +++ b/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/TouristAttraction.kt @@ -1,7 +1,7 @@ -package com.xebia.functional.xef.auto +package com.xebia.functional.xef.conversation -import com.xebia.functional.xef.auto.llm.openai.OpenAI -import com.xebia.functional.xef.auto.llm.openai.prompt +import com.xebia.functional.xef.conversation.llm.openai.OpenAI +import com.xebia.functional.xef.conversation.llm.openai.prompt import kotlinx.serialization.Serializable @Serializable diff --git a/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/Weather.kt b/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/Weather.kt similarity index 77% rename from examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/Weather.kt rename to examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/Weather.kt index cdf271f3d..4c1942975 100644 --- a/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/Weather.kt +++ b/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/Weather.kt @@ -1,7 +1,7 @@ -package com.xebia.functional.xef.auto +package com.xebia.functional.xef.conversation -import com.xebia.functional.xef.auto.llm.openai.OpenAI -import com.xebia.functional.xef.auto.llm.openai.promptMessage +import com.xebia.functional.xef.conversation.llm.openai.OpenAI +import com.xebia.functional.xef.conversation.llm.openai.promptMessage import com.xebia.functional.xef.prompt.Prompt import com.xebia.functional.xef.reasoning.serpapi.Search import io.github.oshai.kotlinlogging.KotlinLogging diff --git a/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/expressions/DigitalDetoxPlanner.kt b/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/expressions/DigitalDetoxPlanner.kt similarity index 92% rename from examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/expressions/DigitalDetoxPlanner.kt rename to examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/expressions/DigitalDetoxPlanner.kt index c3a27f66a..dbdda30f6 100644 --- a/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/expressions/DigitalDetoxPlanner.kt +++ b/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/expressions/DigitalDetoxPlanner.kt @@ -1,7 +1,7 @@ -package com.xebia.functional.xef.auto.expressions +package com.xebia.functional.xef.conversation.expressions -import com.xebia.functional.xef.auto.Description -import com.xebia.functional.xef.auto.llm.openai.OpenAI +import com.xebia.functional.xef.conversation.Description +import com.xebia.functional.xef.conversation.llm.openai.OpenAI import com.xebia.functional.xef.prompt.Prompt import com.xebia.functional.xef.prompt.lang.Infer import kotlinx.serialization.Serializable diff --git a/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/expressions/PromptCrafter.kt b/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/expressions/PromptCrafter.kt similarity index 96% rename from examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/expressions/PromptCrafter.kt rename to examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/expressions/PromptCrafter.kt index efdcf27e3..ea35b3cc4 100644 --- a/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/expressions/PromptCrafter.kt +++ b/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/expressions/PromptCrafter.kt @@ -1,7 +1,7 @@ -package com.xebia.functional.xef.auto.expressions +package com.xebia.functional.xef.conversation.expressions -import com.xebia.functional.xef.auto.Description -import com.xebia.functional.xef.auto.llm.openai.OpenAI +import com.xebia.functional.xef.conversation.Description +import com.xebia.functional.xef.conversation.llm.openai.OpenAI import com.xebia.functional.xef.prompt.Prompt import com.xebia.functional.xef.prompt.lang.Infer import kotlinx.serialization.Serializable diff --git a/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/expressions/RecipeGenerator.kt b/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/expressions/RecipeGenerator.kt similarity index 94% rename from examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/expressions/RecipeGenerator.kt rename to examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/expressions/RecipeGenerator.kt index 16b94d6fe..9be06f7eb 100644 --- a/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/expressions/RecipeGenerator.kt +++ b/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/expressions/RecipeGenerator.kt @@ -1,7 +1,7 @@ -package com.xebia.functional.xef.auto.expressions +package com.xebia.functional.xef.conversation.expressions -import com.xebia.functional.xef.auto.Description -import com.xebia.functional.xef.auto.llm.openai.OpenAI +import com.xebia.functional.xef.conversation.Description +import com.xebia.functional.xef.conversation.llm.openai.OpenAI import com.xebia.functional.xef.prompt.Prompt import com.xebia.functional.xef.prompt.lang.Infer import kotlinx.serialization.Serializable diff --git a/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/expressions/TravelItinerary.kt b/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/expressions/TravelItinerary.kt similarity index 91% rename from examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/expressions/TravelItinerary.kt rename to examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/expressions/TravelItinerary.kt index c04f69e84..ca90bf690 100644 --- a/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/expressions/TravelItinerary.kt +++ b/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/expressions/TravelItinerary.kt @@ -1,7 +1,7 @@ -package com.xebia.functional.xef.auto.expressions +package com.xebia.functional.xef.conversation.expressions -import com.xebia.functional.xef.auto.Description -import com.xebia.functional.xef.auto.llm.openai.OpenAI +import com.xebia.functional.xef.conversation.Description +import com.xebia.functional.xef.conversation.llm.openai.OpenAI import com.xebia.functional.xef.prompt.Prompt import com.xebia.functional.xef.prompt.lang.Infer import kotlinx.serialization.Serializable diff --git a/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/expressions/WorkoutPlanProgram.kt b/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/expressions/WorkoutPlanProgram.kt similarity index 93% rename from examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/expressions/WorkoutPlanProgram.kt rename to examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/expressions/WorkoutPlanProgram.kt index 75678aa03..643e7272b 100644 --- a/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/expressions/WorkoutPlanProgram.kt +++ b/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/expressions/WorkoutPlanProgram.kt @@ -1,7 +1,7 @@ -package com.xebia.functional.xef.auto.expressions +package com.xebia.functional.xef.conversation.expressions -import com.xebia.functional.xef.auto.Conversation -import com.xebia.functional.xef.auto.llm.openai.OpenAI +import com.xebia.functional.xef.conversation.Conversation +import com.xebia.functional.xef.conversation.llm.openai.OpenAI import com.xebia.functional.xef.llm.ChatWithFunctions import com.xebia.functional.xef.prompt.Prompt import com.xebia.functional.xef.prompt.expressions.Expression diff --git a/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/fields/Book.kt b/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/fields/Book.kt similarity index 63% rename from examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/fields/Book.kt rename to examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/fields/Book.kt index 1a236bc79..c010bff3d 100644 --- a/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/fields/Book.kt +++ b/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/fields/Book.kt @@ -1,9 +1,8 @@ -package com.xebia.functional.xef.auto.fields +package com.xebia.functional.xef.conversation.fields -import com.xebia.functional.xef.auto.Description -import com.xebia.functional.xef.auto.conversation -import com.xebia.functional.xef.auto.llm.openai.OpenAI -import com.xebia.functional.xef.auto.llm.openai.prompt +import com.xebia.functional.xef.conversation.Description +import com.xebia.functional.xef.conversation.llm.openai.OpenAI +import com.xebia.functional.xef.conversation.llm.openai.prompt import kotlinx.serialization.Serializable @Serializable diff --git a/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/fields/NewsSummary.kt b/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/fields/NewsSummary.kt similarity index 76% rename from examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/fields/NewsSummary.kt rename to examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/fields/NewsSummary.kt index 8e3d7c359..1046556ea 100644 --- a/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/fields/NewsSummary.kt +++ b/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/fields/NewsSummary.kt @@ -1,9 +1,8 @@ -package com.xebia.functional.xef.auto.fields +package com.xebia.functional.xef.conversation.fields -import com.xebia.functional.xef.auto.Description -import com.xebia.functional.xef.auto.conversation -import com.xebia.functional.xef.auto.llm.openai.OpenAI -import com.xebia.functional.xef.auto.llm.openai.prompt +import com.xebia.functional.xef.conversation.Description +import com.xebia.functional.xef.conversation.llm.openai.OpenAI +import com.xebia.functional.xef.conversation.llm.openai.prompt import com.xebia.functional.xef.prompt.Prompt import com.xebia.functional.xef.reasoning.serpapi.Search import java.time.LocalDate diff --git a/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/gpc/Chat.kt b/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/gpc/Chat.kt similarity index 81% rename from examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/gpc/Chat.kt rename to examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/gpc/Chat.kt index a6d49fe9e..284de482d 100644 --- a/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/gpc/Chat.kt +++ b/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/gpc/Chat.kt @@ -1,6 +1,6 @@ -package com.xebia.functional.xef.auto.gpc +package com.xebia.functional.xef.conversation.gpc -import com.xebia.functional.xef.auto.llm.openai.OpenAI +import com.xebia.functional.xef.conversation.llm.openai.OpenAI import com.xebia.functional.xef.gcp.GcpChat import com.xebia.functional.xef.prompt.Prompt diff --git a/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/gpt4all/Chat.kt b/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/gpt4all/Chat.kt similarity index 93% rename from examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/gpt4all/Chat.kt rename to examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/gpt4all/Chat.kt index 429b556b6..c316b5fd3 100644 --- a/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/gpt4all/Chat.kt +++ b/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/gpt4all/Chat.kt @@ -1,8 +1,7 @@ -package com.xebia.functional.xef.auto.gpt4all +package com.xebia.functional.xef.conversation.gpt4all import com.xebia.functional.gpt4all.GPT4All import com.xebia.functional.gpt4all.Gpt4AllModel -import com.xebia.functional.gpt4all.conversation import com.xebia.functional.xef.prompt.Prompt import java.nio.file.Path import kotlinx.coroutines.flow.onCompletion diff --git a/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/manual/NoAI.kt b/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/manual/NoAI.kt similarity index 89% rename from examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/manual/NoAI.kt rename to examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/manual/NoAI.kt index 23e0308cc..de72345ae 100644 --- a/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/manual/NoAI.kt +++ b/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/manual/NoAI.kt @@ -1,12 +1,12 @@ -package com.xebia.functional.xef.auto.manual +package com.xebia.functional.xef.conversation.manual import com.xebia.functional.gpt4all.GPT4All import com.xebia.functional.gpt4all.HuggingFaceLocalEmbeddings import com.xebia.functional.gpt4all.huggingFaceUrl -import com.xebia.functional.xef.auto.Conversation +import com.xebia.functional.xef.conversation.Conversation import com.xebia.functional.xef.pdf.pdf import com.xebia.functional.xef.prompt.Prompt -import com.xebia.functional.xef.vectorstores.LocalVectorStore +import com.xebia.functional.xef.store.LocalVectorStore import java.nio.file.Path suspend fun main() { diff --git a/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/memory/ChatWithMemory.kt b/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/memory/ChatWithMemory.kt similarity index 74% rename from examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/memory/ChatWithMemory.kt rename to examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/memory/ChatWithMemory.kt index a5452e099..aabfaaa4c 100644 --- a/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/memory/ChatWithMemory.kt +++ b/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/memory/ChatWithMemory.kt @@ -1,6 +1,6 @@ -package com.xebia.functional.xef.auto.memory +package com.xebia.functional.xef.conversation.memory -import com.xebia.functional.xef.auto.llm.openai.OpenAI +import com.xebia.functional.xef.conversation.llm.openai.OpenAI import com.xebia.functional.xef.prompt.Prompt suspend fun main() { diff --git a/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/prompts/ExpertSystemExample.kt b/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/prompts/ExpertSystemExample.kt similarity index 89% rename from examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/prompts/ExpertSystemExample.kt rename to examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/prompts/ExpertSystemExample.kt index 1840b9545..00cedf066 100644 --- a/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/prompts/ExpertSystemExample.kt +++ b/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/prompts/ExpertSystemExample.kt @@ -1,7 +1,7 @@ -package com.xebia.functional.xef.auto.prompts +package com.xebia.functional.xef.conversation.prompts -import com.xebia.functional.xef.auto.llm.openai.OpenAI -import com.xebia.functional.xef.auto.llm.openai.prompt +import com.xebia.functional.xef.conversation.llm.openai.OpenAI +import com.xebia.functional.xef.conversation.llm.openai.prompt import com.xebia.functional.xef.prompt.Prompt import com.xebia.functional.xef.prompt.templates.assistant import com.xebia.functional.xef.prompt.templates.system diff --git a/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/prompts/PromptEvaluationExample.kt b/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/prompts/PromptEvaluationExample.kt similarity index 74% rename from examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/prompts/PromptEvaluationExample.kt rename to examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/prompts/PromptEvaluationExample.kt index 9d904b6f2..a571fc005 100644 --- a/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/prompts/PromptEvaluationExample.kt +++ b/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/prompts/PromptEvaluationExample.kt @@ -1,6 +1,6 @@ -package com.xebia.functional.xef.auto.prompts +package com.xebia.functional.xef.conversation.prompts -import com.xebia.functional.xef.auto.llm.openai.OpenAI +import com.xebia.functional.xef.conversation.llm.openai.OpenAI import com.xebia.functional.xef.prompt.evaluator.PromptEvaluator suspend fun main() { diff --git a/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/reasoning/CodeExample.kt b/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/reasoning/CodeExample.kt similarity index 94% rename from examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/reasoning/CodeExample.kt rename to examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/reasoning/CodeExample.kt index d2e970943..41bbed415 100644 --- a/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/reasoning/CodeExample.kt +++ b/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/reasoning/CodeExample.kt @@ -1,6 +1,6 @@ -package com.xebia.functional.xef.auto.reasoning +package com.xebia.functional.xef.conversation.reasoning -import com.xebia.functional.xef.auto.llm.openai.OpenAI +import com.xebia.functional.xef.conversation.llm.openai.OpenAI import com.xebia.functional.xef.reasoning.code.Code suspend fun main() { diff --git a/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/reasoning/CreatePRDescription.kt b/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/reasoning/CreatePRDescription.kt similarity index 87% rename from examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/reasoning/CreatePRDescription.kt rename to examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/reasoning/CreatePRDescription.kt index 4ae77abf7..61edf20c3 100644 --- a/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/reasoning/CreatePRDescription.kt +++ b/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/reasoning/CreatePRDescription.kt @@ -1,6 +1,6 @@ -package com.xebia.functional.xef.auto.reasoning +package com.xebia.functional.xef.conversation.reasoning -import com.xebia.functional.xef.auto.llm.openai.OpenAI +import com.xebia.functional.xef.conversation.llm.openai.OpenAI import com.xebia.functional.xef.prompt.Prompt import com.xebia.functional.xef.prompt.templates.user import com.xebia.functional.xef.reasoning.code.Code diff --git a/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/reasoning/ReActExample.kt b/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/reasoning/ReActExample.kt similarity index 91% rename from examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/reasoning/ReActExample.kt rename to examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/reasoning/ReActExample.kt index 7d2ee6aad..08cc2d6c0 100644 --- a/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/reasoning/ReActExample.kt +++ b/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/reasoning/ReActExample.kt @@ -1,6 +1,6 @@ -package com.xebia.functional.xef.auto.reasoning +package com.xebia.functional.xef.conversation.reasoning -import com.xebia.functional.xef.auto.llm.openai.OpenAI +import com.xebia.functional.xef.conversation.llm.openai.OpenAI import com.xebia.functional.xef.prompt.Prompt import com.xebia.functional.xef.prompt.templates.user import com.xebia.functional.xef.reasoning.serpapi.Search diff --git a/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/reasoning/SerpApiExample.kt b/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/reasoning/SerpApiExample.kt similarity index 89% rename from examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/reasoning/SerpApiExample.kt rename to examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/reasoning/SerpApiExample.kt index ff2374be0..b9fd52ca7 100644 --- a/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/reasoning/SerpApiExample.kt +++ b/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/reasoning/SerpApiExample.kt @@ -1,4 +1,4 @@ -package com.xebia.functional.xef.auto.reasoning +package com.xebia.functional.xef.conversation.reasoning import com.xebia.functional.xef.reasoning.serpapi.SerpApiClient diff --git a/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/reasoning/TextExample.kt b/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/reasoning/TextExample.kt similarity index 96% rename from examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/reasoning/TextExample.kt rename to examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/reasoning/TextExample.kt index 3acf19aee..0d55e155f 100644 --- a/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/reasoning/TextExample.kt +++ b/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/reasoning/TextExample.kt @@ -1,6 +1,6 @@ -package com.xebia.functional.xef.auto.reasoning +package com.xebia.functional.xef.conversation.reasoning -import com.xebia.functional.xef.auto.llm.openai.OpenAI +import com.xebia.functional.xef.conversation.llm.openai.OpenAI import com.xebia.functional.xef.reasoning.text.Text import com.xebia.functional.xef.reasoning.text.summarize.SummaryLength diff --git a/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/reasoning/ToolSelectionExample.kt b/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/reasoning/ToolSelectionExample.kt similarity index 89% rename from examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/reasoning/ToolSelectionExample.kt rename to examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/reasoning/ToolSelectionExample.kt index e466689eb..1d412e230 100644 --- a/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/reasoning/ToolSelectionExample.kt +++ b/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/reasoning/ToolSelectionExample.kt @@ -1,6 +1,6 @@ -package com.xebia.functional.xef.auto.reasoning +package com.xebia.functional.xef.conversation.reasoning -import com.xebia.functional.xef.auto.llm.openai.OpenAI +import com.xebia.functional.xef.conversation.llm.openai.OpenAI import com.xebia.functional.xef.reasoning.filesystem.Files import com.xebia.functional.xef.reasoning.pdf.PDF import com.xebia.functional.xef.reasoning.text.Text diff --git a/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/reasoning/WikipediaSearchByParamsExample.kt b/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/reasoning/WikipediaSearchByParamsExample.kt similarity index 85% rename from examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/reasoning/WikipediaSearchByParamsExample.kt rename to examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/reasoning/WikipediaSearchByParamsExample.kt index 172e580ce..054cb35fc 100644 --- a/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/reasoning/WikipediaSearchByParamsExample.kt +++ b/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/reasoning/WikipediaSearchByParamsExample.kt @@ -1,7 +1,6 @@ -package com.xebia.functional.xef.auto.reasoning +package com.xebia.functional.xef.conversation.reasoning -import com.xebia.functional.gpt4all.conversation -import com.xebia.functional.xef.auto.llm.openai.OpenAI +import com.xebia.functional.xef.conversation.llm.openai.OpenAI import com.xebia.functional.xef.reasoning.wikipedia.WikipediaClient suspend fun main() { diff --git a/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/reasoning/WikipediaSearchExample.kt b/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/reasoning/WikipediaSearchExample.kt similarity index 79% rename from examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/reasoning/WikipediaSearchExample.kt rename to examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/reasoning/WikipediaSearchExample.kt index 382caa490..90a44cac6 100644 --- a/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/reasoning/WikipediaSearchExample.kt +++ b/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/reasoning/WikipediaSearchExample.kt @@ -1,7 +1,6 @@ -package com.xebia.functional.xef.auto.reasoning +package com.xebia.functional.xef.conversation.reasoning -import com.xebia.functional.gpt4all.conversation -import com.xebia.functional.xef.auto.llm.openai.OpenAI +import com.xebia.functional.xef.conversation.llm.openai.OpenAI import com.xebia.functional.xef.reasoning.wikipedia.WikipediaClient suspend fun main() { diff --git a/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/sql/DatabaseExample.kt b/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/sql/DatabaseExample.kt similarity index 95% rename from examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/sql/DatabaseExample.kt rename to examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/sql/DatabaseExample.kt index edf74d9bd..026a40ab2 100644 --- a/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/sql/DatabaseExample.kt +++ b/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/sql/DatabaseExample.kt @@ -1,7 +1,7 @@ -package com.xebia.functional.xef.auto.sql +package com.xebia.functional.xef.conversation.sql import arrow.core.raise.catch -import com.xebia.functional.xef.auto.llm.openai.OpenAI +import com.xebia.functional.xef.conversation.llm.openai.OpenAI import com.xebia.functional.xef.prompt.Prompt import com.xebia.functional.xef.sql.SQL import com.xebia.functional.xef.sql.jdbc.JdbcConfig diff --git a/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/streaming/OpenAIStreamingExample.kt b/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/streaming/OpenAIStreamingExample.kt similarity index 56% rename from examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/streaming/OpenAIStreamingExample.kt rename to examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/streaming/OpenAIStreamingExample.kt index ebd5147e3..785af156d 100644 --- a/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/streaming/OpenAIStreamingExample.kt +++ b/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/streaming/OpenAIStreamingExample.kt @@ -1,11 +1,11 @@ -package com.xebia.functional.xef.auto.streaming +package com.xebia.functional.xef.conversation.streaming -import com.xebia.functional.xef.auto.Conversation -import com.xebia.functional.xef.auto.llm.openai.OpenAI -import com.xebia.functional.xef.auto.llm.openai.OpenAIEmbeddings +import com.xebia.functional.xef.conversation.Conversation +import com.xebia.functional.xef.conversation.llm.openai.OpenAI +import com.xebia.functional.xef.conversation.llm.openai.OpenAIEmbeddings import com.xebia.functional.xef.llm.Chat import com.xebia.functional.xef.prompt.Prompt -import com.xebia.functional.xef.vectorstores.LocalVectorStore +import com.xebia.functional.xef.store.LocalVectorStore suspend fun main() { val chat: Chat = OpenAI().DEFAULT_CHAT diff --git a/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/tot/Checker.kt b/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/tot/Checker.kt similarity index 85% rename from examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/tot/Checker.kt rename to examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/tot/Checker.kt index 0a224da2a..a139e438e 100644 --- a/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/tot/Checker.kt +++ b/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/tot/Checker.kt @@ -1,4 +1,4 @@ -package com.xebia.functional.xef.auto.tot +package com.xebia.functional.xef.conversation.tot // Function to perform solution validation internal fun checkSolution(response: Solution): Solution { diff --git a/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/tot/ControlSignal.kt b/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/tot/ControlSignal.kt similarity index 86% rename from examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/tot/ControlSignal.kt rename to examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/tot/ControlSignal.kt index 45b0c4280..553c086a9 100644 --- a/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/tot/ControlSignal.kt +++ b/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/tot/ControlSignal.kt @@ -1,7 +1,7 @@ -package com.xebia.functional.xef.auto.tot +package com.xebia.functional.xef.conversation.tot -import com.xebia.functional.xef.auto.Conversation -import com.xebia.functional.xef.auto.llm.openai.prompt +import com.xebia.functional.xef.conversation.Conversation +import com.xebia.functional.xef.conversation.llm.openai.prompt import kotlinx.serialization.Serializable @Serializable data class ControlSignal(val value: String) diff --git a/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/tot/Critique.kt b/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/tot/Critique.kt similarity index 82% rename from examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/tot/Critique.kt rename to examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/tot/Critique.kt index b6abcbd5a..8c8638a9d 100644 --- a/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/tot/Critique.kt +++ b/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/tot/Critique.kt @@ -1,7 +1,7 @@ -package com.xebia.functional.xef.auto.tot +package com.xebia.functional.xef.conversation.tot -import com.xebia.functional.xef.auto.Conversation -import com.xebia.functional.xef.auto.llm.openai.prompt +import com.xebia.functional.xef.conversation.Conversation +import com.xebia.functional.xef.conversation.llm.openai.prompt import kotlinx.serialization.Serializable @Serializable diff --git a/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/tot/Main.kt b/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/tot/Main.kt similarity index 90% rename from examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/tot/Main.kt rename to examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/tot/Main.kt index f73e71ed0..8ce75d728 100644 --- a/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/tot/Main.kt +++ b/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/tot/Main.kt @@ -1,6 +1,6 @@ -package com.xebia.functional.xef.auto.tot +package com.xebia.functional.xef.conversation.tot -import com.xebia.functional.xef.auto.llm.openai.OpenAI +import com.xebia.functional.xef.conversation.llm.openai.OpenAI import kotlinx.serialization.Serializable @Serializable data class FinalSolution(val solution: String) diff --git a/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/tot/Problem.kt b/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/tot/Problem.kt similarity index 94% rename from examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/tot/Problem.kt rename to examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/tot/Problem.kt index d04c83a5c..3aeee7ed3 100644 --- a/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/tot/Problem.kt +++ b/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/tot/Problem.kt @@ -1,6 +1,6 @@ -package com.xebia.functional.xef.auto.tot +package com.xebia.functional.xef.conversation.tot -import com.xebia.functional.xef.auto.Conversation +import com.xebia.functional.xef.conversation.Conversation import kotlinx.serialization.KSerializer import kotlinx.serialization.Serializable import kotlinx.serialization.serializer diff --git a/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/tot/Rendering.kt b/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/tot/Rendering.kt similarity index 92% rename from examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/tot/Rendering.kt rename to examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/tot/Rendering.kt index dde291e81..8dd9cb153 100644 --- a/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/tot/Rendering.kt +++ b/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/tot/Rendering.kt @@ -1,4 +1,4 @@ -package com.xebia.functional.xef.auto.tot +package com.xebia.functional.xef.conversation.tot // Function to truncate a text to fit within a certain character limit fun truncateText(text: String, limit: Int = 150): String { diff --git a/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/tot/Solution.kt b/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/tot/Solution.kt similarity index 91% rename from examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/tot/Solution.kt rename to examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/tot/Solution.kt index d0f441221..8fa7d4b08 100644 --- a/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/tot/Solution.kt +++ b/examples/kotlin/src/main/kotlin/com/xebia/functional/xef/conversation/tot/Solution.kt @@ -1,8 +1,7 @@ -package com.xebia.functional.xef.auto.tot +package com.xebia.functional.xef.conversation.tot -import com.xebia.functional.xef.auto.Conversation -import com.xebia.functional.xef.auto.llm.openai.OpenAI -import com.xebia.functional.xef.auto.llm.openai.prompt +import com.xebia.functional.xef.conversation.Conversation +import com.xebia.functional.xef.conversation.llm.openai.OpenAI import com.xebia.functional.xef.prompt.Prompt import kotlinx.serialization.KSerializer import kotlinx.serialization.Serializable diff --git a/examples/scala/build.gradle.kts b/examples/scala/build.gradle.kts index 8f9010950..ac6500ea7 100644 --- a/examples/scala/build.gradle.kts +++ b/examples/scala/build.gradle.kts @@ -16,7 +16,6 @@ java { dependencies { implementation(projects.xefCore) implementation(projects.xefScala) - implementation(projects.kotlinLoom) implementation(projects.xefReasoning) implementation(projects.xefOpenai) implementation(libs.circe.parser) diff --git a/examples/scala/src/main/scala/com/xebia/functional/xef/scala/auto/ASCIIArt.scala b/examples/scala/src/main/scala/com/xebia/functional/xef/scala/auto/ASCIIArt.scala index f8fe4d3b7..02147492e 100644 --- a/examples/scala/src/main/scala/com/xebia/functional/xef/scala/auto/ASCIIArt.scala +++ b/examples/scala/src/main/scala/com/xebia/functional/xef/scala/auto/ASCIIArt.scala @@ -1,6 +1,6 @@ -package com.xebia.functional.xef.scala.auto +package com.xebia.functional.xef.scala.conversation -import com.xebia.functional.xef.scala.auto.* +import com.xebia.functional.xef.scala.conversation.* import com.xebia.functional.xef.prompt.Prompt import io.circe.Decoder diff --git a/examples/scala/src/main/scala/com/xebia/functional/xef/scala/auto/Animal.scala b/examples/scala/src/main/scala/com/xebia/functional/xef/scala/auto/Animal.scala index 57f117931..c54fc926e 100644 --- a/examples/scala/src/main/scala/com/xebia/functional/xef/scala/auto/Animal.scala +++ b/examples/scala/src/main/scala/com/xebia/functional/xef/scala/auto/Animal.scala @@ -1,6 +1,6 @@ -package com.xebia.functional.xef.scala.auto +package com.xebia.functional.xef.scala.conversation -import com.xebia.functional.xef.scala.auto.* +import com.xebia.functional.xef.scala.conversation.* import com.xebia.functional.xef.prompt.Prompt import com.xebia.functional.xef.prompt.PromptBuilder import io.circe.Decoder diff --git a/examples/scala/src/main/scala/com/xebia/functional/xef/scala/auto/Book.scala b/examples/scala/src/main/scala/com/xebia/functional/xef/scala/auto/Book.scala index 5d3a3da50..972ddf4ad 100644 --- a/examples/scala/src/main/scala/com/xebia/functional/xef/scala/auto/Book.scala +++ b/examples/scala/src/main/scala/com/xebia/functional/xef/scala/auto/Book.scala @@ -1,7 +1,7 @@ -package com.xebia.functional.xef.scala.auto +package com.xebia.functional.xef.scala.conversation -import com.xebia.functional.xef.scala.auto.Description -import com.xebia.functional.xef.scala.auto.* +import com.xebia.functional.xef.scala.conversation.Description +import com.xebia.functional.xef.scala.conversation.* import io.circe.Decoder import com.xebia.functional.xef.prompt.Prompt diff --git a/examples/scala/src/main/scala/com/xebia/functional/xef/scala/auto/BreakingNews.scala b/examples/scala/src/main/scala/com/xebia/functional/xef/scala/auto/BreakingNews.scala index a92a07fbb..79a4374d3 100644 --- a/examples/scala/src/main/scala/com/xebia/functional/xef/scala/auto/BreakingNews.scala +++ b/examples/scala/src/main/scala/com/xebia/functional/xef/scala/auto/BreakingNews.scala @@ -1,8 +1,8 @@ -package com.xebia.functional.xef.scala.auto +package com.xebia.functional.xef.scala.conversation -import com.xebia.functional.xef.scala.auto.* +import com.xebia.functional.xef.scala.conversation.* import com.xebia.functional.xef.reasoning.serpapi.Search -import com.xebia.functional.xef.auto.llm.openai.OpenAI +import com.xebia.functional.xef.conversation.llm.openai.OpenAI import io.circe.Decoder import com.xebia.functional.xef.prompt.Prompt diff --git a/examples/scala/src/main/scala/com/xebia/functional/xef/scala/auto/ChessAI.scala b/examples/scala/src/main/scala/com/xebia/functional/xef/scala/auto/ChessAI.scala index 73e188a9e..7f6cf54b5 100644 --- a/examples/scala/src/main/scala/com/xebia/functional/xef/scala/auto/ChessAI.scala +++ b/examples/scala/src/main/scala/com/xebia/functional/xef/scala/auto/ChessAI.scala @@ -1,6 +1,6 @@ -package com.xebia.functional.xef.scala.auto +package com.xebia.functional.xef.scala.conversation -import com.xebia.functional.xef.scala.auto.* +import com.xebia.functional.xef.scala.conversation.* import io.circe.Decoder import com.xebia.functional.xef.prompt.Prompt diff --git a/examples/scala/src/main/scala/com/xebia/functional/xef/scala/auto/Colors.scala b/examples/scala/src/main/scala/com/xebia/functional/xef/scala/auto/Colors.scala index ddae9b4e5..c0082edc3 100644 --- a/examples/scala/src/main/scala/com/xebia/functional/xef/scala/auto/Colors.scala +++ b/examples/scala/src/main/scala/com/xebia/functional/xef/scala/auto/Colors.scala @@ -1,6 +1,6 @@ -package com.xebia.functional.xef.scala.auto +package com.xebia.functional.xef.scala.conversation -import com.xebia.functional.xef.scala.auto.* +import com.xebia.functional.xef.scala.conversation.* import io.circe.Decoder import com.xebia.functional.xef.prompt.Prompt diff --git a/examples/scala/src/main/scala/com/xebia/functional/xef/scala/auto/DivergentTasks.scala b/examples/scala/src/main/scala/com/xebia/functional/xef/scala/auto/DivergentTasks.scala index 54160ef01..da507f57e 100644 --- a/examples/scala/src/main/scala/com/xebia/functional/xef/scala/auto/DivergentTasks.scala +++ b/examples/scala/src/main/scala/com/xebia/functional/xef/scala/auto/DivergentTasks.scala @@ -1,7 +1,7 @@ -package com.xebia.functional.xef.scala.auto +package com.xebia.functional.xef.scala.conversation -import com.xebia.functional.xef.scala.auto.* -import com.xebia.functional.xef.auto.llm.openai.OpenAI +import com.xebia.functional.xef.scala.conversation.* +import com.xebia.functional.xef.conversation.llm.openai.OpenAI import com.xebia.functional.xef.reasoning.serpapi.Search import io.circe.Decoder import com.xebia.functional.xef.prompt.Prompt diff --git a/examples/scala/src/main/scala/com/xebia/functional/xef/scala/auto/Employee.scala b/examples/scala/src/main/scala/com/xebia/functional/xef/scala/auto/Employee.scala index 7fea8d34f..7011674cb 100644 --- a/examples/scala/src/main/scala/com/xebia/functional/xef/scala/auto/Employee.scala +++ b/examples/scala/src/main/scala/com/xebia/functional/xef/scala/auto/Employee.scala @@ -1,6 +1,6 @@ -package com.xebia.functional.xef.scala.auto +package com.xebia.functional.xef.scala.conversation -import com.xebia.functional.xef.scala.auto.* +import com.xebia.functional.xef.scala.conversation.* import io.circe.Decoder import com.xebia.functional.xef.prompt.Prompt diff --git a/examples/scala/src/main/scala/com/xebia/functional/xef/scala/auto/Fact.scala b/examples/scala/src/main/scala/com/xebia/functional/xef/scala/auto/Fact.scala index 6896fca79..0c45e8ab0 100644 --- a/examples/scala/src/main/scala/com/xebia/functional/xef/scala/auto/Fact.scala +++ b/examples/scala/src/main/scala/com/xebia/functional/xef/scala/auto/Fact.scala @@ -1,6 +1,6 @@ -package com.xebia.functional.xef.scala.auto +package com.xebia.functional.xef.scala.conversation -import com.xebia.functional.xef.scala.auto.* +import com.xebia.functional.xef.scala.conversation.* import io.circe.Decoder import com.xebia.functional.xef.prompt.Prompt diff --git a/examples/scala/src/main/scala/com/xebia/functional/xef/scala/auto/Love.scala b/examples/scala/src/main/scala/com/xebia/functional/xef/scala/auto/Love.scala index 88644adaf..55bf57e34 100644 --- a/examples/scala/src/main/scala/com/xebia/functional/xef/scala/auto/Love.scala +++ b/examples/scala/src/main/scala/com/xebia/functional/xef/scala/auto/Love.scala @@ -1,6 +1,6 @@ -package com.xebia.functional.xef.scala.auto +package com.xebia.functional.xef.scala.conversation -import com.xebia.functional.xef.scala.auto.* +import com.xebia.functional.xef.scala.conversation.* import io.circe.Decoder import com.xebia.functional.xef.prompt.Prompt diff --git a/examples/scala/src/main/scala/com/xebia/functional/xef/scala/auto/Markets.scala b/examples/scala/src/main/scala/com/xebia/functional/xef/scala/auto/Markets.scala index c09528237..44fb6b8bc 100644 --- a/examples/scala/src/main/scala/com/xebia/functional/xef/scala/auto/Markets.scala +++ b/examples/scala/src/main/scala/com/xebia/functional/xef/scala/auto/Markets.scala @@ -1,8 +1,8 @@ -package com.xebia.functional.xef.scala.auto +package com.xebia.functional.xef.scala.conversation -import com.xebia.functional.xef.auto.llm.openai.OpenAI +import com.xebia.functional.xef.conversation.llm.openai.OpenAI import com.xebia.functional.xef.reasoning.serpapi.Search -import com.xebia.functional.xef.scala.auto.* +import com.xebia.functional.xef.scala.conversation.* import io.circe.Decoder import com.xebia.functional.xef.prompt.Prompt diff --git a/examples/scala/src/main/scala/com/xebia/functional/xef/scala/auto/MealPlan.scala b/examples/scala/src/main/scala/com/xebia/functional/xef/scala/auto/MealPlan.scala index ac2ffdb2f..a274fac4c 100644 --- a/examples/scala/src/main/scala/com/xebia/functional/xef/scala/auto/MealPlan.scala +++ b/examples/scala/src/main/scala/com/xebia/functional/xef/scala/auto/MealPlan.scala @@ -1,8 +1,8 @@ -package com.xebia.functional.xef.scala.auto +package com.xebia.functional.xef.scala.conversation import com.xebia.functional.xef.reasoning.serpapi.Search -import com.xebia.functional.xef.scala.auto.* -import com.xebia.functional.xef.auto.llm.openai.OpenAI +import com.xebia.functional.xef.scala.conversation.* +import com.xebia.functional.xef.conversation.llm.openai.OpenAI import io.circe.Decoder import com.xebia.functional.xef.prompt.Prompt diff --git a/examples/scala/src/main/scala/com/xebia/functional/xef/scala/auto/MeaningOfLife.scala b/examples/scala/src/main/scala/com/xebia/functional/xef/scala/auto/MeaningOfLife.scala index f3d45acda..45f954697 100644 --- a/examples/scala/src/main/scala/com/xebia/functional/xef/scala/auto/MeaningOfLife.scala +++ b/examples/scala/src/main/scala/com/xebia/functional/xef/scala/auto/MeaningOfLife.scala @@ -1,6 +1,6 @@ -package com.xebia.functional.xef.scala.auto +package com.xebia.functional.xef.scala.conversation -import com.xebia.functional.xef.scala.auto.* +import com.xebia.functional.xef.scala.conversation.* import io.circe.Decoder import com.xebia.functional.xef.prompt.Prompt diff --git a/examples/scala/src/main/scala/com/xebia/functional/xef/scala/auto/Movie.scala b/examples/scala/src/main/scala/com/xebia/functional/xef/scala/auto/Movie.scala index 69cb21ed3..02373eb88 100644 --- a/examples/scala/src/main/scala/com/xebia/functional/xef/scala/auto/Movie.scala +++ b/examples/scala/src/main/scala/com/xebia/functional/xef/scala/auto/Movie.scala @@ -1,6 +1,6 @@ -package com.xebia.functional.xef.scala.auto +package com.xebia.functional.xef.scala.conversation -import com.xebia.functional.xef.scala.auto.* +import com.xebia.functional.xef.scala.conversation.* import io.circe.Decoder import com.xebia.functional.xef.prompt.Prompt diff --git a/examples/scala/src/main/scala/com/xebia/functional/xef/scala/auto/PDFDocument.scala b/examples/scala/src/main/scala/com/xebia/functional/xef/scala/auto/PDFDocument.scala index 6d788476f..d636542f6 100644 --- a/examples/scala/src/main/scala/com/xebia/functional/xef/scala/auto/PDFDocument.scala +++ b/examples/scala/src/main/scala/com/xebia/functional/xef/scala/auto/PDFDocument.scala @@ -1,8 +1,8 @@ -package com.xebia.functional.xef.scala.auto +package com.xebia.functional.xef.scala.conversation -import com.xebia.functional.xef.scala.auto.* +import com.xebia.functional.xef.scala.conversation.* import com.xebia.functional.xef.reasoning.pdf.PDF -import com.xebia.functional.xef.auto.llm.openai.OpenAI +import com.xebia.functional.xef.conversation.llm.openai.OpenAI import io.circe.Decoder import com.xebia.functional.xef.prompt.Prompt diff --git a/examples/scala/src/main/scala/com/xebia/functional/xef/scala/auto/Person.scala b/examples/scala/src/main/scala/com/xebia/functional/xef/scala/auto/Person.scala index 590a196c2..4179e294b 100644 --- a/examples/scala/src/main/scala/com/xebia/functional/xef/scala/auto/Person.scala +++ b/examples/scala/src/main/scala/com/xebia/functional/xef/scala/auto/Person.scala @@ -1,6 +1,6 @@ -package com.xebia.functional.xef.scala.auto +package com.xebia.functional.xef.scala.conversation -import com.xebia.functional.xef.scala.auto.* +import com.xebia.functional.xef.scala.conversation.* import io.circe.Decoder import com.xebia.functional.xef.prompt.Prompt diff --git a/examples/scala/src/main/scala/com/xebia/functional/xef/scala/auto/Planet.scala b/examples/scala/src/main/scala/com/xebia/functional/xef/scala/auto/Planet.scala index 8bd1c693b..6f53aece7 100644 --- a/examples/scala/src/main/scala/com/xebia/functional/xef/scala/auto/Planet.scala +++ b/examples/scala/src/main/scala/com/xebia/functional/xef/scala/auto/Planet.scala @@ -1,6 +1,6 @@ -package com.xebia.functional.xef.scala.auto +package com.xebia.functional.xef.scala.conversation -import com.xebia.functional.xef.scala.auto.* +import com.xebia.functional.xef.scala.conversation.* import io.circe.Decoder import com.xebia.functional.xef.prompt.Prompt diff --git a/examples/scala/src/main/scala/com/xebia/functional/xef/scala/auto/Poem.scala b/examples/scala/src/main/scala/com/xebia/functional/xef/scala/auto/Poem.scala index c4d62d2ab..3efb15e95 100644 --- a/examples/scala/src/main/scala/com/xebia/functional/xef/scala/auto/Poem.scala +++ b/examples/scala/src/main/scala/com/xebia/functional/xef/scala/auto/Poem.scala @@ -1,6 +1,6 @@ -package com.xebia.functional.xef.scala.auto +package com.xebia.functional.xef.scala.conversation -import com.xebia.functional.xef.scala.auto.* +import com.xebia.functional.xef.scala.conversation.* import io.circe.Decoder import com.xebia.functional.xef.prompt.Prompt diff --git a/examples/scala/src/main/scala/com/xebia/functional/xef/scala/auto/Population.scala b/examples/scala/src/main/scala/com/xebia/functional/xef/scala/auto/Population.scala index 91acfdc6c..7fe618a88 100644 --- a/examples/scala/src/main/scala/com/xebia/functional/xef/scala/auto/Population.scala +++ b/examples/scala/src/main/scala/com/xebia/functional/xef/scala/auto/Population.scala @@ -1,6 +1,6 @@ -package com.xebia.functional.xef.scala.auto +package com.xebia.functional.xef.scala.conversation -import com.xebia.functional.xef.scala.auto.* +import com.xebia.functional.xef.scala.conversation.* import com.xebia.functional.xef.llm.models.images.ImagesGenerationResponse import io.circe.Decoder import com.xebia.functional.xef.prompt.Prompt diff --git a/examples/scala/src/main/scala/com/xebia/functional/xef/scala/auto/Recipe.scala b/examples/scala/src/main/scala/com/xebia/functional/xef/scala/auto/Recipe.scala index e76e98851..34980e065 100644 --- a/examples/scala/src/main/scala/com/xebia/functional/xef/scala/auto/Recipe.scala +++ b/examples/scala/src/main/scala/com/xebia/functional/xef/scala/auto/Recipe.scala @@ -1,6 +1,6 @@ -package com.xebia.functional.xef.scala.auto +package com.xebia.functional.xef.scala.conversation -import com.xebia.functional.xef.scala.auto.* +import com.xebia.functional.xef.scala.conversation.* import io.circe.Decoder import com.xebia.functional.xef.prompt.Prompt diff --git a/examples/scala/src/main/scala/com/xebia/functional/xef/scala/auto/TopAttraction.scala b/examples/scala/src/main/scala/com/xebia/functional/xef/scala/auto/TopAttraction.scala index 8ac0c7a05..a5d798af1 100644 --- a/examples/scala/src/main/scala/com/xebia/functional/xef/scala/auto/TopAttraction.scala +++ b/examples/scala/src/main/scala/com/xebia/functional/xef/scala/auto/TopAttraction.scala @@ -1,6 +1,6 @@ -package com.xebia.functional.xef.scala.auto +package com.xebia.functional.xef.scala.conversation -import com.xebia.functional.xef.scala.auto.* +import com.xebia.functional.xef.scala.conversation.* import io.circe.Decoder import com.xebia.functional.xef.prompt.Prompt diff --git a/examples/scala/src/main/scala/com/xebia/functional/xef/scala/auto/TouristAttraction.scala b/examples/scala/src/main/scala/com/xebia/functional/xef/scala/auto/TouristAttraction.scala index f7928111e..df38ab354 100644 --- a/examples/scala/src/main/scala/com/xebia/functional/xef/scala/auto/TouristAttraction.scala +++ b/examples/scala/src/main/scala/com/xebia/functional/xef/scala/auto/TouristAttraction.scala @@ -1,6 +1,6 @@ -package com.xebia.functional.xef.scala.auto +package com.xebia.functional.xef.scala.conversation -import com.xebia.functional.xef.scala.auto.* +import com.xebia.functional.xef.scala.conversation.* import io.circe.Decoder import com.xebia.functional.xef.prompt.Prompt diff --git a/examples/scala/src/main/scala/com/xebia/functional/xef/scala/auto/Weather.scala b/examples/scala/src/main/scala/com/xebia/functional/xef/scala/auto/Weather.scala index afc842a2b..453700db7 100644 --- a/examples/scala/src/main/scala/com/xebia/functional/xef/scala/auto/Weather.scala +++ b/examples/scala/src/main/scala/com/xebia/functional/xef/scala/auto/Weather.scala @@ -1,7 +1,7 @@ -package com.xebia.functional.xef.scala.auto +package com.xebia.functional.xef.scala.conversation -import com.xebia.functional.xef.scala.auto.* -import com.xebia.functional.xef.auto.llm.openai.OpenAI +import com.xebia.functional.xef.scala.conversation.* +import com.xebia.functional.xef.conversation.llm.openai.OpenAI import com.xebia.functional.xef.reasoning.serpapi.Search import com.xebia.functional.xef.prompt.Prompt diff --git a/gpt4all-kotlin/src/jvmMain/kotlin/com/xebia/functional/gpt4all/Conversation.kt b/gpt4all-kotlin/src/jvmMain/kotlin/com/xebia/functional/gpt4all/Conversation.kt index 204cb0a22..854228a59 100644 --- a/gpt4all-kotlin/src/jvmMain/kotlin/com/xebia/functional/gpt4all/Conversation.kt +++ b/gpt4all-kotlin/src/jvmMain/kotlin/com/xebia/functional/gpt4all/Conversation.kt @@ -1,8 +1,8 @@ package com.xebia.functional.gpt4all -import com.xebia.functional.xef.auto.Conversation -import com.xebia.functional.xef.vectorstores.LocalVectorStore -import com.xebia.functional.xef.vectorstores.VectorStore +import com.xebia.functional.xef.conversation.Conversation +import com.xebia.functional.xef.store.LocalVectorStore +import com.xebia.functional.xef.store.VectorStore suspend inline fun conversation( store: VectorStore = LocalVectorStore(HuggingFaceLocalEmbeddings.DEFAULT), diff --git a/gpt4all-kotlin/src/jvmMain/kotlin/com/xebia/functional/gpt4all/GPT4All.kt b/gpt4all-kotlin/src/jvmMain/kotlin/com/xebia/functional/gpt4all/GPT4All.kt index 5943122ad..ce1aeef2a 100644 --- a/gpt4all-kotlin/src/jvmMain/kotlin/com/xebia/functional/gpt4all/GPT4All.kt +++ b/gpt4all-kotlin/src/jvmMain/kotlin/com/xebia/functional/gpt4all/GPT4All.kt @@ -5,8 +5,8 @@ import ai.djl.training.util.ProgressBar import com.hexadevlabs.gpt4all.LLModel import com.xebia.functional.tokenizer.EncodingType import com.xebia.functional.tokenizer.ModelType -import com.xebia.functional.xef.auto.Conversation -import com.xebia.functional.xef.auto.PlatformConversation +import com.xebia.functional.xef.conversation.Conversation +import com.xebia.functional.xef.conversation.PlatformConversation import com.xebia.functional.xef.llm.Chat import com.xebia.functional.xef.llm.Completion import com.xebia.functional.xef.llm.models.chat.* @@ -14,8 +14,8 @@ import com.xebia.functional.xef.llm.models.text.CompletionChoice import com.xebia.functional.xef.llm.models.text.CompletionRequest import com.xebia.functional.xef.llm.models.text.CompletionResult import com.xebia.functional.xef.llm.models.usage.Usage -import com.xebia.functional.xef.vectorstores.LocalVectorStore -import com.xebia.functional.xef.vectorstores.VectorStore +import com.xebia.functional.xef.store.LocalVectorStore +import com.xebia.functional.xef.store.VectorStore import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.channels.Channel import kotlinx.coroutines.channels.Channel.Factory.UNLIMITED diff --git a/integrations/gcp/src/commonMain/kotlin/com/xebia/functional/xef/gcp/GcpClient.kt b/integrations/gcp/src/commonMain/kotlin/com/xebia/functional/xef/gcp/GcpClient.kt index cb36c6876..85f1dfb60 100644 --- a/integrations/gcp/src/commonMain/kotlin/com/xebia/functional/xef/gcp/GcpClient.kt +++ b/integrations/gcp/src/commonMain/kotlin/com/xebia/functional/xef/gcp/GcpClient.kt @@ -1,8 +1,8 @@ package com.xebia.functional.xef.gcp import com.xebia.functional.xef.AIError -import com.xebia.functional.xef.auto.AutoClose -import com.xebia.functional.xef.auto.autoClose +import com.xebia.functional.xef.conversation.AutoClose +import com.xebia.functional.xef.conversation.autoClose import io.ktor.client.HttpClient import io.ktor.client.call.body import io.ktor.client.plugins.* diff --git a/integrations/lucene/src/main/kotlin/com/xebia/functional/xef/vectorstores/Lucene.kt b/integrations/lucene/src/main/kotlin/com/xebia/functional/xef/store/Lucene.kt similarity index 99% rename from integrations/lucene/src/main/kotlin/com/xebia/functional/xef/vectorstores/Lucene.kt rename to integrations/lucene/src/main/kotlin/com/xebia/functional/xef/store/Lucene.kt index a50e8902f..1bba3de5e 100644 --- a/integrations/lucene/src/main/kotlin/com/xebia/functional/xef/vectorstores/Lucene.kt +++ b/integrations/lucene/src/main/kotlin/com/xebia/functional/xef/store/Lucene.kt @@ -1,4 +1,4 @@ -package com.xebia.functional.xef.vectorstores +package com.xebia.functional.xef.store import com.xebia.functional.xef.embeddings.Embedding import com.xebia.functional.xef.embeddings.Embeddings diff --git a/integrations/postgresql/src/main/kotlin/com/xebia/functional/xef/vectorstores/PostgreSQLVectorStore.kt b/integrations/postgresql/src/main/kotlin/com/xebia/functional/xef/store/PostgreSQLVectorStore.kt similarity index 97% rename from integrations/postgresql/src/main/kotlin/com/xebia/functional/xef/vectorstores/PostgreSQLVectorStore.kt rename to integrations/postgresql/src/main/kotlin/com/xebia/functional/xef/store/PostgreSQLVectorStore.kt index c6bdf6f7f..37adf7f2b 100644 --- a/integrations/postgresql/src/main/kotlin/com/xebia/functional/xef/vectorstores/PostgreSQLVectorStore.kt +++ b/integrations/postgresql/src/main/kotlin/com/xebia/functional/xef/store/PostgreSQLVectorStore.kt @@ -1,11 +1,11 @@ -package com.xebia.functional.xef.vectorstores +package com.xebia.functional.xef.store import com.xebia.functional.xef.embeddings.Embedding import com.xebia.functional.xef.embeddings.Embeddings import com.xebia.functional.xef.llm.models.chat.Message import com.xebia.functional.xef.llm.models.chat.Role import com.xebia.functional.xef.llm.models.embeddings.RequestConfig -import com.xebia.functional.xef.vectorstores.postgresql.* +import com.xebia.functional.xef.store.postgresql.* import kotlinx.uuid.UUID import kotlinx.uuid.generateUUID import javax.sql.DataSource diff --git a/integrations/postgresql/src/main/kotlin/com/xebia/functional/xef/vectorstores/migrations/PsqlVectorStoreConfig.kt b/integrations/postgresql/src/main/kotlin/com/xebia/functional/xef/store/migrations/PsqlVectorStoreConfig.kt similarity index 95% rename from integrations/postgresql/src/main/kotlin/com/xebia/functional/xef/vectorstores/migrations/PsqlVectorStoreConfig.kt rename to integrations/postgresql/src/main/kotlin/com/xebia/functional/xef/store/migrations/PsqlVectorStoreConfig.kt index f4b42c234..c8a8d10ce 100644 --- a/integrations/postgresql/src/main/kotlin/com/xebia/functional/xef/vectorstores/migrations/PsqlVectorStoreConfig.kt +++ b/integrations/postgresql/src/main/kotlin/com/xebia/functional/xef/store/migrations/PsqlVectorStoreConfig.kt @@ -1,4 +1,4 @@ -package com.xebia.functional.xef.vectorstores.migrations +package com.xebia.functional.xef.store.migrations import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.withContext diff --git a/integrations/postgresql/src/main/kotlin/com/xebia/functional/xef/vectorstores/postgresql/JDBCSyntax.kt b/integrations/postgresql/src/main/kotlin/com/xebia/functional/xef/store/postgresql/JDBCSyntax.kt similarity index 98% rename from integrations/postgresql/src/main/kotlin/com/xebia/functional/xef/vectorstores/postgresql/JDBCSyntax.kt rename to integrations/postgresql/src/main/kotlin/com/xebia/functional/xef/store/postgresql/JDBCSyntax.kt index 01de950a8..8b291cc98 100644 --- a/integrations/postgresql/src/main/kotlin/com/xebia/functional/xef/vectorstores/postgresql/JDBCSyntax.kt +++ b/integrations/postgresql/src/main/kotlin/com/xebia/functional/xef/store/postgresql/JDBCSyntax.kt @@ -1,4 +1,4 @@ -package com.xebia.functional.xef.vectorstores.postgresql +package com.xebia.functional.xef.store.postgresql import arrow.core.raise.NullableRaise import arrow.core.raise.nullable diff --git a/integrations/postgresql/src/main/kotlin/com/xebia/functional/xef/vectorstores/postgresql/postgres.kt b/integrations/postgresql/src/main/kotlin/com/xebia/functional/xef/store/postgresql/postgres.kt similarity index 98% rename from integrations/postgresql/src/main/kotlin/com/xebia/functional/xef/vectorstores/postgresql/postgres.kt rename to integrations/postgresql/src/main/kotlin/com/xebia/functional/xef/store/postgresql/postgres.kt index 206671cbd..f05192e96 100644 --- a/integrations/postgresql/src/main/kotlin/com/xebia/functional/xef/vectorstores/postgresql/postgres.kt +++ b/integrations/postgresql/src/main/kotlin/com/xebia/functional/xef/store/postgresql/postgres.kt @@ -1,4 +1,4 @@ -package com.xebia.functional.xef.vectorstores.postgresql +package com.xebia.functional.xef.store.postgresql import kotlinx.uuid.UUID diff --git a/integrations/postgresql/src/test/kotlin/xef/PGVectorStoreSpec.kt b/integrations/postgresql/src/test/kotlin/xef/PGVectorStoreSpec.kt index c5c7a3650..8c37966b5 100644 --- a/integrations/postgresql/src/test/kotlin/xef/PGVectorStoreSpec.kt +++ b/integrations/postgresql/src/test/kotlin/xef/PGVectorStoreSpec.kt @@ -6,10 +6,10 @@ import com.xebia.functional.xef.llm.models.chat.Message import com.xebia.functional.xef.llm.models.chat.Role import com.xebia.functional.xef.llm.models.embeddings.EmbeddingModel import com.xebia.functional.xef.llm.models.embeddings.RequestConfig -import com.xebia.functional.xef.vectorstores.ConversationId -import com.xebia.functional.xef.vectorstores.Memory -import com.xebia.functional.xef.vectorstores.PGVectorStore -import com.xebia.functional.xef.vectorstores.postgresql.PGDistanceStrategy +import com.xebia.functional.xef.store.ConversationId +import com.xebia.functional.xef.store.Memory +import com.xebia.functional.xef.store.PGVectorStore +import com.xebia.functional.xef.store.postgresql.PGDistanceStrategy import com.zaxxer.hikari.HikariConfig import com.zaxxer.hikari.HikariDataSource import io.kotest.core.extensions.install diff --git a/integrations/sql/src/main/kotlin/com/xebia/functional/xef/sql/SQL.kt b/integrations/sql/src/main/kotlin/com/xebia/functional/xef/sql/SQL.kt index cc8cd140e..486f1fedf 100644 --- a/integrations/sql/src/main/kotlin/com/xebia/functional/xef/sql/SQL.kt +++ b/integrations/sql/src/main/kotlin/com/xebia/functional/xef/sql/SQL.kt @@ -1,7 +1,7 @@ package com.xebia.functional.xef.sql -import com.xebia.functional.xef.auto.Conversation -import com.xebia.functional.xef.auto.AiDsl +import com.xebia.functional.xef.conversation.Conversation +import com.xebia.functional.xef.conversation.AiDsl import com.xebia.functional.xef.prompt.Prompt import com.xebia.functional.xef.sql.jdbc.JdbcConfig import com.xebia.functional.xef.textsplitters.TokenTextSplitter diff --git a/kotlin-loom/build.gradle.kts b/kotlin-loom/build.gradle.kts deleted file mode 100644 index d83f2e753..000000000 --- a/kotlin-loom/build.gradle.kts +++ /dev/null @@ -1,67 +0,0 @@ -plugins { - id(libs.plugins.kotlin.jvm.get().pluginId) - alias(libs.plugins.spotless) - alias(libs.plugins.arrow.gradle.publish) - alias(libs.plugins.semver.gradle) - alias(libs.plugins.detekt) -} - -dependencies { detektPlugins(project(":detekt-rules")) } - -detekt { - toolVersion = "1.23.1" - source = files("src/main/kotlin") - config.setFrom("../config/detekt/detekt.yml") - autoCorrect = true -} - -repositories { mavenCentral() } - -sourceSets { - main { java.srcDirs("src/main/kotlin") } - test { java.srcDirs("src/test/kotlin") } -} - -java { - sourceCompatibility = JavaVersion.VERSION_19 - targetCompatibility = JavaVersion.VERSION_19 - toolchain { languageVersion = JavaLanguageVersion.of(19) } -} - -dependencies { - implementation(libs.kotlinx.coroutines) - testImplementation(kotlin("test")) - testImplementation(libs.assertj) -} - -tasks.withType().configureEach { - options.compilerArgs.addAll( - listOfNotNull("--enable-preview", "--add-modules", "jdk.incubator.concurrent") - ) -} - -tasks.withType().configureEach { - useJUnitPlatform() - jvmArgs("--enable-preview", "--add-modules", "jdk.incubator.concurrent") - testLogging { events("passed", "skipped", "failed") } -} - -spotless { - java { palantirJavaFormat() } - kotlin { - target("**/*.kt") - ktfmt().googleStyle() - } -} - -tasks { - withType().configureEach { - dependsOn(":detekt-rules:assemble") - autoCorrect = true - } - named("detekt") { - dependsOn(":detekt-rules:assemble") - getByName("build").dependsOn(this) - } - withType { dependsOn(withType()) } -} diff --git a/kotlin-loom/src/main/kotlin/com/xebia/functional/loom/LoomAdapter.java b/kotlin-loom/src/main/kotlin/com/xebia/functional/loom/LoomAdapter.java deleted file mode 100644 index 06b489984..000000000 --- a/kotlin-loom/src/main/kotlin/com/xebia/functional/loom/LoomAdapter.java +++ /dev/null @@ -1,154 +0,0 @@ -package com.xebia.functional.loom; - -import java.util.function.BiFunction; -import kotlin.coroutines.Continuation; -import kotlin.jvm.functions.Function1; -import kotlin.jvm.functions.Function10; -import kotlin.jvm.functions.Function2; -import kotlin.jvm.functions.Function3; -import kotlin.jvm.functions.Function4; -import kotlin.jvm.functions.Function5; -import kotlin.jvm.functions.Function6; -import kotlin.jvm.functions.Function7; -import kotlin.jvm.functions.Function8; -import kotlin.jvm.functions.Function9; - -@SuppressWarnings("unused") -public class LoomAdapter { - private LoomAdapter() {} - - public static Output apply(Function1, Object> transform) - throws InterruptedException { - return LoomRunner.run((scope, dispatcher, cont) -> transform.invoke(cont)); - } - - public static Output apply( - Input input, BiFunction, Object> transform) - throws InterruptedException { - return LoomRunner.run((scope, dispatcher, cont) -> transform.apply(input, cont)); - } - - public static Output apply( - Input input, Function2, Object> transform) throws InterruptedException { - return LoomRunner.run((scope, dispatcher, cont) -> transform.invoke(input, cont)); - } - - public static Output apply( - Input1 input1, Input2 input2, Function3, Object> transform) - throws InterruptedException { - return LoomRunner.run((scope, dispatcher, cont) -> transform.invoke(input1, input2, cont)); - } - - public static Output apply( - Input1 input1, - Input2 input2, - Input3 input3, - Function4, Object> transform) - throws InterruptedException { - return LoomRunner.run((scope, dispatcher, cont) -> transform.invoke(input1, input2, input3, cont)); - } - - public static Output apply( - Input1 input1, - Input2 input2, - Input3 input3, - Input4 input4, - Function5, Object> transform) - throws InterruptedException { - return LoomRunner.run((scope, dispatcher, cont) -> transform.invoke(input1, input2, input3, input4, cont)); - } - - public static Output apply( - Input1 input1, - Input2 input2, - Input3 input3, - Input4 input4, - Input5 input5, - Function6, Object> transform) - throws InterruptedException { - return LoomRunner.run( - (scope, dispatcher, cont) -> transform.invoke(input1, input2, input3, input4, input5, cont)); - } - - public static Output apply( - Input1 input1, - Input2 input2, - Input3 input3, - Input4 input4, - Input5 input5, - Input6 input6, - Function7, Object> transform) - throws InterruptedException { - return LoomRunner.run( - (scope, dispatcher, cont) -> transform.invoke(input1, input2, input3, input4, input5, input6, cont)); - } - - public static Output apply( - Input1 input1, - Input2 input2, - Input3 input3, - Input4 input4, - Input5 input5, - Input6 input6, - Input7 input7, - Function8, Object> - transform) - throws InterruptedException { - return LoomRunner.run((scope, dispatcher, cont) -> - transform.invoke(input1, input2, input3, input4, input5, input6, input7, cont)); - } - - public static Output apply( - Input1 input1, - Input2 input2, - Input3 input3, - Input4 input4, - Input5 input5, - Input6 input6, - Input7 input7, - Input8 input8, - Function9< - Input1, - Input2, - Input3, - Input4, - Input5, - Input6, - Input7, - Input8, - Continuation, - Object> - transform) - throws InterruptedException { - return LoomRunner.run((scope, dispatcher, cont) -> - transform.invoke(input1, input2, input3, input4, input5, input6, input7, input8, cont)); - } - - public static Output apply( - Input1 input1, - Input2 input2, - Input3 input3, - Input4 input4, - Input5 input5, - Input6 input6, - Input7 input7, - Input8 input8, - Input9 input9, - Function10< - Input1, - Input2, - Input3, - Input4, - Input5, - Input6, - Input7, - Input8, - Input9, - Continuation, - Object> - transform) - throws InterruptedException { - return LoomRunner.run((scope, dispatcher, cont) -> - transform.invoke(input1, input2, input3, input4, input5, input6, input7, input8, input9, cont)); - } -} diff --git a/kotlin-loom/src/main/kotlin/com/xebia/functional/loom/LoomRunner.kt b/kotlin-loom/src/main/kotlin/com/xebia/functional/loom/LoomRunner.kt deleted file mode 100644 index 9c62ac09b..000000000 --- a/kotlin-loom/src/main/kotlin/com/xebia/functional/loom/LoomRunner.kt +++ /dev/null @@ -1,22 +0,0 @@ -@file:JvmName("LoomRunner") - -package com.xebia.functional.loom - -import java.util.concurrent.Executors -import kotlinx.coroutines.CoroutineDispatcher -import kotlinx.coroutines.CoroutineScope -import kotlinx.coroutines.asCoroutineDispatcher -import kotlinx.coroutines.runBlocking - -/** - * A Loom based [runBlocking], this method will call [runBlocking] using a Loom based dispatcher. - * - * **Note**: This method **should only be used from another VirtualThread**, if called from a - * platform thread it will still block the current thread. - */ -@Throws(InterruptedException::class) -@JvmName("run") -fun runLoom(block: suspend CoroutineScope.(dispatcher: CoroutineDispatcher) -> A): A = - Executors.newVirtualThreadPerTaskExecutor().asCoroutineDispatcher().use { loom -> - runBlocking(context = loom) { block(loom) } - } diff --git a/kotlin-loom/src/test/kotlin/com/xebia/functional/loom/ExampleTest.java b/kotlin-loom/src/test/kotlin/com/xebia/functional/loom/ExampleTest.java deleted file mode 100644 index a5bec2b47..000000000 --- a/kotlin-loom/src/test/kotlin/com/xebia/functional/loom/ExampleTest.java +++ /dev/null @@ -1,53 +0,0 @@ -package com.xebia.functional.loom; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.api.Assertions.assertThatThrownBy; - -import java.util.concurrent.*; -import org.junit.jupiter.api.Test; - -public class ExampleTest { - - @Test - public void isCancelled() throws InterruptedException { - CompletableFuture completable = new CompletableFuture<>(); - Thread t = Thread.ofVirtual().start(() -> { - try { - LoomAdapter.apply(TestFunctions.forever(completable)); - } catch (InterruptedException e) { - // do nothing - } - }); - Thread.sleep(1000); - t.interrupt(); - Throwable exitCase = completable.join(); - assertThat(exitCase).isInstanceOf(CancellationException.class); - } - - @Test - public void isCompleted() throws InterruptedException { - int result = LoomAdapter.apply(TestFunctions.completed(1)); - assertThat(result).isEqualTo(1); - } - - @Test - public void isFailure() { - assertThatThrownBy(() -> { - LoomAdapter.apply(TestFunctions.failure(new RuntimeException("Boom!"))); - }) - .isInstanceOf(RuntimeException.class) - .hasMessage("Boom!"); - } - - @Test - public void arity1() throws InterruptedException { - int result = LoomAdapter.apply(1, TestFunctions.completed()); - assertThat(result).isEqualTo(1); - } - - @Test - public void arity2() throws InterruptedException { - int result = LoomAdapter.apply(1, 2, TestFunctions.combine(Integer::sum)); - assertThat(result).isEqualTo(3); - } -} diff --git a/kotlin-loom/src/test/kotlin/com/xebia/functional/loom/TestFunctions.kt b/kotlin-loom/src/test/kotlin/com/xebia/functional/loom/TestFunctions.kt deleted file mode 100644 index 47e1afaff..000000000 --- a/kotlin-loom/src/test/kotlin/com/xebia/functional/loom/TestFunctions.kt +++ /dev/null @@ -1,45 +0,0 @@ -package com.xebia.functional.loom - -import java.util.concurrent.CancellationException -import java.util.concurrent.CompletableFuture -import kotlinx.coroutines.delay -import kotlinx.coroutines.suspendCancellableCoroutine - -object TestFunctions { - - @JvmStatic - fun completed(a: A): suspend () -> A = { - delay(1) // Do some suspension - a - } - - @JvmStatic - fun completed(): suspend (A) -> A = { a -> - delay(1) // Do some suspension - a - } - - @JvmStatic - fun combine(combine: (A, A) -> A): suspend (A, A) -> A = { a, b -> - delay(1) // Do some suspension - combine(a, b) - } - - @JvmStatic - fun failure(e: E): suspend () -> A = { - delay(1) // Do some suspension - throw e - } - - /** - * A method that takes a [CompletableFuture] that will be completed with an [Throwable]. Which is - * [CancellationException] in case of cancellation, or [Throwable] in case of error, and otherwise - * `null`. - */ - @JvmStatic - fun forever(completableFuture: CompletableFuture): suspend () -> Unit = { - suspendCancellableCoroutine { cont -> - cont.invokeOnCancellation { t -> completableFuture.complete(t) } - } - } -} diff --git a/kotlin/src/commonMain/kotlin/com/xebia/functional/xef/auto/DSLExtensions.kt b/kotlin/src/commonMain/kotlin/com/xebia/functional/xef/conversation/DSLExtensions.kt similarity index 79% rename from kotlin/src/commonMain/kotlin/com/xebia/functional/xef/auto/DSLExtensions.kt rename to kotlin/src/commonMain/kotlin/com/xebia/functional/xef/conversation/DSLExtensions.kt index f97d48049..1c453201b 100644 --- a/kotlin/src/commonMain/kotlin/com/xebia/functional/xef/auto/DSLExtensions.kt +++ b/kotlin/src/commonMain/kotlin/com/xebia/functional/xef/conversation/DSLExtensions.kt @@ -1,8 +1,8 @@ -package com.xebia.functional.xef.auto +package com.xebia.functional.xef.conversation import com.xebia.functional.xef.embeddings.Embeddings -import com.xebia.functional.xef.vectorstores.LocalVectorStore -import com.xebia.functional.xef.vectorstores.VectorStore +import com.xebia.functional.xef.store.LocalVectorStore +import com.xebia.functional.xef.store.VectorStore /** * Executes a conversation with the given embeddings and vector store. diff --git a/openai/src/commonMain/kotlin/com/xebia/functional/xef/auto/llm/openai/DeserializerLLMAgent.kt b/openai/src/commonMain/kotlin/com/xebia/functional/xef/conversation/llm/openai/DeserializerLLMAgent.kt similarity index 82% rename from openai/src/commonMain/kotlin/com/xebia/functional/xef/auto/llm/openai/DeserializerLLMAgent.kt rename to openai/src/commonMain/kotlin/com/xebia/functional/xef/conversation/llm/openai/DeserializerLLMAgent.kt index 4a2f4b886..2b0133efc 100644 --- a/openai/src/commonMain/kotlin/com/xebia/functional/xef/auto/llm/openai/DeserializerLLMAgent.kt +++ b/openai/src/commonMain/kotlin/com/xebia/functional/xef/conversation/llm/openai/DeserializerLLMAgent.kt @@ -1,7 +1,7 @@ -package com.xebia.functional.xef.auto.llm.openai +package com.xebia.functional.xef.conversation.llm.openai -import com.xebia.functional.xef.auto.AiDsl -import com.xebia.functional.xef.auto.Conversation +import com.xebia.functional.xef.conversation.AiDsl +import com.xebia.functional.xef.conversation.Conversation import com.xebia.functional.xef.llm.ChatWithFunctions import com.xebia.functional.xef.prompt.Prompt import kotlinx.serialization.SerializationException diff --git a/openai/src/commonMain/kotlin/com/xebia/functional/xef/auto/llm/openai/OpenAI.kt b/openai/src/commonMain/kotlin/com/xebia/functional/xef/conversation/llm/openai/OpenAI.kt similarity index 90% rename from openai/src/commonMain/kotlin/com/xebia/functional/xef/auto/llm/openai/OpenAI.kt rename to openai/src/commonMain/kotlin/com/xebia/functional/xef/conversation/llm/openai/OpenAI.kt index f8b4d69ca..9a2bfaf71 100644 --- a/openai/src/commonMain/kotlin/com/xebia/functional/xef/auto/llm/openai/OpenAI.kt +++ b/openai/src/commonMain/kotlin/com/xebia/functional/xef/conversation/llm/openai/OpenAI.kt @@ -1,15 +1,15 @@ -package com.xebia.functional.xef.auto.llm.openai +package com.xebia.functional.xef.conversation.llm.openai import arrow.core.nonEmptyListOf import com.xebia.functional.tokenizer.ModelType import com.xebia.functional.xef.AIError -import com.xebia.functional.xef.auto.AutoClose -import com.xebia.functional.xef.auto.Conversation -import com.xebia.functional.xef.auto.PlatformConversation -import com.xebia.functional.xef.auto.autoClose +import com.xebia.functional.xef.conversation.AutoClose +import com.xebia.functional.xef.conversation.Conversation +import com.xebia.functional.xef.conversation.PlatformConversation +import com.xebia.functional.xef.conversation.autoClose import com.xebia.functional.xef.env.getenv -import com.xebia.functional.xef.vectorstores.LocalVectorStore -import com.xebia.functional.xef.vectorstores.VectorStore +import com.xebia.functional.xef.store.LocalVectorStore +import com.xebia.functional.xef.store.VectorStore import kotlin.jvm.JvmField import kotlin.jvm.JvmOverloads import kotlin.jvm.JvmStatic diff --git a/openai/src/commonMain/kotlin/com/xebia/functional/xef/auto/llm/openai/OpenAIClient.kt b/openai/src/commonMain/kotlin/com/xebia/functional/xef/conversation/llm/openai/OpenAIClient.kt similarity index 99% rename from openai/src/commonMain/kotlin/com/xebia/functional/xef/auto/llm/openai/OpenAIClient.kt rename to openai/src/commonMain/kotlin/com/xebia/functional/xef/conversation/llm/openai/OpenAIClient.kt index 7a5075994..bf0f8ef07 100644 --- a/openai/src/commonMain/kotlin/com/xebia/functional/xef/auto/llm/openai/OpenAIClient.kt +++ b/openai/src/commonMain/kotlin/com/xebia/functional/xef/conversation/llm/openai/OpenAIClient.kt @@ -1,4 +1,4 @@ -package com.xebia.functional.xef.auto.llm.openai +package com.xebia.functional.xef.conversation.llm.openai import com.aallam.openai.api.BetaOpenAI import com.aallam.openai.api.chat.* diff --git a/openai/src/commonMain/kotlin/com/xebia/functional/xef/auto/llm/openai/OpenAIConversation.kt b/openai/src/commonMain/kotlin/com/xebia/functional/xef/conversation/llm/openai/OpenAIConversation.kt similarity index 61% rename from openai/src/commonMain/kotlin/com/xebia/functional/xef/auto/llm/openai/OpenAIConversation.kt rename to openai/src/commonMain/kotlin/com/xebia/functional/xef/conversation/llm/openai/OpenAIConversation.kt index 0a924aab3..5d4620394 100644 --- a/openai/src/commonMain/kotlin/com/xebia/functional/xef/auto/llm/openai/OpenAIConversation.kt +++ b/openai/src/commonMain/kotlin/com/xebia/functional/xef/conversation/llm/openai/OpenAIConversation.kt @@ -1,6 +1,6 @@ -package com.xebia.functional.xef.auto.llm.openai +package com.xebia.functional.xef.conversation.llm.openai -import com.xebia.functional.xef.auto.PlatformConversation +import com.xebia.functional.xef.conversation.PlatformConversation import kotlin.coroutines.cancellation.CancellationException fun interface OpenAIConversation { diff --git a/openai/src/commonMain/kotlin/com/xebia/functional/xef/auto/llm/openai/OpenAIEmbeddings.kt b/openai/src/commonMain/kotlin/com/xebia/functional/xef/conversation/llm/openai/OpenAIEmbeddings.kt similarity index 95% rename from openai/src/commonMain/kotlin/com/xebia/functional/xef/auto/llm/openai/OpenAIEmbeddings.kt rename to openai/src/commonMain/kotlin/com/xebia/functional/xef/conversation/llm/openai/OpenAIEmbeddings.kt index 7be6c4355..9c9ac3926 100644 --- a/openai/src/commonMain/kotlin/com/xebia/functional/xef/auto/llm/openai/OpenAIEmbeddings.kt +++ b/openai/src/commonMain/kotlin/com/xebia/functional/xef/conversation/llm/openai/OpenAIEmbeddings.kt @@ -1,4 +1,4 @@ -package com.xebia.functional.xef.auto.llm.openai +package com.xebia.functional.xef.conversation.llm.openai import arrow.fx.coroutines.parMap import com.xebia.functional.xef.embeddings.Embedding diff --git a/openai/src/commonMain/kotlin/com/xebia/functional/xef/auto/llm/openai/OpenAIScopeExtensions.kt b/openai/src/commonMain/kotlin/com/xebia/functional/xef/conversation/llm/openai/OpenAIScopeExtensions.kt similarity index 85% rename from openai/src/commonMain/kotlin/com/xebia/functional/xef/auto/llm/openai/OpenAIScopeExtensions.kt rename to openai/src/commonMain/kotlin/com/xebia/functional/xef/conversation/llm/openai/OpenAIScopeExtensions.kt index 170f2ccae..6ebcadeb7 100644 --- a/openai/src/commonMain/kotlin/com/xebia/functional/xef/auto/llm/openai/OpenAIScopeExtensions.kt +++ b/openai/src/commonMain/kotlin/com/xebia/functional/xef/conversation/llm/openai/OpenAIScopeExtensions.kt @@ -1,7 +1,7 @@ -package com.xebia.functional.xef.auto.llm.openai +package com.xebia.functional.xef.conversation.llm.openai -import com.xebia.functional.xef.auto.AiDsl -import com.xebia.functional.xef.auto.Conversation +import com.xebia.functional.xef.conversation.AiDsl +import com.xebia.functional.xef.conversation.Conversation import com.xebia.functional.xef.llm.Chat import com.xebia.functional.xef.llm.ChatWithFunctions import com.xebia.functional.xef.prompt.Prompt diff --git a/reasoning/src/commonMain/kotlin/com/xebia/functional/xef/reasoning/code/Code.kt b/reasoning/src/commonMain/kotlin/com/xebia/functional/xef/reasoning/code/Code.kt index c128449b0..043c0a097 100644 --- a/reasoning/src/commonMain/kotlin/com/xebia/functional/xef/reasoning/code/Code.kt +++ b/reasoning/src/commonMain/kotlin/com/xebia/functional/xef/reasoning/code/Code.kt @@ -1,6 +1,6 @@ package com.xebia.functional.xef.reasoning.code -import com.xebia.functional.xef.auto.Conversation +import com.xebia.functional.xef.conversation.Conversation import com.xebia.functional.xef.llm.Chat import com.xebia.functional.xef.llm.ChatWithFunctions import com.xebia.functional.xef.reasoning.tools.LLMTool diff --git a/reasoning/src/commonMain/kotlin/com/xebia/functional/xef/reasoning/code/DiffSummary.kt b/reasoning/src/commonMain/kotlin/com/xebia/functional/xef/reasoning/code/DiffSummary.kt index 3f671239e..0ee8f196d 100644 --- a/reasoning/src/commonMain/kotlin/com/xebia/functional/xef/reasoning/code/DiffSummary.kt +++ b/reasoning/src/commonMain/kotlin/com/xebia/functional/xef/reasoning/code/DiffSummary.kt @@ -1,8 +1,8 @@ package com.xebia.functional.xef.reasoning.code -import com.xebia.functional.xef.auto.AutoClose -import com.xebia.functional.xef.auto.Conversation -import com.xebia.functional.xef.auto.autoClose +import com.xebia.functional.xef.conversation.AutoClose +import com.xebia.functional.xef.conversation.Conversation +import com.xebia.functional.xef.conversation.autoClose import com.xebia.functional.xef.llm.Chat import com.xebia.functional.xef.llm.ChatWithFunctions import com.xebia.functional.xef.prompt.Prompt diff --git a/reasoning/src/commonMain/kotlin/com/xebia/functional/xef/reasoning/internals/CallModel.kt b/reasoning/src/commonMain/kotlin/com/xebia/functional/xef/reasoning/internals/CallModel.kt index 6065b6f15..47727b4cf 100644 --- a/reasoning/src/commonMain/kotlin/com/xebia/functional/xef/reasoning/internals/CallModel.kt +++ b/reasoning/src/commonMain/kotlin/com/xebia/functional/xef/reasoning/internals/CallModel.kt @@ -1,6 +1,6 @@ package com.xebia.functional.xef.reasoning.internals -import com.xebia.functional.xef.auto.Conversation +import com.xebia.functional.xef.conversation.Conversation import com.xebia.functional.xef.llm.Chat import com.xebia.functional.xef.prompt.Prompt diff --git a/reasoning/src/commonMain/kotlin/com/xebia/functional/xef/reasoning/serpapi/Search.kt b/reasoning/src/commonMain/kotlin/com/xebia/functional/xef/reasoning/serpapi/Search.kt index 5657b2498..dddf77b92 100644 --- a/reasoning/src/commonMain/kotlin/com/xebia/functional/xef/reasoning/serpapi/Search.kt +++ b/reasoning/src/commonMain/kotlin/com/xebia/functional/xef/reasoning/serpapi/Search.kt @@ -1,6 +1,6 @@ package com.xebia.functional.xef.reasoning.serpapi -import com.xebia.functional.xef.auto.Conversation +import com.xebia.functional.xef.conversation.Conversation import com.xebia.functional.xef.llm.Chat import kotlin.jvm.JvmOverloads diff --git a/reasoning/src/commonMain/kotlin/com/xebia/functional/xef/reasoning/serpapi/SearchTool.kt b/reasoning/src/commonMain/kotlin/com/xebia/functional/xef/reasoning/serpapi/SearchTool.kt index d7c91ecb7..4c80ce5ea 100644 --- a/reasoning/src/commonMain/kotlin/com/xebia/functional/xef/reasoning/serpapi/SearchTool.kt +++ b/reasoning/src/commonMain/kotlin/com/xebia/functional/xef/reasoning/serpapi/SearchTool.kt @@ -1,6 +1,6 @@ package com.xebia.functional.xef.reasoning.serpapi -import com.xebia.functional.xef.auto.Conversation +import com.xebia.functional.xef.conversation.Conversation import com.xebia.functional.xef.llm.Chat import com.xebia.functional.xef.prompt.Prompt import com.xebia.functional.xef.prompt.templates.assistant diff --git a/reasoning/src/commonMain/kotlin/com/xebia/functional/xef/reasoning/serpapi/SerpApiClient.kt b/reasoning/src/commonMain/kotlin/com/xebia/functional/xef/reasoning/serpapi/SerpApiClient.kt index 140ee3021..0db08bc78 100644 --- a/reasoning/src/commonMain/kotlin/com/xebia/functional/xef/reasoning/serpapi/SerpApiClient.kt +++ b/reasoning/src/commonMain/kotlin/com/xebia/functional/xef/reasoning/serpapi/SerpApiClient.kt @@ -1,7 +1,7 @@ package com.xebia.functional.xef.reasoning.serpapi -import com.xebia.functional.xef.auto.AutoClose -import com.xebia.functional.xef.auto.autoClose +import com.xebia.functional.xef.conversation.AutoClose +import com.xebia.functional.xef.conversation.autoClose import com.xebia.functional.xef.env.getenv import io.ktor.client.* import io.ktor.client.call.* diff --git a/reasoning/src/commonMain/kotlin/com/xebia/functional/xef/reasoning/text/Text.kt b/reasoning/src/commonMain/kotlin/com/xebia/functional/xef/reasoning/text/Text.kt index 53e7ac0bb..3cfc4ec58 100644 --- a/reasoning/src/commonMain/kotlin/com/xebia/functional/xef/reasoning/text/Text.kt +++ b/reasoning/src/commonMain/kotlin/com/xebia/functional/xef/reasoning/text/Text.kt @@ -1,6 +1,6 @@ package com.xebia.functional.xef.reasoning.text -import com.xebia.functional.xef.auto.Conversation +import com.xebia.functional.xef.conversation.Conversation import com.xebia.functional.xef.llm.Chat import com.xebia.functional.xef.reasoning.text.summarize.Summarize import com.xebia.functional.xef.reasoning.tools.LLMTool diff --git a/reasoning/src/commonMain/kotlin/com/xebia/functional/xef/reasoning/text/summarize/Summarize.kt b/reasoning/src/commonMain/kotlin/com/xebia/functional/xef/reasoning/text/summarize/Summarize.kt index 603763f97..757c713c5 100644 --- a/reasoning/src/commonMain/kotlin/com/xebia/functional/xef/reasoning/text/summarize/Summarize.kt +++ b/reasoning/src/commonMain/kotlin/com/xebia/functional/xef/reasoning/text/summarize/Summarize.kt @@ -2,7 +2,7 @@ package com.xebia.functional.xef.reasoning.text.summarize import arrow.fx.coroutines.parMap import com.xebia.functional.tokenizer.truncateText -import com.xebia.functional.xef.auto.Conversation +import com.xebia.functional.xef.conversation.Conversation import com.xebia.functional.xef.llm.Chat import com.xebia.functional.xef.prompt.Prompt import com.xebia.functional.xef.prompt.templates.assistant diff --git a/reasoning/src/commonMain/kotlin/com/xebia/functional/xef/reasoning/tools/ExecutionType.kt b/reasoning/src/commonMain/kotlin/com/xebia/functional/xef/reasoning/tools/ExecutionType.kt index ee3d69e25..2ba26a56e 100644 --- a/reasoning/src/commonMain/kotlin/com/xebia/functional/xef/reasoning/tools/ExecutionType.kt +++ b/reasoning/src/commonMain/kotlin/com/xebia/functional/xef/reasoning/tools/ExecutionType.kt @@ -1,6 +1,6 @@ package com.xebia.functional.xef.reasoning.tools -import com.xebia.functional.xef.auto.Description +import com.xebia.functional.xef.conversation.Description import kotlinx.serialization.Serializable @Serializable diff --git a/reasoning/src/commonMain/kotlin/com/xebia/functional/xef/reasoning/tools/Input.kt b/reasoning/src/commonMain/kotlin/com/xebia/functional/xef/reasoning/tools/Input.kt index 181999365..9eb604b95 100644 --- a/reasoning/src/commonMain/kotlin/com/xebia/functional/xef/reasoning/tools/Input.kt +++ b/reasoning/src/commonMain/kotlin/com/xebia/functional/xef/reasoning/tools/Input.kt @@ -1,6 +1,6 @@ package com.xebia.functional.xef.reasoning.tools -import com.xebia.functional.xef.auto.Description +import com.xebia.functional.xef.conversation.Description import kotlinx.serialization.Serializable @Serializable diff --git a/reasoning/src/commonMain/kotlin/com/xebia/functional/xef/reasoning/tools/LLMTool.kt b/reasoning/src/commonMain/kotlin/com/xebia/functional/xef/reasoning/tools/LLMTool.kt index 8817af4ee..fe7e6a136 100644 --- a/reasoning/src/commonMain/kotlin/com/xebia/functional/xef/reasoning/tools/LLMTool.kt +++ b/reasoning/src/commonMain/kotlin/com/xebia/functional/xef/reasoning/tools/LLMTool.kt @@ -1,6 +1,6 @@ package com.xebia.functional.xef.reasoning.tools -import com.xebia.functional.xef.auto.Conversation +import com.xebia.functional.xef.conversation.Conversation import com.xebia.functional.xef.llm.Chat import com.xebia.functional.xef.prompt.Prompt import com.xebia.functional.xef.prompt.templates.assistant diff --git a/reasoning/src/commonMain/kotlin/com/xebia/functional/xef/reasoning/tools/Output.kt b/reasoning/src/commonMain/kotlin/com/xebia/functional/xef/reasoning/tools/Output.kt index 2b62bc9cc..9d79cf04b 100644 --- a/reasoning/src/commonMain/kotlin/com/xebia/functional/xef/reasoning/tools/Output.kt +++ b/reasoning/src/commonMain/kotlin/com/xebia/functional/xef/reasoning/tools/Output.kt @@ -1,6 +1,6 @@ package com.xebia.functional.xef.reasoning.tools -import com.xebia.functional.xef.auto.Description +import com.xebia.functional.xef.conversation.Description import kotlinx.serialization.Serializable @Serializable diff --git a/reasoning/src/commonMain/kotlin/com/xebia/functional/xef/reasoning/tools/ReActAgent.kt b/reasoning/src/commonMain/kotlin/com/xebia/functional/xef/reasoning/tools/ReActAgent.kt index be56f5367..2656150e2 100644 --- a/reasoning/src/commonMain/kotlin/com/xebia/functional/xef/reasoning/tools/ReActAgent.kt +++ b/reasoning/src/commonMain/kotlin/com/xebia/functional/xef/reasoning/tools/ReActAgent.kt @@ -1,7 +1,7 @@ package com.xebia.functional.xef.reasoning.tools -import com.xebia.functional.xef.auto.Conversation -import com.xebia.functional.xef.auto.Description +import com.xebia.functional.xef.conversation.Conversation +import com.xebia.functional.xef.conversation.Description import com.xebia.functional.xef.llm.ChatWithFunctions import com.xebia.functional.xef.llm.models.chat.Message import com.xebia.functional.xef.prompt.Prompt diff --git a/reasoning/src/commonMain/kotlin/com/xebia/functional/xef/reasoning/tools/ToolExecutionStep.kt b/reasoning/src/commonMain/kotlin/com/xebia/functional/xef/reasoning/tools/ToolExecutionStep.kt index f3f605faf..e05d46789 100644 --- a/reasoning/src/commonMain/kotlin/com/xebia/functional/xef/reasoning/tools/ToolExecutionStep.kt +++ b/reasoning/src/commonMain/kotlin/com/xebia/functional/xef/reasoning/tools/ToolExecutionStep.kt @@ -1,6 +1,6 @@ package com.xebia.functional.xef.reasoning.tools -import com.xebia.functional.xef.auto.Description +import com.xebia.functional.xef.conversation.Description import kotlinx.serialization.Serializable @Serializable diff --git a/reasoning/src/commonMain/kotlin/com/xebia/functional/xef/reasoning/tools/ToolMetadata.kt b/reasoning/src/commonMain/kotlin/com/xebia/functional/xef/reasoning/tools/ToolMetadata.kt index c135db298..69a21a67a 100644 --- a/reasoning/src/commonMain/kotlin/com/xebia/functional/xef/reasoning/tools/ToolMetadata.kt +++ b/reasoning/src/commonMain/kotlin/com/xebia/functional/xef/reasoning/tools/ToolMetadata.kt @@ -1,7 +1,6 @@ package com.xebia.functional.xef.reasoning.tools -import com.xebia.functional.xef.auto.Description -import io.ktor.utils.io.core.* +import com.xebia.functional.xef.conversation.Description import kotlinx.serialization.Serializable @Serializable diff --git a/reasoning/src/commonMain/kotlin/com/xebia/functional/xef/reasoning/tools/ToolSelection.kt b/reasoning/src/commonMain/kotlin/com/xebia/functional/xef/reasoning/tools/ToolSelection.kt index b3f0fc018..35426705f 100644 --- a/reasoning/src/commonMain/kotlin/com/xebia/functional/xef/reasoning/tools/ToolSelection.kt +++ b/reasoning/src/commonMain/kotlin/com/xebia/functional/xef/reasoning/tools/ToolSelection.kt @@ -1,6 +1,6 @@ package com.xebia.functional.xef.reasoning.tools -import com.xebia.functional.xef.auto.Conversation +import com.xebia.functional.xef.conversation.Conversation import com.xebia.functional.xef.llm.ChatWithFunctions import com.xebia.functional.xef.prompt.Prompt import com.xebia.functional.xef.prompt.templates.assistant diff --git a/reasoning/src/commonMain/kotlin/com/xebia/functional/xef/reasoning/tools/ToolSelectionResult.kt b/reasoning/src/commonMain/kotlin/com/xebia/functional/xef/reasoning/tools/ToolSelectionResult.kt index ef27c8b62..90a82674f 100644 --- a/reasoning/src/commonMain/kotlin/com/xebia/functional/xef/reasoning/tools/ToolSelectionResult.kt +++ b/reasoning/src/commonMain/kotlin/com/xebia/functional/xef/reasoning/tools/ToolSelectionResult.kt @@ -1,6 +1,6 @@ package com.xebia.functional.xef.reasoning.tools -import com.xebia.functional.xef.auto.Description +import com.xebia.functional.xef.conversation.Description import kotlinx.serialization.Serializable @Serializable diff --git a/reasoning/src/commonMain/kotlin/com/xebia/functional/xef/reasoning/tools/ToolsExecutionPlan.kt b/reasoning/src/commonMain/kotlin/com/xebia/functional/xef/reasoning/tools/ToolsExecutionPlan.kt index 66ce9a405..8ef3edced 100644 --- a/reasoning/src/commonMain/kotlin/com/xebia/functional/xef/reasoning/tools/ToolsExecutionPlan.kt +++ b/reasoning/src/commonMain/kotlin/com/xebia/functional/xef/reasoning/tools/ToolsExecutionPlan.kt @@ -1,6 +1,6 @@ package com.xebia.functional.xef.reasoning.tools -import com.xebia.functional.xef.auto.Description +import com.xebia.functional.xef.conversation.Description import kotlinx.serialization.Serializable @Serializable diff --git a/reasoning/src/commonMain/kotlin/com/xebia/functional/xef/reasoning/wikipedia/WikipediaClient.kt b/reasoning/src/commonMain/kotlin/com/xebia/functional/xef/reasoning/wikipedia/WikipediaClient.kt index 37fb860f4..12e299675 100644 --- a/reasoning/src/commonMain/kotlin/com/xebia/functional/xef/reasoning/wikipedia/WikipediaClient.kt +++ b/reasoning/src/commonMain/kotlin/com/xebia/functional/xef/reasoning/wikipedia/WikipediaClient.kt @@ -1,7 +1,7 @@ package com.xebia.functional.xef.reasoning.wikipedia -import com.xebia.functional.xef.auto.AutoClose -import com.xebia.functional.xef.auto.autoClose +import com.xebia.functional.xef.conversation.AutoClose +import com.xebia.functional.xef.conversation.autoClose import io.ktor.client.* import io.ktor.client.call.* import io.ktor.client.plugins.* diff --git a/reasoning/src/jsMain/kotlin/com/xebia/functional/xef/reasoning/serpapi/Search.js.kt b/reasoning/src/jsMain/kotlin/com/xebia/functional/xef/reasoning/serpapi/Search.js.kt index 65731fe09..d781910f4 100644 --- a/reasoning/src/jsMain/kotlin/com/xebia/functional/xef/reasoning/serpapi/Search.js.kt +++ b/reasoning/src/jsMain/kotlin/com/xebia/functional/xef/reasoning/serpapi/Search.js.kt @@ -1,6 +1,6 @@ package com.xebia.functional.xef.reasoning.serpapi -import com.xebia.functional.xef.auto.Conversation +import com.xebia.functional.xef.conversation.Conversation import com.xebia.functional.xef.llm.Chat actual class Search diff --git a/reasoning/src/jvmMain/kotlin/com/xebia/functional/xef/reasoning/filesystem/Files.kt b/reasoning/src/jvmMain/kotlin/com/xebia/functional/xef/reasoning/filesystem/Files.kt index 797b4be28..95afe3e20 100644 --- a/reasoning/src/jvmMain/kotlin/com/xebia/functional/xef/reasoning/filesystem/Files.kt +++ b/reasoning/src/jvmMain/kotlin/com/xebia/functional/xef/reasoning/filesystem/Files.kt @@ -1,6 +1,6 @@ package com.xebia.functional.xef.reasoning.filesystem -import com.xebia.functional.xef.auto.Conversation +import com.xebia.functional.xef.conversation.Conversation import com.xebia.functional.xef.llm.ChatWithFunctions import com.xebia.functional.xef.reasoning.tools.Tool diff --git a/reasoning/src/jvmMain/kotlin/com/xebia/functional/xef/reasoning/filesystem/ProduceTextFile.kt b/reasoning/src/jvmMain/kotlin/com/xebia/functional/xef/reasoning/filesystem/ProduceTextFile.kt index 0aa05f0ef..1a8bf4f3a 100644 --- a/reasoning/src/jvmMain/kotlin/com/xebia/functional/xef/reasoning/filesystem/ProduceTextFile.kt +++ b/reasoning/src/jvmMain/kotlin/com/xebia/functional/xef/reasoning/filesystem/ProduceTextFile.kt @@ -1,6 +1,6 @@ package com.xebia.functional.xef.reasoning.filesystem -import com.xebia.functional.xef.auto.Conversation +import com.xebia.functional.xef.conversation.Conversation import com.xebia.functional.xef.io.DEFAULT import com.xebia.functional.xef.llm.ChatWithFunctions import com.xebia.functional.xef.prompt.Prompt diff --git a/reasoning/src/jvmMain/kotlin/com/xebia/functional/xef/reasoning/filesystem/ReadFile.kt b/reasoning/src/jvmMain/kotlin/com/xebia/functional/xef/reasoning/filesystem/ReadFile.kt index b3d9cc763..f79d92205 100644 --- a/reasoning/src/jvmMain/kotlin/com/xebia/functional/xef/reasoning/filesystem/ReadFile.kt +++ b/reasoning/src/jvmMain/kotlin/com/xebia/functional/xef/reasoning/filesystem/ReadFile.kt @@ -1,6 +1,6 @@ package com.xebia.functional.xef.reasoning.filesystem -import com.xebia.functional.xef.auto.Conversation +import com.xebia.functional.xef.conversation.Conversation import com.xebia.functional.xef.io.DEFAULT import com.xebia.functional.xef.llm.ChatWithFunctions import com.xebia.functional.xef.prompt.Prompt diff --git a/reasoning/src/jvmMain/kotlin/com/xebia/functional/xef/reasoning/pdf/PDF.kt b/reasoning/src/jvmMain/kotlin/com/xebia/functional/xef/reasoning/pdf/PDF.kt index 6992f4311..1cb1e0228 100644 --- a/reasoning/src/jvmMain/kotlin/com/xebia/functional/xef/reasoning/pdf/PDF.kt +++ b/reasoning/src/jvmMain/kotlin/com/xebia/functional/xef/reasoning/pdf/PDF.kt @@ -1,6 +1,6 @@ package com.xebia.functional.xef.reasoning.pdf -import com.xebia.functional.xef.auto.Conversation +import com.xebia.functional.xef.conversation.Conversation import com.xebia.functional.xef.llm.Chat import com.xebia.functional.xef.llm.ChatWithFunctions import com.xebia.functional.xef.reasoning.tools.Tool diff --git a/reasoning/src/jvmMain/kotlin/com/xebia/functional/xef/reasoning/pdf/ReadPDFFromFile.kt b/reasoning/src/jvmMain/kotlin/com/xebia/functional/xef/reasoning/pdf/ReadPDFFromFile.kt index d0e5ebe72..4b8a1af77 100644 --- a/reasoning/src/jvmMain/kotlin/com/xebia/functional/xef/reasoning/pdf/ReadPDFFromFile.kt +++ b/reasoning/src/jvmMain/kotlin/com/xebia/functional/xef/reasoning/pdf/ReadPDFFromFile.kt @@ -1,6 +1,6 @@ package com.xebia.functional.xef.reasoning.pdf -import com.xebia.functional.xef.auto.Conversation +import com.xebia.functional.xef.conversation.Conversation import com.xebia.functional.xef.llm.Chat import com.xebia.functional.xef.llm.ChatWithFunctions import com.xebia.functional.xef.pdf.pdf diff --git a/reasoning/src/jvmMain/kotlin/com/xebia/functional/xef/reasoning/pdf/ReadPDFFromUrl.kt b/reasoning/src/jvmMain/kotlin/com/xebia/functional/xef/reasoning/pdf/ReadPDFFromUrl.kt index 9a05fd0bd..8732abe5b 100644 --- a/reasoning/src/jvmMain/kotlin/com/xebia/functional/xef/reasoning/pdf/ReadPDFFromUrl.kt +++ b/reasoning/src/jvmMain/kotlin/com/xebia/functional/xef/reasoning/pdf/ReadPDFFromUrl.kt @@ -1,6 +1,6 @@ package com.xebia.functional.xef.reasoning.pdf -import com.xebia.functional.xef.auto.Conversation +import com.xebia.functional.xef.conversation.Conversation import com.xebia.functional.xef.llm.Chat import com.xebia.functional.xef.llm.ChatWithFunctions import com.xebia.functional.xef.pdf.pdf diff --git a/reasoning/src/jvmMain/kotlin/com/xebia/functional/xef/reasoning/serpapi/Search.jvm.kt b/reasoning/src/jvmMain/kotlin/com/xebia/functional/xef/reasoning/serpapi/Search.jvm.kt index 020f066f2..3d7dcedbe 100644 --- a/reasoning/src/jvmMain/kotlin/com/xebia/functional/xef/reasoning/serpapi/Search.jvm.kt +++ b/reasoning/src/jvmMain/kotlin/com/xebia/functional/xef/reasoning/serpapi/Search.jvm.kt @@ -1,6 +1,6 @@ package com.xebia.functional.xef.reasoning.serpapi -import com.xebia.functional.xef.auto.Conversation +import com.xebia.functional.xef.conversation.Conversation import com.xebia.functional.xef.llm.Chat import java.util.concurrent.CompletableFuture import kotlinx.coroutines.CoroutineScope diff --git a/reasoning/src/macosArm64Main/kotlin/com/xebia/functional/xef/reasoning/serpapi/Search.macosArm64.kt b/reasoning/src/macosArm64Main/kotlin/com/xebia/functional/xef/reasoning/serpapi/Search.macosArm64.kt index 65731fe09..d781910f4 100644 --- a/reasoning/src/macosArm64Main/kotlin/com/xebia/functional/xef/reasoning/serpapi/Search.macosArm64.kt +++ b/reasoning/src/macosArm64Main/kotlin/com/xebia/functional/xef/reasoning/serpapi/Search.macosArm64.kt @@ -1,6 +1,6 @@ package com.xebia.functional.xef.reasoning.serpapi -import com.xebia.functional.xef.auto.Conversation +import com.xebia.functional.xef.conversation.Conversation import com.xebia.functional.xef.llm.Chat actual class Search diff --git a/reasoning/src/nativeMain/kotlin/com/xebia/functional/xef/reasoning/serpapi/Search.native.kt b/reasoning/src/nativeMain/kotlin/com/xebia/functional/xef/reasoning/serpapi/Search.native.kt index 65731fe09..d781910f4 100644 --- a/reasoning/src/nativeMain/kotlin/com/xebia/functional/xef/reasoning/serpapi/Search.native.kt +++ b/reasoning/src/nativeMain/kotlin/com/xebia/functional/xef/reasoning/serpapi/Search.native.kt @@ -1,6 +1,6 @@ package com.xebia.functional.xef.reasoning.serpapi -import com.xebia.functional.xef.auto.Conversation +import com.xebia.functional.xef.conversation.Conversation import com.xebia.functional.xef.llm.Chat actual class Search diff --git a/scala-cats/.scalafmt.conf b/scala-cats/.scalafmt.conf deleted file mode 100644 index f6540bcff..000000000 --- a/scala-cats/.scalafmt.conf +++ /dev/null @@ -1,37 +0,0 @@ -# tune this file as appropriate to your style! see: https://olafurpg.github.io/scalafmt/#Configuration - -version = "3.7.3" - -runner.dialect = "scala3" - -maxColumn = 150 - -continuationIndent.callSite = 2 - -newlines { - sometimesBeforeColonInMethodReturnType = false -} - -align { - arrowEnumeratorGenerator = false - ifWhileOpenParen = false - openParenCallSite = false - openParenDefnSite = false - - tokens = ["%", "%%"] -} - -docstrings.style = Asterisk - -rewrite { - rules = [SortImports, RedundantBraces] - redundantBraces.maxLines = 1 -} - -optIn { - breaksInsideChains = true -} - -project.excludeFilters = [ - "metals.sbt" -] \ No newline at end of file diff --git a/scala-cats/README.md b/scala-cats/README.md deleted file mode 100644 index 7f87a545e..000000000 --- a/scala-cats/README.md +++ /dev/null @@ -1,9 +0,0 @@ -# xef-scala-cats - -This module aims to integrate xef-core with [cats-effect](https://typelevel.org/cats-effect/) and IO. - -## Interoperability Coroutines & Cats-Effect's IO - -The `CoroutineToIO` is a wrapper implementation that originated from a post by Alexandru Nedelcu. -Therefore, any acknowledgments regarding this work should be directed toward him. The post can be -found in [his blog post](https://alexn.org/blog/2023/04/24/kotlin-suspended-functions-to-cats-effect-io/). diff --git a/scala-cats/build.gradle.kts b/scala-cats/build.gradle.kts deleted file mode 100644 index c829844d4..000000000 --- a/scala-cats/build.gradle.kts +++ /dev/null @@ -1,39 +0,0 @@ -@file:Suppress("DSL_SCOPE_VIOLATION") - -plugins { - scala - `maven-publish` - signing - alias(libs.plugins.semver.gradle) - alias(libs.plugins.spotless) - `xef-scala-publishing-conventions` -} - -dependencies { - implementation(projects.xefCore) - implementation(libs.scala.lang) - implementation(libs.cats.effect) - testImplementation(libs.munit.core) - testImplementation(libs.munit.cats.effect) -} - -java { - toolchain { - languageVersion.set(JavaLanguageVersion.of(11)) - } - withSourcesJar() -} - -tasks.withType().configureEach { - useJUnit() -} - -tasks.withType { - scalaCompileOptions.additionalParameters = listOf("-Wunused:all", "-Wvalue-discard") -} - -spotless { - scala { - scalafmt("3.7.3").configFile(".scalafmt.conf").scalaMajorVersion("2.13") - } -} diff --git a/scala-cats/src/main/scala/com/xebia/functional/xef/scala/kotlin/CoroutineToIO.scala b/scala-cats/src/main/scala/com/xebia/functional/xef/scala/kotlin/CoroutineToIO.scala deleted file mode 100644 index 876de1e9a..000000000 --- a/scala-cats/src/main/scala/com/xebia/functional/xef/scala/kotlin/CoroutineToIO.scala +++ /dev/null @@ -1,113 +0,0 @@ -package com.xebia.functional.xef.scala.kotlin - -import java.util.Collections -import java.util.concurrent.AbstractExecutorService -import java.util.concurrent.CancellationException -import java.util.concurrent.TimeUnit - -import scala.concurrent.ExecutionContextExecutorService -import scala.util.control.NoStackTrace -import scala.util.control.NonFatal - -import cats.effect.* -import cats.effect.kernel.Async -import cats.implicits.* - -import kotlin.coroutines.Continuation -import kotlin.coroutines.CoroutineContext -import kotlinx.coroutines.Deferred -import kotlinx.coroutines.* - -trait CoroutineToIO[F[_]] { - def runCancelable[A](block: kotlin.jvm.functions.Function2[CoroutineScope, Continuation[? >: A], ?]): F[A] - - def runCancelable_(block: kotlin.jvm.functions.Function2[CoroutineScope, Continuation[_ >: kotlin.Unit], Any]): F[Unit] -} - -@SuppressWarnings( - Array( - "scalafix:DisableSyntax.null", - "scalafix:DisableSyntax.throw", - "scalafix:DisableSyntax.asInstanceOf" - ) -) -object CoroutineToIO: - - def apply[F[_]: Async]: CoroutineToIO[F] = new CoroutineToIO[F]: - - def runCancelable_(block: kotlin.jvm.functions.Function2[CoroutineScope, Continuation[_ >: kotlin.Unit], Any]): F[Unit] = - runCancelable(block).void - - def runCancelable[A]( - block: kotlin.jvm.functions.Function2[CoroutineScope, Continuation[? >: A], ?] - ): F[A] = - coroutineToIOFactory[A](block, buildCancelToken) - - private def dispatcher: F[CoroutineDispatcher] = - Async[F].executionContext.map { other => - kotlinx.coroutines.ExecutorsKt.from( - new AbstractExecutorService with ExecutionContextExecutorService { - override def isShutdown = false - override def isTerminated = false - override def shutdown() = () - override def shutdownNow() = Collections.emptyList[Runnable] - override def execute(runnable: Runnable): Unit = other.execute(runnable) - override def reportFailure(t: Throwable): Unit = other.reportFailure(t) - override def awaitTermination(length: Long, unit: TimeUnit): Boolean = false - } - ) - } - - private def coroutineToIOFactory[A]( - block: kotlin.jvm.functions.Function2[CoroutineScope, Continuation[? >: A], ?], - buildCancelToken: (Deferred[_], DisposableHandle) => Option[F[Unit]] - ): F[A] = - dispatcher - .flatMap { dispatcher => - Async[F].async[A] { cb => - Async[F].delay { - try { - val context = CoroutineContextKt.newCoroutineContext( - GlobalScope.INSTANCE, - dispatcher.asInstanceOf[CoroutineContext] - ) - val deferred = kotlinx.coroutines.BuildersKt.async( - GlobalScope.INSTANCE, - context, - CoroutineStart.DEFAULT, - block - ) - try { - val dispose = deferred.invokeOnCompletion { (e: Throwable) => - e match { - case e: Throwable => cb(Left(e)) - case null => cb(Right(deferred.getCompleted)) - } - kotlin.Unit.INSTANCE - } - buildCancelToken(deferred, dispose) - } catch { - case NonFatal(e) => - deferred.cancel(null) - throw e - } - } catch { - case NonFatal(e) => - cb(Left(e)) - None - } - } - } - } - - private def buildCancelToken(deferred: Deferred[_], dispose: DisposableHandle): Option[F[Unit]] = - Some(Async[F].defer { - deferred.cancel(PleaseCancel) - dispose.dispose() - coroutineToIOFactory[kotlin.Unit]( - (_, cont) => deferred.join(cont), - (_, _) => None - ).void - }) - - private object PleaseCancel extends CancellationException with NoStackTrace diff --git a/scala-cats/src/test/scala/com/xebia/functional/xef/scala/kotlin/CoroutineToIOSpec.scala b/scala-cats/src/test/scala/com/xebia/functional/xef/scala/kotlin/CoroutineToIOSpec.scala deleted file mode 100644 index a16324bf8..000000000 --- a/scala-cats/src/test/scala/com/xebia/functional/xef/scala/kotlin/CoroutineToIOSpec.scala +++ /dev/null @@ -1,29 +0,0 @@ -package com.xebia.functional.xef.scala.kotlin - -import scala.concurrent.duration.* -import cats.effect.* -import munit.CatsEffectSuite - -class CoroutineToIOSpec extends CatsEffectSuite: - - // Sleeping via Kotlin's coroutines - def kotlinSleep(duration: FiniteDuration): IO[Unit] = - CoroutineToIO[IO].runCancelable_ { (_, cont) => - // Kotlin suspended function calls... - kotlinx.coroutines.DelayKt.delay(duration.toMillis, cont) - } - - test("KotlinCoroutines should convert Kotlin’s coroutines into cats.effect.IO") { - - val io = for - _ <- IO.println("Running...") - fiber <- kotlinSleep(10.seconds).start - _ <- IO.sleep(1000.millis) - _ <- fiber.cancel - _ <- fiber.joinWithUnit - str = "Done!" - _ <- IO.println(str) - yield str - - assertIO(io, "Done!") - } diff --git a/scala/build.gradle.kts b/scala/build.gradle.kts index e9fa958c5..2b333f20e 100644 --- a/scala/build.gradle.kts +++ b/scala/build.gradle.kts @@ -12,7 +12,6 @@ plugins { dependencies { implementation(projects.xefCore) implementation(projects.xefOpenai) - implementation(projects.kotlinLoom) implementation(libs.kotlinx.coroutines.reactive) // TODO split to separate Scala library diff --git a/scala/src/main/scala/com/xebia/functional/xef/scala/auto/AIScope.scala b/scala/src/main/scala/com/xebia/functional/xef/scala/auto/AIScope.scala deleted file mode 100644 index 4421f33b8..000000000 --- a/scala/src/main/scala/com/xebia/functional/xef/scala/auto/AIScope.scala +++ /dev/null @@ -1,7 +0,0 @@ -package com.xebia.functional.xef.scala.auto - -import com.xebia.functional.xef.auto.Conversation - -final case class AIScope(kt: Conversation) -object AIScope: - def fromCore(conversation: Conversation): AIScope = new AIScope(conversation) diff --git a/scala/src/main/scala/com/xebia/functional/xef/scala/auto/KotlinXSerializers.scala b/scala/src/main/scala/com/xebia/functional/xef/scala/conversation/KotlinXSerializers.scala similarity index 95% rename from scala/src/main/scala/com/xebia/functional/xef/scala/auto/KotlinXSerializers.scala rename to scala/src/main/scala/com/xebia/functional/xef/scala/conversation/KotlinXSerializers.scala index 392fc802b..cd57424c2 100644 --- a/scala/src/main/scala/com/xebia/functional/xef/scala/auto/KotlinXSerializers.scala +++ b/scala/src/main/scala/com/xebia/functional/xef/scala/conversation/KotlinXSerializers.scala @@ -1,4 +1,4 @@ -package com.xebia.functional.xef.scala.auto +package com.xebia.functional.xef.scala.conversation import kotlinx.serialization.KSerializer import kotlinx.serialization.builtins.BuiltinSerializersKt diff --git a/scala/src/main/scala/com/xebia/functional/xef/scala/auto/SerialDescriptor.scala b/scala/src/main/scala/com/xebia/functional/xef/scala/conversation/SerialDescriptor.scala similarity index 97% rename from scala/src/main/scala/com/xebia/functional/xef/scala/auto/SerialDescriptor.scala rename to scala/src/main/scala/com/xebia/functional/xef/scala/conversation/SerialDescriptor.scala index 4f854c59e..a7dc121df 100644 --- a/scala/src/main/scala/com/xebia/functional/xef/scala/auto/SerialDescriptor.scala +++ b/scala/src/main/scala/com/xebia/functional/xef/scala/conversation/SerialDescriptor.scala @@ -1,6 +1,6 @@ -package com.xebia.functional.xef.scala.auto +package com.xebia.functional.xef.scala.conversation -import com.xebia.functional.xef.auto.jvm.Description as JvmDescription +import com.xebia.functional.xef.conversation.jvm.Description as JvmDescription import kotlinx.serialization.descriptors.{SerialDescriptor as KtSerialDescriptor, SerialKind, StructureKind} import kotlinx.serialization.KSerializer import kotlinx.serialization.encoding.{Decoder as KtDecoder, Encoder as KtEncoder} diff --git a/scala/src/main/scala/com/xebia/functional/xef/scala/auto/SerialDescriptorInstances.scala b/scala/src/main/scala/com/xebia/functional/xef/scala/conversation/SerialDescriptorInstances.scala similarity index 98% rename from scala/src/main/scala/com/xebia/functional/xef/scala/auto/SerialDescriptorInstances.scala rename to scala/src/main/scala/com/xebia/functional/xef/scala/conversation/SerialDescriptorInstances.scala index 44c2b1fa3..c213c28e9 100644 --- a/scala/src/main/scala/com/xebia/functional/xef/scala/auto/SerialDescriptorInstances.scala +++ b/scala/src/main/scala/com/xebia/functional/xef/scala/conversation/SerialDescriptorInstances.scala @@ -1,4 +1,4 @@ -package com.xebia.functional.xef.scala.auto +package com.xebia.functional.xef.scala.conversation import kotlin.jvm.internal.Reflection import kotlin.reflect.KClass diff --git a/scala/src/main/scala/com/xebia/functional/xef/scala/auto/package.scala b/scala/src/main/scala/com/xebia/functional/xef/scala/conversation/package.scala similarity index 90% rename from scala/src/main/scala/com/xebia/functional/xef/scala/auto/package.scala rename to scala/src/main/scala/com/xebia/functional/xef/scala/conversation/package.scala index 7cad01d45..07b63857b 100644 --- a/scala/src/main/scala/com/xebia/functional/xef/scala/auto/package.scala +++ b/scala/src/main/scala/com/xebia/functional/xef/scala/conversation/package.scala @@ -1,11 +1,11 @@ -package com.xebia.functional.xef.scala.auto +package com.xebia.functional.xef.scala.conversation -import com.xebia.functional.xef.auto.llm.openai.* +import com.xebia.functional.xef.conversation.llm.openai.* import com.xebia.functional.xef.prompt.Prompt -import com.xebia.functional.xef.auto.{FromJson, JVMConversation} +import com.xebia.functional.xef.conversation.{FromJson, JVMConversation} import com.xebia.functional.xef.llm.* import com.xebia.functional.xef.llm.models.images.* -import com.xebia.functional.xef.vectorstores.{ConversationId, LocalVectorStore, VectorStore} +import com.xebia.functional.xef.store.{ConversationId, LocalVectorStore, VectorStore} import io.circe.Decoder import io.circe.parser.parse import org.reactivestreams.{Subscriber, Subscription} diff --git a/scala/src/main/scala/com/xebia/functional/xef/scala/textsplitters/TextSplitter.scala b/scala/src/main/scala/com/xebia/functional/xef/scala/textsplitters/TextSplitter.scala deleted file mode 100644 index 1756c813d..000000000 --- a/scala/src/main/scala/com/xebia/functional/xef/scala/textsplitters/TextSplitter.scala +++ /dev/null @@ -1,26 +0,0 @@ -package com.xebia.functional.xef.scala.textsplitters - -import com.xebia.functional.loom.LoomAdapter -import com.xebia.functional.xef.textsplitters.TextSplitter as KtTextSplitter -import com.xebia.functional.xef.textsplitters.{CharacterTextSplitterKt, TokenTextSplitterKt} -import com.xebia.functional.tokenizer.ModelType -import kotlin.coroutines.Continuation - -import scala.jdk.CollectionConverters.* - -trait TextSplitter: - private type Ret = java.util.List[String] - def core: KtTextSplitter - def splitText(text: String): List[String] = - LoomAdapter.apply[Ret](core.splitText(text, _)).asScala.toList - def splitDocuments(documents: List[String]): List[String] = - LoomAdapter.apply[Ret](core.splitDocuments(documents.asJava, _)).asScala.toList - def splitTextInDocuments(text: String): List[String] = - LoomAdapter.apply[Ret](core.splitTextInDocuments(text, _)).asScala.toList - -object TextSplitter: - def characterTextSplitter(separator: String): TextSplitter = new TextSplitter: - def core: KtTextSplitter = CharacterTextSplitterKt.CharacterTextSplitter(separator) - - def tokenTextSplitter(modelType: ModelType, chunkSize: Int, chunkOverlap: Int): TextSplitter = new TextSplitter: - def core: KtTextSplitter = TokenTextSplitterKt.TokenTextSplitter(modelType, chunkSize, chunkOverlap) diff --git a/scala/src/test/scala/com/xebia/functional/xef/scala/auto/SerialDescriptorSpec.scala b/scala/src/test/scala/com/xebia/functional/xef/scala/conversation/SerialDescriptorSpec.scala similarity index 98% rename from scala/src/test/scala/com/xebia/functional/xef/scala/auto/SerialDescriptorSpec.scala rename to scala/src/test/scala/com/xebia/functional/xef/scala/conversation/SerialDescriptorSpec.scala index 866b993e1..6141cc617 100644 --- a/scala/src/test/scala/com/xebia/functional/xef/scala/auto/SerialDescriptorSpec.scala +++ b/scala/src/test/scala/com/xebia/functional/xef/scala/conversation/SerialDescriptorSpec.scala @@ -1,4 +1,4 @@ -package com.xebia.functional.xef.scala.auto +package com.xebia.functional.xef.scala.conversation import cats.syntax.either.* import kotlinx.serialization.builtins.BuiltinSerializersKt diff --git a/server/src/main/kotlin/com/xebia/functional/xef/server/db/psql/XefVectorStoreConfig.kt b/server/src/main/kotlin/com/xebia/functional/xef/server/db/psql/XefVectorStoreConfig.kt index e6b2fea7b..ec9786d9c 100644 --- a/server/src/main/kotlin/com/xebia/functional/xef/server/db/psql/XefVectorStoreConfig.kt +++ b/server/src/main/kotlin/com/xebia/functional/xef/server/db/psql/XefVectorStoreConfig.kt @@ -5,7 +5,7 @@ import com.typesafe.config.ConfigFactory import com.xebia.functional.xef.server.services.PersistenceService import com.xebia.functional.xef.server.services.PostgreSQLXef import com.xebia.functional.xef.server.services.PostgresXefService -import com.xebia.functional.xef.vectorstores.migrations.PsqlVectorStoreConfig +import com.xebia.functional.xef.store.migrations.PsqlVectorStoreConfig import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.withContext import kotlinx.serialization.ExperimentalSerializationApi diff --git a/server/src/main/kotlin/com/xebia/functional/xef/server/http/routes/Routes.kt b/server/src/main/kotlin/com/xebia/functional/xef/server/http/routes/Routes.kt index ddd95bbd0..125e07172 100644 --- a/server/src/main/kotlin/com/xebia/functional/xef/server/http/routes/Routes.kt +++ b/server/src/main/kotlin/com/xebia/functional/xef/server/http/routes/Routes.kt @@ -2,9 +2,9 @@ package com.xebia.functional.xef.server.http.routes import com.aallam.openai.api.BetaOpenAI import com.aallam.openai.api.chat.ChatCompletionRequest -import com.xebia.functional.xef.auto.Conversation +import com.xebia.functional.xef.conversation.Conversation import com.xebia.functional.xef.prompt.configuration.PromptConfiguration -import com.xebia.functional.xef.auto.llm.openai.* +import com.xebia.functional.xef.conversation.llm.openai.* import com.xebia.functional.xef.prompt.Prompt import com.xebia.functional.xef.server.services.PersistenceService import io.ktor.http.* diff --git a/server/src/main/kotlin/com/xebia/functional/xef/server/services/PersistenceService.kt b/server/src/main/kotlin/com/xebia/functional/xef/server/services/PersistenceService.kt index 6d905ab1a..f533a2f2f 100644 --- a/server/src/main/kotlin/com/xebia/functional/xef/server/services/PersistenceService.kt +++ b/server/src/main/kotlin/com/xebia/functional/xef/server/services/PersistenceService.kt @@ -1,7 +1,7 @@ package com.xebia.functional.xef.server.services import com.xebia.functional.xef.server.http.routes.Provider -import com.xebia.functional.xef.vectorstores.VectorStore +import com.xebia.functional.xef.store.VectorStore import io.github.oshai.kotlinlogging.KotlinLogging abstract class PersistenceService { diff --git a/server/src/main/kotlin/com/xebia/functional/xef/server/services/PostgresXefService.kt b/server/src/main/kotlin/com/xebia/functional/xef/server/services/PostgresXefService.kt index d3501d428..2876f0bbc 100644 --- a/server/src/main/kotlin/com/xebia/functional/xef/server/services/PostgresXefService.kt +++ b/server/src/main/kotlin/com/xebia/functional/xef/server/services/PostgresXefService.kt @@ -1,14 +1,14 @@ package com.xebia.functional.xef.server.services -import com.xebia.functional.xef.auto.autoClose -import com.xebia.functional.xef.auto.llm.openai.OpenAI -import com.xebia.functional.xef.auto.llm.openai.OpenAIEmbeddings +import com.xebia.functional.xef.conversation.autoClose +import com.xebia.functional.xef.conversation.llm.openai.OpenAI +import com.xebia.functional.xef.conversation.llm.openai.OpenAIEmbeddings import com.xebia.functional.xef.llm.models.embeddings.EmbeddingModel import com.xebia.functional.xef.llm.models.embeddings.RequestConfig import com.xebia.functional.xef.server.http.routes.Provider -import com.xebia.functional.xef.vectorstores.PGVectorStore -import com.xebia.functional.xef.vectorstores.VectorStore -import com.xebia.functional.xef.vectorstores.postgresql.* +import com.xebia.functional.xef.store.PGVectorStore +import com.xebia.functional.xef.store.VectorStore +import com.xebia.functional.xef.store.postgresql.* import com.zaxxer.hikari.HikariConfig import com.zaxxer.hikari.HikariDataSource import kotlinx.uuid.UUID diff --git a/settings.gradle.kts b/settings.gradle.kts index 2d5fa6035..4ac46abbe 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -58,7 +58,6 @@ project(":xef-kotlin").projectDir = file("kotlin") include("xef-kotlin-examples") project(":xef-kotlin-examples").projectDir = file("examples/kotlin") -include("kotlin-loom") // // @@ -68,8 +67,6 @@ project(":xef-scala-examples").projectDir = file("examples/scala") include("xef-scala") project(":xef-scala").projectDir = file("scala") -include("xef-scala-cats") -project(":xef-scala-cats").projectDir = file("scala-cats") // //