-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add @description annotation to tool properties (#10)
It is possible to use overloaded plusAssign operator to add response messages directly to a conversation (MutableList<Message>)
- Loading branch information
Showing
9 changed files
with
117 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package com.xemantic.anthropic.message | ||
|
||
import io.kotest.matchers.shouldBe | ||
import kotlinx.serialization.Serializable | ||
import kotlin.test.Test | ||
|
||
class ToolResultTest { | ||
|
||
@Test | ||
fun shouldCreateToolResultForSingleString() { | ||
ToolResult( | ||
toolUseId = "42", | ||
"foo" | ||
) shouldBe ToolResult( | ||
toolUseId = "42", | ||
content = listOf(Text(text = "foo")) | ||
) | ||
} | ||
|
||
@Serializable | ||
data class Foo(val bar: String) | ||
|
||
@Test | ||
fun shouldCreateToolResultForSerializableInstance() { | ||
ToolResult( | ||
toolUseId = "42", | ||
Foo("buzz") | ||
) shouldBe ToolResult( | ||
toolUseId = "42", | ||
content = listOf(Text(text = "{\"bar\":\"buzz\"}")) | ||
) | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters