From 3666d2cdfc20c6f6d9a7819386cc1fb6c0fd51c2 Mon Sep 17 00:00:00 2001 From: Kazik Pogoda Date: Sun, 15 Dec 2024 14:33:41 +0100 Subject: [PATCH] package changed to com.xemantic.anthropic, group changed to com.xemantic.ai, to unify with all the other xemantic AI tools. (#26) --- README.md | 4 +-- settings.gradle.kts | 2 +- src/commonMain/kotlin/Anthropic.kt | 30 ++++++++-------- src/commonMain/kotlin/AnthropicJson.kt | 36 +++++++++---------- src/commonMain/kotlin/Models.kt | 4 +-- src/commonMain/kotlin/Responses.kt | 2 +- src/commonMain/kotlin/batch/Batches.kt | 6 ++-- src/commonMain/kotlin/cache/Cache.kt | 2 +- src/commonMain/kotlin/content/Content.kt | 4 +-- src/commonMain/kotlin/content/Document.kt | 4 +-- src/commonMain/kotlin/content/Image.kt | 4 +-- src/commonMain/kotlin/content/MagicNumbers.kt | 2 +- src/commonMain/kotlin/content/Text.kt | 4 +-- src/commonMain/kotlin/content/Tool.kt | 10 +++--- src/commonMain/kotlin/error/Errors.kt | 4 +-- src/commonMain/kotlin/event/Events.kt | 6 ++-- .../kotlin/message/MessageSupport.kt | 2 +- src/commonMain/kotlin/message/Messages.kt | 34 +++++++++--------- src/commonMain/kotlin/tool/Tools.kt | 10 +++--- src/commonMain/kotlin/tool/bash/Bash.kt | 8 ++--- .../kotlin/tool/computer/Computer.kt | 10 +++--- .../kotlin/tool/editor/TextEditor.kt | 8 ++--- src/commonMain/kotlin/usage/Usage.kt | 2 +- src/commonMain/kotlin/usage/UsageCollector.kt | 4 +-- src/commonTest/kotlin/AnthropicTest.kt | 30 ++++++++-------- src/commonTest/kotlin/content/DocumentTest.kt | 8 ++--- src/commonTest/kotlin/content/ImageTest.kt | 8 ++--- .../kotlin/content/ToolResultTest.kt | 2 +- .../kotlin/error/ErrorResponseTest.kt | 6 ++-- .../kotlin/message/MessageRequestTest.kt | 18 +++++----- .../kotlin/message/MessageResponseTest.kt | 10 +++--- src/commonTest/kotlin/message/MessageTest.kt | 2 +- .../kotlin/test/AnthropicTestSupport.kt | 4 +-- .../kotlin/tool/AnthropicTestTools.kt | 2 +- src/commonTest/kotlin/tool/ToolChoiceTest.kt | 4 +-- src/commonTest/kotlin/tool/ToolInputTest.kt | 4 +-- src/commonTest/kotlin/usage/CostTest.kt | 2 +- .../kotlin/usage/UsageCollectorTest.kt | 4 +-- src/jsMain/kotlin/JsAnthropic.kt | 2 +- src/jvmMain/kotlin/JvmAnthropic.kt | 6 ++-- src/jvmMain/kotlin/content/JvmDocument.kt | 2 +- src/jvmMain/kotlin/content/JvmImage.kt | 2 +- .../kotlin/tool/computer/JvmComputer.kt | 4 +-- .../kotlin/tool/editor/JvmTextEditor.kt | 2 +- src/jvmTest/kotlin/JvmTestPackage.kt | 2 +- src/jvmTest/kotlin/content/JvmDocumentTest.kt | 8 ++--- src/jvmTest/kotlin/content/MagicNumberTest.kt | 2 +- src/nativeMain/kotlin/NativeAnthropic.kt | 2 +- src/wasmJsMain/kotlin/WasmJsAnthropic.kt | 2 +- 49 files changed, 170 insertions(+), 170 deletions(-) diff --git a/README.md b/README.md index f7214c8..bfcab72 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ Unofficial Kotlin multiplatform variant of the [Antropic SDK](https://docs.anthropic.com/en/api/client-sdks). -[Maven Central Version](https://central.sonatype.com/namespace/com.xemantic.anthropic/anthropic-sdk-kotlin) +[Maven Central Version](https://central.sonatype.com/namespace/com.xemantic.ai/anthropic-sdk-kotlin) [GitHub Release Date](https://github.com/xemantic/anthropic-sdk-kotlin/releases) [license](https://github.com/xemantic/anthropic-sdk-kotlin/blob/main/LICENSE) @@ -63,7 +63,7 @@ Otherwise, you need to add to your `build.gradle.kts`: ```kotlin dependencies { - implementation("com.xemantic.anthropic:anthropic-sdk-kotlin:0.11") + implementation("com.xemantic.ai:anthropic-sdk-kotlin:0.11") } ``` diff --git a/settings.gradle.kts b/settings.gradle.kts index 619e707..6c0f658 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1,4 +1,4 @@ -val groupId = "com.xemantic.anthropic" +val groupId = "com.xemantic.ai" val name = "anthropic-sdk-kotlin" rootProject.name = name diff --git a/src/commonMain/kotlin/Anthropic.kt b/src/commonMain/kotlin/Anthropic.kt index 1c935d9..b70b968 100644 --- a/src/commonMain/kotlin/Anthropic.kt +++ b/src/commonMain/kotlin/Anthropic.kt @@ -14,21 +14,21 @@ * limitations under the License. */ -package com.xemantic.anthropic - -import com.xemantic.anthropic.error.AnthropicException -import com.xemantic.anthropic.error.ErrorResponse -import com.xemantic.anthropic.event.Event -import com.xemantic.anthropic.cache.CacheControl -import com.xemantic.anthropic.content.ToolUse -import com.xemantic.anthropic.message.MessageRequest -import com.xemantic.anthropic.message.MessageResponse -import com.xemantic.anthropic.tool.BuiltInTool -import com.xemantic.anthropic.tool.Tool -import com.xemantic.anthropic.tool.ToolInput -import com.xemantic.anthropic.usage.Cost -import com.xemantic.anthropic.usage.Usage -import com.xemantic.anthropic.usage.UsageCollector +package com.xemantic.ai.anthropic + +import com.xemantic.ai.anthropic.error.AnthropicException +import com.xemantic.ai.anthropic.error.ErrorResponse +import com.xemantic.ai.anthropic.event.Event +import com.xemantic.ai.anthropic.cache.CacheControl +import com.xemantic.ai.anthropic.content.ToolUse +import com.xemantic.ai.anthropic.message.MessageRequest +import com.xemantic.ai.anthropic.message.MessageResponse +import com.xemantic.ai.anthropic.tool.BuiltInTool +import com.xemantic.ai.anthropic.tool.Tool +import com.xemantic.ai.anthropic.tool.ToolInput +import com.xemantic.ai.anthropic.usage.Cost +import com.xemantic.ai.anthropic.usage.Usage +import com.xemantic.ai.anthropic.usage.UsageCollector import io.ktor.client.HttpClient import io.ktor.client.call.body import io.ktor.client.plugins.* diff --git a/src/commonMain/kotlin/AnthropicJson.kt b/src/commonMain/kotlin/AnthropicJson.kt index 3be4750..cd2bd0c 100644 --- a/src/commonMain/kotlin/AnthropicJson.kt +++ b/src/commonMain/kotlin/AnthropicJson.kt @@ -14,23 +14,23 @@ * limitations under the License. */ -package com.xemantic.anthropic - -import com.xemantic.anthropic.batch.MessageBatchResponse -import com.xemantic.anthropic.content.Content -import com.xemantic.anthropic.content.Document -import com.xemantic.anthropic.error.ErrorResponse -import com.xemantic.anthropic.content.Image -import com.xemantic.anthropic.content.Text -import com.xemantic.anthropic.message.MessageResponse -import com.xemantic.anthropic.content.ToolResult -import com.xemantic.anthropic.content.ToolUse -import com.xemantic.anthropic.tool.BuiltInTool -import com.xemantic.anthropic.tool.DefaultTool -import com.xemantic.anthropic.tool.Tool -import com.xemantic.anthropic.tool.bash.Bash -import com.xemantic.anthropic.tool.computer.Computer -import com.xemantic.anthropic.tool.editor.TextEditor +package com.xemantic.ai.anthropic + +import com.xemantic.ai.anthropic.batch.MessageBatchResponse +import com.xemantic.ai.anthropic.content.Content +import com.xemantic.ai.anthropic.content.Document +import com.xemantic.ai.anthropic.error.ErrorResponse +import com.xemantic.ai.anthropic.content.Image +import com.xemantic.ai.anthropic.content.Text +import com.xemantic.ai.anthropic.message.MessageResponse +import com.xemantic.ai.anthropic.content.ToolResult +import com.xemantic.ai.anthropic.content.ToolUse +import com.xemantic.ai.anthropic.tool.BuiltInTool +import com.xemantic.ai.anthropic.tool.DefaultTool +import com.xemantic.ai.anthropic.tool.Tool +import com.xemantic.ai.anthropic.tool.bash.Bash +import com.xemantic.ai.anthropic.tool.computer.Computer +import com.xemantic.ai.anthropic.tool.editor.TextEditor import kotlinx.serialization.ExperimentalSerializationApi import kotlinx.serialization.InternalSerializationApi import kotlinx.serialization.KSerializer @@ -134,7 +134,7 @@ private object ToolSerializer : KSerializer { @OptIn(InternalSerializationApi::class, ExperimentalSerializationApi::class) override val descriptor: SerialDescriptor = buildSerialDescriptor( - serialName = "com.xemantic.anthropic.Tool", + serialName = "com.xemantic.ai.anthropic.Tool", kind = SerialKind.CONTEXTUAL ) diff --git a/src/commonMain/kotlin/Models.kt b/src/commonMain/kotlin/Models.kt index 27d1c8d..26f7edd 100644 --- a/src/commonMain/kotlin/Models.kt +++ b/src/commonMain/kotlin/Models.kt @@ -14,11 +14,11 @@ * limitations under the License. */ -package com.xemantic.anthropic +package com.xemantic.ai.anthropic import com.xemantic.ai.money.Money import com.xemantic.ai.money.Ratio -import com.xemantic.anthropic.usage.Cost +import com.xemantic.ai.anthropic.usage.Cost /** * The model used by the API. diff --git a/src/commonMain/kotlin/Responses.kt b/src/commonMain/kotlin/Responses.kt index ab135c3..a6cb7b6 100644 --- a/src/commonMain/kotlin/Responses.kt +++ b/src/commonMain/kotlin/Responses.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.xemantic.anthropic +package com.xemantic.ai.anthropic import kotlinx.serialization.Serializable diff --git a/src/commonMain/kotlin/batch/Batches.kt b/src/commonMain/kotlin/batch/Batches.kt index 400d5e6..bc3ecfb 100644 --- a/src/commonMain/kotlin/batch/Batches.kt +++ b/src/commonMain/kotlin/batch/Batches.kt @@ -14,10 +14,10 @@ * limitations under the License. */ -package com.xemantic.anthropic.batch +package com.xemantic.ai.anthropic.batch -import com.xemantic.anthropic.Response -import com.xemantic.anthropic.message.Message +import com.xemantic.ai.anthropic.Response +import com.xemantic.ai.anthropic.message.Message import kotlinx.datetime.Instant import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable diff --git a/src/commonMain/kotlin/cache/Cache.kt b/src/commonMain/kotlin/cache/Cache.kt index 47c7dd3..e21f536 100644 --- a/src/commonMain/kotlin/cache/Cache.kt +++ b/src/commonMain/kotlin/cache/Cache.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.xemantic.anthropic.cache +package com.xemantic.ai.anthropic.cache import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable diff --git a/src/commonMain/kotlin/content/Content.kt b/src/commonMain/kotlin/content/Content.kt index f5d7075..7bfbc85 100644 --- a/src/commonMain/kotlin/content/Content.kt +++ b/src/commonMain/kotlin/content/Content.kt @@ -14,9 +14,9 @@ * limitations under the License. */ -package com.xemantic.anthropic.content +package com.xemantic.ai.anthropic.content -import com.xemantic.anthropic.cache.CacheControl +import com.xemantic.ai.anthropic.cache.CacheControl import kotlinx.serialization.ExperimentalSerializationApi import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable diff --git a/src/commonMain/kotlin/content/Document.kt b/src/commonMain/kotlin/content/Document.kt index 07f9da4..e278e8a 100644 --- a/src/commonMain/kotlin/content/Document.kt +++ b/src/commonMain/kotlin/content/Document.kt @@ -14,9 +14,9 @@ * limitations under the License. */ -package com.xemantic.anthropic.content +package com.xemantic.ai.anthropic.content -import com.xemantic.anthropic.cache.CacheControl +import com.xemantic.ai.anthropic.cache.CacheControl import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable import kotlin.io.encoding.ExperimentalEncodingApi diff --git a/src/commonMain/kotlin/content/Image.kt b/src/commonMain/kotlin/content/Image.kt index 736f74a..9809348 100644 --- a/src/commonMain/kotlin/content/Image.kt +++ b/src/commonMain/kotlin/content/Image.kt @@ -14,9 +14,9 @@ * limitations under the License. */ -package com.xemantic.anthropic.content +package com.xemantic.ai.anthropic.content -import com.xemantic.anthropic.cache.CacheControl +import com.xemantic.ai.anthropic.cache.CacheControl import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable diff --git a/src/commonMain/kotlin/content/MagicNumbers.kt b/src/commonMain/kotlin/content/MagicNumbers.kt index fc20043..bb72ea6 100644 --- a/src/commonMain/kotlin/content/MagicNumbers.kt +++ b/src/commonMain/kotlin/content/MagicNumbers.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.xemantic.anthropic.content +package com.xemantic.ai.anthropic.content @OptIn(ExperimentalUnsignedTypes::class) enum class MagicNumber( diff --git a/src/commonMain/kotlin/content/Text.kt b/src/commonMain/kotlin/content/Text.kt index 2df9d88..117d291 100644 --- a/src/commonMain/kotlin/content/Text.kt +++ b/src/commonMain/kotlin/content/Text.kt @@ -14,9 +14,9 @@ * limitations under the License. */ -package com.xemantic.anthropic.content +package com.xemantic.ai.anthropic.content -import com.xemantic.anthropic.cache.CacheControl +import com.xemantic.ai.anthropic.cache.CacheControl import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable diff --git a/src/commonMain/kotlin/content/Tool.kt b/src/commonMain/kotlin/content/Tool.kt index 8125ec4..66bb3d1 100644 --- a/src/commonMain/kotlin/content/Tool.kt +++ b/src/commonMain/kotlin/content/Tool.kt @@ -14,12 +14,12 @@ * limitations under the License. */ -package com.xemantic.anthropic.content +package com.xemantic.ai.anthropic.content -import com.xemantic.anthropic.anthropicJson -import com.xemantic.anthropic.cache.CacheControl -import com.xemantic.anthropic.tool.Tool -import com.xemantic.anthropic.tool.ToolInput +import com.xemantic.ai.anthropic.anthropicJson +import com.xemantic.ai.anthropic.cache.CacheControl +import com.xemantic.ai.anthropic.tool.Tool +import com.xemantic.ai.anthropic.tool.ToolInput import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable import kotlinx.serialization.Transient diff --git a/src/commonMain/kotlin/error/Errors.kt b/src/commonMain/kotlin/error/Errors.kt index e4209ce..01a96f5 100644 --- a/src/commonMain/kotlin/error/Errors.kt +++ b/src/commonMain/kotlin/error/Errors.kt @@ -14,9 +14,9 @@ * limitations under the License. */ -package com.xemantic.anthropic.error +package com.xemantic.ai.anthropic.error -import com.xemantic.anthropic.Response +import com.xemantic.ai.anthropic.Response import io.ktor.http.HttpStatusCode import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable diff --git a/src/commonMain/kotlin/event/Events.kt b/src/commonMain/kotlin/event/Events.kt index 37ac3c6..50e1d40 100644 --- a/src/commonMain/kotlin/event/Events.kt +++ b/src/commonMain/kotlin/event/Events.kt @@ -14,10 +14,10 @@ * limitations under the License. */ -package com.xemantic.anthropic.event +package com.xemantic.ai.anthropic.event -import com.xemantic.anthropic.message.MessageResponse -import com.xemantic.anthropic.message.StopReason +import com.xemantic.ai.anthropic.message.MessageResponse +import com.xemantic.ai.anthropic.message.StopReason import kotlinx.serialization.ExperimentalSerializationApi import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable diff --git a/src/commonMain/kotlin/message/MessageSupport.kt b/src/commonMain/kotlin/message/MessageSupport.kt index 17f4e30..0a24742 100644 --- a/src/commonMain/kotlin/message/MessageSupport.kt +++ b/src/commonMain/kotlin/message/MessageSupport.kt @@ -14,6 +14,6 @@ * limitations under the License. */ -package com.xemantic.anthropic.message +package com.xemantic.ai.anthropic.message fun List.toNullIfEmpty(): List? = if (isEmpty()) null else this diff --git a/src/commonMain/kotlin/message/Messages.kt b/src/commonMain/kotlin/message/Messages.kt index 9232521..423dc82 100644 --- a/src/commonMain/kotlin/message/Messages.kt +++ b/src/commonMain/kotlin/message/Messages.kt @@ -14,20 +14,20 @@ * limitations under the License. */ -package com.xemantic.anthropic.message - -import com.xemantic.anthropic.Model -import com.xemantic.anthropic.Response -import com.xemantic.anthropic.cache.CacheControl -import com.xemantic.anthropic.content.Content -import com.xemantic.anthropic.content.ContentBuilder -import com.xemantic.anthropic.content.ToolUse -import com.xemantic.anthropic.toPrettyJson -import com.xemantic.anthropic.tool.Tool -import com.xemantic.anthropic.tool.ToolChoice -import com.xemantic.anthropic.tool.ToolInput -import com.xemantic.anthropic.tool.toolName -import com.xemantic.anthropic.usage.Usage +package com.xemantic.ai.anthropic.message + +import com.xemantic.ai.anthropic.Model +import com.xemantic.ai.anthropic.Response +import com.xemantic.ai.anthropic.cache.CacheControl +import com.xemantic.ai.anthropic.content.Content +import com.xemantic.ai.anthropic.content.ContentBuilder +import com.xemantic.ai.anthropic.content.ToolUse +import com.xemantic.ai.anthropic.toPrettyJson +import com.xemantic.ai.anthropic.tool.Tool +import com.xemantic.ai.anthropic.tool.ToolChoice +import com.xemantic.ai.anthropic.tool.ToolInput +import com.xemantic.ai.anthropic.tool.toolName +import com.xemantic.ai.anthropic.usage.Usage import kotlinx.serialization.* import kotlin.collections.mutableListOf @@ -93,7 +93,7 @@ data class MessageRequest( /** * Will fill [tools] with all the tools defined - * when creating this [com.xemantic.anthropic.Anthropic] client. + * when creating this [com.xemantic.ai.anthropic.Anthropic] client. */ fun allTools() { tools = toolMap.values.toList() @@ -106,7 +106,7 @@ data class MessageRequest( /** * Sets both, the [tools] list and the [toolChoice] with - * just one tool to use, forcing the API to respond with the [com.xemantic.anthropic.content.ToolUse]. + * just one tool to use, forcing the API to respond with the [com.xemantic.ai.anthropic.content.ToolUse]. */ inline fun singleTool() { val name = toolName() @@ -121,7 +121,7 @@ data class MessageRequest( /** * Sets both, the [tools] list and the [toolChoice] with * just one tool to use, forcing the API to respond with the - * [com.xemantic.anthropic.content.ToolUse] instance. + * [com.xemantic.ai.anthropic.content.ToolUse] instance. */ fun chooseTool(name: String) { val tool = requireNotNull(toolMap[name]) { diff --git a/src/commonMain/kotlin/tool/Tools.kt b/src/commonMain/kotlin/tool/Tools.kt index 2dc5f57..35c35e1 100644 --- a/src/commonMain/kotlin/tool/Tools.kt +++ b/src/commonMain/kotlin/tool/Tools.kt @@ -14,15 +14,15 @@ * limitations under the License. */ -package com.xemantic.anthropic.tool +package com.xemantic.ai.anthropic.tool import com.xemantic.ai.tool.schema.JsonSchema import com.xemantic.ai.tool.schema.generator.jsonSchemaOf import com.xemantic.ai.tool.schema.meta.Description -import com.xemantic.anthropic.anthropicJson -import com.xemantic.anthropic.cache.CacheControl -import com.xemantic.anthropic.content.Content -import com.xemantic.anthropic.content.ToolResult +import com.xemantic.ai.anthropic.anthropicJson +import com.xemantic.ai.anthropic.cache.CacheControl +import com.xemantic.ai.anthropic.content.Content +import com.xemantic.ai.anthropic.content.ToolResult import kotlinx.serialization.ExperimentalSerializationApi import kotlinx.serialization.InternalSerializationApi import kotlinx.serialization.KSerializer diff --git a/src/commonMain/kotlin/tool/bash/Bash.kt b/src/commonMain/kotlin/tool/bash/Bash.kt index a0f5672..01765b2 100644 --- a/src/commonMain/kotlin/tool/bash/Bash.kt +++ b/src/commonMain/kotlin/tool/bash/Bash.kt @@ -14,11 +14,11 @@ * limitations under the License. */ -package com.xemantic.anthropic.tool.bash +package com.xemantic.ai.anthropic.tool.bash -import com.xemantic.anthropic.cache.CacheControl -import com.xemantic.anthropic.tool.BuiltInTool -import com.xemantic.anthropic.tool.ToolInput +import com.xemantic.ai.anthropic.cache.CacheControl +import com.xemantic.ai.anthropic.tool.BuiltInTool +import com.xemantic.ai.anthropic.tool.ToolInput import kotlinx.serialization.ExperimentalSerializationApi import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable diff --git a/src/commonMain/kotlin/tool/computer/Computer.kt b/src/commonMain/kotlin/tool/computer/Computer.kt index 368694a..6bcc881 100644 --- a/src/commonMain/kotlin/tool/computer/Computer.kt +++ b/src/commonMain/kotlin/tool/computer/Computer.kt @@ -14,12 +14,12 @@ * limitations under the License. */ -package com.xemantic.anthropic.tool.computer +package com.xemantic.ai.anthropic.tool.computer -import com.xemantic.anthropic.cache.CacheControl -import com.xemantic.anthropic.content.Image -import com.xemantic.anthropic.tool.BuiltInTool -import com.xemantic.anthropic.tool.ToolInput +import com.xemantic.ai.anthropic.cache.CacheControl +import com.xemantic.ai.anthropic.content.Image +import com.xemantic.ai.anthropic.tool.BuiltInTool +import com.xemantic.ai.anthropic.tool.ToolInput import kotlinx.serialization.ExperimentalSerializationApi import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable diff --git a/src/commonMain/kotlin/tool/editor/TextEditor.kt b/src/commonMain/kotlin/tool/editor/TextEditor.kt index 7fce9dc..7f37f7b 100644 --- a/src/commonMain/kotlin/tool/editor/TextEditor.kt +++ b/src/commonMain/kotlin/tool/editor/TextEditor.kt @@ -14,11 +14,11 @@ * limitations under the License. */ -package com.xemantic.anthropic.tool.editor +package com.xemantic.ai.anthropic.tool.editor -import com.xemantic.anthropic.cache.CacheControl -import com.xemantic.anthropic.tool.BuiltInTool -import com.xemantic.anthropic.tool.ToolInput +import com.xemantic.ai.anthropic.cache.CacheControl +import com.xemantic.ai.anthropic.tool.BuiltInTool +import com.xemantic.ai.anthropic.tool.ToolInput import kotlinx.serialization.ExperimentalSerializationApi import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable diff --git a/src/commonMain/kotlin/usage/Usage.kt b/src/commonMain/kotlin/usage/Usage.kt index ee37c3d..3d9393f 100644 --- a/src/commonMain/kotlin/usage/Usage.kt +++ b/src/commonMain/kotlin/usage/Usage.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.xemantic.anthropic.usage +package com.xemantic.ai.anthropic.usage import com.xemantic.ai.money.Money import com.xemantic.ai.money.ONE diff --git a/src/commonMain/kotlin/usage/UsageCollector.kt b/src/commonMain/kotlin/usage/UsageCollector.kt index 4644158..9be6ef4 100644 --- a/src/commonMain/kotlin/usage/UsageCollector.kt +++ b/src/commonMain/kotlin/usage/UsageCollector.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.xemantic.anthropic.usage +package com.xemantic.ai.anthropic.usage import com.xemantic.ai.money.Money import com.xemantic.ai.money.ONE @@ -23,7 +23,7 @@ import kotlinx.atomicfu.update /** * Collects overall [Usage] and calculates [Cost] information - * based on [com.xemantic.anthropic.message.MessageResponse]s returned + * based on [com.xemantic.ai.anthropic.message.MessageResponse]s returned * by API calls. */ class UsageCollector { diff --git a/src/commonTest/kotlin/AnthropicTest.kt b/src/commonTest/kotlin/AnthropicTest.kt index 6339e95..c6dac39 100644 --- a/src/commonTest/kotlin/AnthropicTest.kt +++ b/src/commonTest/kotlin/AnthropicTest.kt @@ -14,24 +14,24 @@ * limitations under the License. */ -package com.xemantic.anthropic +package com.xemantic.ai.anthropic import com.xemantic.ai.money.Money import com.xemantic.ai.money.ZERO -import com.xemantic.anthropic.event.Delta.TextDelta -import com.xemantic.anthropic.event.Event -import com.xemantic.anthropic.message.Message -import com.xemantic.anthropic.message.Role -import com.xemantic.anthropic.message.StopReason -import com.xemantic.anthropic.message.plusAssign -import com.xemantic.anthropic.tool.Calculator -import com.xemantic.anthropic.tool.DatabaseQuery -import com.xemantic.anthropic.tool.FibonacciTool -import com.xemantic.anthropic.tool.TestDatabase -import com.xemantic.anthropic.content.Text -import com.xemantic.anthropic.content.ToolUse -import com.xemantic.anthropic.usage.Cost -import com.xemantic.anthropic.usage.Usage +import com.xemantic.ai.anthropic.event.Delta.TextDelta +import com.xemantic.ai.anthropic.event.Event +import com.xemantic.ai.anthropic.message.Message +import com.xemantic.ai.anthropic.message.Role +import com.xemantic.ai.anthropic.message.StopReason +import com.xemantic.ai.anthropic.message.plusAssign +import com.xemantic.ai.anthropic.tool.Calculator +import com.xemantic.ai.anthropic.tool.DatabaseQuery +import com.xemantic.ai.anthropic.tool.FibonacciTool +import com.xemantic.ai.anthropic.tool.TestDatabase +import com.xemantic.ai.anthropic.content.Text +import com.xemantic.ai.anthropic.content.ToolUse +import com.xemantic.ai.anthropic.usage.Cost +import com.xemantic.ai.anthropic.usage.Usage import com.xemantic.kotlin.test.assert import com.xemantic.kotlin.test.be import com.xemantic.kotlin.test.have diff --git a/src/commonTest/kotlin/content/DocumentTest.kt b/src/commonTest/kotlin/content/DocumentTest.kt index 5c7d7cd..6f2ddf6 100644 --- a/src/commonTest/kotlin/content/DocumentTest.kt +++ b/src/commonTest/kotlin/content/DocumentTest.kt @@ -14,11 +14,11 @@ * limitations under the License. */ -package com.xemantic.anthropic.content +package com.xemantic.ai.anthropic.content -import com.xemantic.anthropic.Anthropic -import com.xemantic.anthropic.message.Message -import com.xemantic.anthropic.message.StopReason +import com.xemantic.ai.anthropic.Anthropic +import com.xemantic.ai.anthropic.message.Message +import com.xemantic.ai.anthropic.message.StopReason import com.xemantic.kotlin.test.assert import com.xemantic.kotlin.test.be import com.xemantic.kotlin.test.have diff --git a/src/commonTest/kotlin/content/ImageTest.kt b/src/commonTest/kotlin/content/ImageTest.kt index 8e8c663..8b014d1 100644 --- a/src/commonTest/kotlin/content/ImageTest.kt +++ b/src/commonTest/kotlin/content/ImageTest.kt @@ -14,11 +14,11 @@ * limitations under the License. */ -package com.xemantic.anthropic.content +package com.xemantic.ai.anthropic.content -import com.xemantic.anthropic.Anthropic -import com.xemantic.anthropic.message.Message -import com.xemantic.anthropic.message.StopReason +import com.xemantic.ai.anthropic.Anthropic +import com.xemantic.ai.anthropic.message.Message +import com.xemantic.ai.anthropic.message.StopReason import com.xemantic.kotlin.test.be import com.xemantic.kotlin.test.have import com.xemantic.kotlin.test.should diff --git a/src/commonTest/kotlin/content/ToolResultTest.kt b/src/commonTest/kotlin/content/ToolResultTest.kt index 8ab3712..d76ac13 100644 --- a/src/commonTest/kotlin/content/ToolResultTest.kt +++ b/src/commonTest/kotlin/content/ToolResultTest.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.xemantic.anthropic.content +package com.xemantic.ai.anthropic.content import com.xemantic.kotlin.test.be import com.xemantic.kotlin.test.have diff --git a/src/commonTest/kotlin/error/ErrorResponseTest.kt b/src/commonTest/kotlin/error/ErrorResponseTest.kt index edeb64d..b74a529 100644 --- a/src/commonTest/kotlin/error/ErrorResponseTest.kt +++ b/src/commonTest/kotlin/error/ErrorResponseTest.kt @@ -14,10 +14,10 @@ * limitations under the License. */ -package com.xemantic.anthropic.error +package com.xemantic.ai.anthropic.error -import com.xemantic.anthropic.Response -import com.xemantic.anthropic.test.testJson +import com.xemantic.ai.anthropic.Response +import com.xemantic.ai.anthropic.test.testJson import com.xemantic.kotlin.test.be import com.xemantic.kotlin.test.have import com.xemantic.kotlin.test.should diff --git a/src/commonTest/kotlin/message/MessageRequestTest.kt b/src/commonTest/kotlin/message/MessageRequestTest.kt index 0a341b9..0ef82fe 100644 --- a/src/commonTest/kotlin/message/MessageRequestTest.kt +++ b/src/commonTest/kotlin/message/MessageRequestTest.kt @@ -14,17 +14,17 @@ * limitations under the License. */ -package com.xemantic.anthropic.message +package com.xemantic.ai.anthropic.message import com.xemantic.ai.tool.schema.meta.Description -import com.xemantic.anthropic.test.testJson -import com.xemantic.anthropic.tool.AnthropicTool -import com.xemantic.anthropic.tool.Tool -import com.xemantic.anthropic.tool.ToolChoice -import com.xemantic.anthropic.tool.ToolInput -import com.xemantic.anthropic.tool.bash.Bash -import com.xemantic.anthropic.tool.computer.Computer -import com.xemantic.anthropic.tool.editor.TextEditor +import com.xemantic.ai.anthropic.test.testJson +import com.xemantic.ai.anthropic.tool.AnthropicTool +import com.xemantic.ai.anthropic.tool.Tool +import com.xemantic.ai.anthropic.tool.ToolChoice +import com.xemantic.ai.anthropic.tool.ToolInput +import com.xemantic.ai.anthropic.tool.bash.Bash +import com.xemantic.ai.anthropic.tool.computer.Computer +import com.xemantic.ai.anthropic.tool.editor.TextEditor import io.kotest.assertions.json.shouldEqualJson import kotlinx.serialization.SerialName import kotlinx.serialization.encodeToString diff --git a/src/commonTest/kotlin/message/MessageResponseTest.kt b/src/commonTest/kotlin/message/MessageResponseTest.kt index 0fb7bd7..d97c044 100644 --- a/src/commonTest/kotlin/message/MessageResponseTest.kt +++ b/src/commonTest/kotlin/message/MessageResponseTest.kt @@ -14,12 +14,12 @@ * limitations under the License. */ -package com.xemantic.anthropic.message +package com.xemantic.ai.anthropic.message -import com.xemantic.anthropic.Response -import com.xemantic.anthropic.content.ToolUse -import com.xemantic.anthropic.test.testJson -import com.xemantic.anthropic.usage.Usage +import com.xemantic.ai.anthropic.Response +import com.xemantic.ai.anthropic.content.ToolUse +import com.xemantic.ai.anthropic.test.testJson +import com.xemantic.ai.anthropic.usage.Usage import com.xemantic.kotlin.test.be import com.xemantic.kotlin.test.have import com.xemantic.kotlin.test.should diff --git a/src/commonTest/kotlin/message/MessageTest.kt b/src/commonTest/kotlin/message/MessageTest.kt index 5940992..49c1154 100644 --- a/src/commonTest/kotlin/message/MessageTest.kt +++ b/src/commonTest/kotlin/message/MessageTest.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.xemantic.anthropic.message +package com.xemantic.ai.anthropic.message import com.xemantic.kotlin.test.have import com.xemantic.kotlin.test.should diff --git a/src/commonTest/kotlin/test/AnthropicTestSupport.kt b/src/commonTest/kotlin/test/AnthropicTestSupport.kt index 714bf8f..6dcfe48 100644 --- a/src/commonTest/kotlin/test/AnthropicTestSupport.kt +++ b/src/commonTest/kotlin/test/AnthropicTestSupport.kt @@ -14,9 +14,9 @@ * limitations under the License. */ -package com.xemantic.anthropic.test +package com.xemantic.ai.anthropic.test -import com.xemantic.anthropic.anthropicJson +import com.xemantic.ai.anthropic.anthropicJson import kotlinx.serialization.ExperimentalSerializationApi import kotlinx.serialization.json.Json diff --git a/src/commonTest/kotlin/tool/AnthropicTestTools.kt b/src/commonTest/kotlin/tool/AnthropicTestTools.kt index efac595..739ffcc 100644 --- a/src/commonTest/kotlin/tool/AnthropicTestTools.kt +++ b/src/commonTest/kotlin/tool/AnthropicTestTools.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.xemantic.anthropic.tool +package com.xemantic.ai.anthropic.tool import com.xemantic.ai.tool.schema.meta.Description import kotlinx.serialization.Transient diff --git a/src/commonTest/kotlin/tool/ToolChoiceTest.kt b/src/commonTest/kotlin/tool/ToolChoiceTest.kt index 450927f..0503af5 100644 --- a/src/commonTest/kotlin/tool/ToolChoiceTest.kt +++ b/src/commonTest/kotlin/tool/ToolChoiceTest.kt @@ -14,9 +14,9 @@ * limitations under the License. */ -package com.xemantic.anthropic.tool +package com.xemantic.ai.anthropic.tool -import com.xemantic.anthropic.test.testJson +import com.xemantic.ai.anthropic.test.testJson import io.kotest.assertions.json.shouldEqualJson import kotlinx.serialization.encodeToString import kotlin.test.Test diff --git a/src/commonTest/kotlin/tool/ToolInputTest.kt b/src/commonTest/kotlin/tool/ToolInputTest.kt index 0322073..920e15a 100644 --- a/src/commonTest/kotlin/tool/ToolInputTest.kt +++ b/src/commonTest/kotlin/tool/ToolInputTest.kt @@ -14,10 +14,10 @@ * limitations under the License. */ -package com.xemantic.anthropic.tool +package com.xemantic.ai.anthropic.tool import com.xemantic.ai.tool.schema.meta.Description -import com.xemantic.anthropic.cache.CacheControl +import com.xemantic.ai.anthropic.cache.CacheControl import com.xemantic.kotlin.test.have import com.xemantic.kotlin.test.should import io.kotest.assertions.json.shouldEqualJson diff --git a/src/commonTest/kotlin/usage/CostTest.kt b/src/commonTest/kotlin/usage/CostTest.kt index 260cdd1..9cbfcea 100644 --- a/src/commonTest/kotlin/usage/CostTest.kt +++ b/src/commonTest/kotlin/usage/CostTest.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.xemantic.anthropic.usage +package com.xemantic.ai.anthropic.usage import com.xemantic.ai.money.Money import com.xemantic.ai.money.ZERO diff --git a/src/commonTest/kotlin/usage/UsageCollectorTest.kt b/src/commonTest/kotlin/usage/UsageCollectorTest.kt index ad2bca6..6168869 100644 --- a/src/commonTest/kotlin/usage/UsageCollectorTest.kt +++ b/src/commonTest/kotlin/usage/UsageCollectorTest.kt @@ -14,12 +14,12 @@ * limitations under the License. */ -package com.xemantic.anthropic.usage +package com.xemantic.ai.anthropic.usage import com.xemantic.ai.money.Money import com.xemantic.ai.money.Ratio import com.xemantic.ai.money.ZERO -import com.xemantic.anthropic.Model +import com.xemantic.ai.anthropic.Model import com.xemantic.kotlin.test.assert import com.xemantic.kotlin.test.have import com.xemantic.kotlin.test.should diff --git a/src/jsMain/kotlin/JsAnthropic.kt b/src/jsMain/kotlin/JsAnthropic.kt index b3db428..4a8bfff 100644 --- a/src/jsMain/kotlin/JsAnthropic.kt +++ b/src/jsMain/kotlin/JsAnthropic.kt @@ -1,4 +1,4 @@ -package com.xemantic.anthropic +package com.xemantic.ai.anthropic actual val envApiKey: String? get() = js("process.env.ANTHROPIC_API_KEY") diff --git a/src/jvmMain/kotlin/JvmAnthropic.kt b/src/jvmMain/kotlin/JvmAnthropic.kt index fa32db6..db5b2b4 100644 --- a/src/jvmMain/kotlin/JvmAnthropic.kt +++ b/src/jvmMain/kotlin/JvmAnthropic.kt @@ -14,10 +14,10 @@ * limitations under the License. */ -package com.xemantic.anthropic +package com.xemantic.ai.anthropic -import com.xemantic.anthropic.message.MessageRequest -import com.xemantic.anthropic.message.MessageResponse +import com.xemantic.ai.anthropic.message.MessageRequest +import com.xemantic.ai.anthropic.message.MessageResponse import kotlinx.coroutines.runBlocking import java.util.function.Consumer diff --git a/src/jvmMain/kotlin/content/JvmDocument.kt b/src/jvmMain/kotlin/content/JvmDocument.kt index e10608f..ff3cb1e 100644 --- a/src/jvmMain/kotlin/content/JvmDocument.kt +++ b/src/jvmMain/kotlin/content/JvmDocument.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.xemantic.anthropic.content +package com.xemantic.ai.anthropic.content import java.io.File import kotlin.io.encoding.ExperimentalEncodingApi diff --git a/src/jvmMain/kotlin/content/JvmImage.kt b/src/jvmMain/kotlin/content/JvmImage.kt index afd7485..4a7730b 100644 --- a/src/jvmMain/kotlin/content/JvmImage.kt +++ b/src/jvmMain/kotlin/content/JvmImage.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.xemantic.anthropic.content +package com.xemantic.ai.anthropic.content import java.io.File diff --git a/src/jvmMain/kotlin/tool/computer/JvmComputer.kt b/src/jvmMain/kotlin/tool/computer/JvmComputer.kt index b0ded25..a971c79 100644 --- a/src/jvmMain/kotlin/tool/computer/JvmComputer.kt +++ b/src/jvmMain/kotlin/tool/computer/JvmComputer.kt @@ -14,9 +14,9 @@ * limitations under the License. */ -package com.xemantic.anthropic.tool.computer +package com.xemantic.ai.anthropic.tool.computer -import com.xemantic.anthropic.content.Image +import com.xemantic.ai.anthropic.content.Image import java.awt.Rectangle import java.awt.Robot import java.awt.Toolkit diff --git a/src/jvmMain/kotlin/tool/editor/JvmTextEditor.kt b/src/jvmMain/kotlin/tool/editor/JvmTextEditor.kt index bacdfc5..85b1379 100644 --- a/src/jvmMain/kotlin/tool/editor/JvmTextEditor.kt +++ b/src/jvmMain/kotlin/tool/editor/JvmTextEditor.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.xemantic.anthropic.tool.editor +package com.xemantic.ai.anthropic.tool.editor object JvmTextEditorService : TextEditorService { diff --git a/src/jvmTest/kotlin/JvmTestPackage.kt b/src/jvmTest/kotlin/JvmTestPackage.kt index 95e2816..dab177a 100644 --- a/src/jvmTest/kotlin/JvmTestPackage.kt +++ b/src/jvmTest/kotlin/JvmTestPackage.kt @@ -14,4 +14,4 @@ * limitations under the License. */ -package com.xemantic.anthropic \ No newline at end of file +package com.xemantic.ai.anthropic \ No newline at end of file diff --git a/src/jvmTest/kotlin/content/JvmDocumentTest.kt b/src/jvmTest/kotlin/content/JvmDocumentTest.kt index 8d31b14..5bcde1c 100644 --- a/src/jvmTest/kotlin/content/JvmDocumentTest.kt +++ b/src/jvmTest/kotlin/content/JvmDocumentTest.kt @@ -14,11 +14,11 @@ * limitations under the License. */ -package com.xemantic.anthropic.content +package com.xemantic.ai.anthropic.content -import com.xemantic.anthropic.message.Message -import com.xemantic.anthropic.message.MessageRequest -import com.xemantic.anthropic.test.testJson +import com.xemantic.ai.anthropic.message.Message +import com.xemantic.ai.anthropic.message.MessageRequest +import com.xemantic.ai.anthropic.test.testJson import io.kotest.assertions.json.shouldEqualJson import kotlinx.coroutines.test.runTest import kotlinx.serialization.encodeToString diff --git a/src/jvmTest/kotlin/content/MagicNumberTest.kt b/src/jvmTest/kotlin/content/MagicNumberTest.kt index f57ff08..fe609a3 100644 --- a/src/jvmTest/kotlin/content/MagicNumberTest.kt +++ b/src/jvmTest/kotlin/content/MagicNumberTest.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.xemantic.anthropic.content +package com.xemantic.ai.anthropic.content import java.io.File import kotlin.test.Test diff --git a/src/nativeMain/kotlin/NativeAnthropic.kt b/src/nativeMain/kotlin/NativeAnthropic.kt index 576097c..b073008 100644 --- a/src/nativeMain/kotlin/NativeAnthropic.kt +++ b/src/nativeMain/kotlin/NativeAnthropic.kt @@ -1,4 +1,4 @@ -package com.xemantic.anthropic +package com.xemantic.ai.anthropic import kotlinx.cinterop.ExperimentalForeignApi import kotlinx.cinterop.toKString diff --git a/src/wasmJsMain/kotlin/WasmJsAnthropic.kt b/src/wasmJsMain/kotlin/WasmJsAnthropic.kt index 105722b..98bee79 100644 --- a/src/wasmJsMain/kotlin/WasmJsAnthropic.kt +++ b/src/wasmJsMain/kotlin/WasmJsAnthropic.kt @@ -1,4 +1,4 @@ -package com.xemantic.anthropic +package com.xemantic.ai.anthropic actual val envApiKey: String? get() = null