-
-
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.
some adjustments to the most recent Anthropic API (#12)
* initial computer use support according to the latest API changes * model represented as a separate enum
- Loading branch information
Showing
7 changed files
with
158 additions
and
23 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
package com.xemantic.anthropic | ||
|
||
enum class Model( | ||
val id: String, | ||
val contextWindow: Int, | ||
val maxOutput: Int, | ||
val messageBatchesApi: Boolean, | ||
val cost: Cost | ||
) { | ||
|
||
CLAUDE_3_5_SONNET( | ||
id = "claude-3-5-sonnet-latest", | ||
contextWindow = 200000, | ||
maxOutput = 8182, | ||
messageBatchesApi = true, | ||
cost = Cost( | ||
input = 3.0, | ||
output = 15.0 | ||
) | ||
), | ||
|
||
CLAUDE_3_5_SONNET_20241022( | ||
id = "claude-3-5-sonnet-20241022", | ||
contextWindow = 200000, | ||
maxOutput = 8182, | ||
messageBatchesApi = true, | ||
cost = Cost( | ||
input = 3.0, | ||
output = 15.0 | ||
) | ||
), | ||
|
||
CLAUDE_3_5_SONNET_20240620( | ||
id = "claude-3-5-sonnet-20240620", | ||
contextWindow = 200000, | ||
maxOutput = 8182, | ||
messageBatchesApi = true, | ||
cost = Cost( | ||
input = 3.0, | ||
output = 15.0 | ||
) | ||
), | ||
|
||
CLAUDE_3_OPUS( | ||
id = "claude-3-opus-latest", | ||
contextWindow = 200000, | ||
maxOutput = 4096, | ||
messageBatchesApi = true, | ||
cost = Cost( | ||
input = 15.0, | ||
output = 75.0 | ||
) | ||
), | ||
|
||
CLAUDE_3_OPUS_20240229( | ||
id = "claude-3-opus-20240229", | ||
contextWindow = 200000, | ||
maxOutput = 4096, | ||
messageBatchesApi = true, | ||
cost = Cost( | ||
input = 15.0, | ||
output = 75.0 | ||
) | ||
), | ||
|
||
CLAUDE_3_SONNET_20240229( | ||
id = "claude-3-sonnet-20240229", | ||
contextWindow = 200000, | ||
maxOutput = 4096, | ||
messageBatchesApi = true, | ||
cost = Cost( | ||
input = 3.0, | ||
output = 15.0 | ||
) | ||
), | ||
|
||
CLAUDE_3_HAIKU_20240307( | ||
id = "claude-3-haiku-20240307", | ||
contextWindow = 200000, | ||
maxOutput = 4096, | ||
messageBatchesApi = true, | ||
cost = Cost( | ||
input = .25, | ||
output = 1.25 | ||
) | ||
); | ||
|
||
/** | ||
* Cost per MTok | ||
*/ | ||
data class Cost(val input: Double, val output: Double) | ||
|
||
companion object { | ||
val DEFAULT: Model = CLAUDE_3_5_SONNET | ||
} | ||
|
||
} |
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,33 @@ | ||
package com.xemantic.anthropic.tool.computer | ||
|
||
import kotlinx.serialization.SerialName | ||
import kotlinx.serialization.Serializable | ||
|
||
enum class Action { | ||
@SerialName("key") | ||
KEY, | ||
@SerialName("type") | ||
TYPE, | ||
@SerialName("mouse_move") | ||
MOUSE_MOVE, | ||
@SerialName("left_click") | ||
LEFT_CLICK, | ||
@SerialName("left_click_drag") | ||
LEFT_CLICK_DRAG, | ||
@SerialName("right_click") | ||
RIGHT_CLICK, | ||
@SerialName("middle_click") | ||
MIDDLE_CLICK, | ||
@SerialName("double_click") | ||
DOUBLE_CLICK, | ||
@SerialName("screenshot") | ||
SCREENSHOT, | ||
@SerialName("cursor_position") | ||
CURSOR_POSITION, | ||
} | ||
|
||
@Serializable | ||
data class Resolution( | ||
val width: Int, | ||
val height: Int | ||
) |
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