-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add amazon bedrock integrations for claude
- Loading branch information
1 parent
e34416f
commit 876fa3c
Showing
12 changed files
with
742 additions
and
11 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,44 @@ | ||
package anthropic | ||
|
||
type BedrockCompletionRequest struct { | ||
Prompt string `json:"prompt"` | ||
MaxTokensToSample int `json:"max_tokens_to_sample"` | ||
StopSequences []string `json:"stop_sequences,omitempty"` | ||
Temperature float32 `json:"temperature,omitempty"` | ||
TopP int `json:"top_p,omitempty"` | ||
TopK int `json:"top_k,omitempty"` | ||
} | ||
|
||
type BedrockCompletionResponse struct { | ||
Completion string `json:"completion"` | ||
StopReason string `json:"stop_reason"` | ||
Model string `json:"model"` | ||
Metrics *BedrockMetrics `json:"amazon-bedrock-invocationMetrics"` | ||
} | ||
|
||
type BedrockMessageRequest struct { | ||
AnthropicVersion string `json:"anthropic_version"` | ||
Messages []Message `json:"messages"` | ||
MaxTokens int `json:"max_tokens"` | ||
StopSequences []string `json:"stop_sequences,omitempty"` | ||
Temperature float32 `json:"temperature,omitempty"` | ||
TopP int `json:"top_p,omitempty"` | ||
TopK int `json:"top_k,omitempty"` | ||
Metadata *Metadata `json:"metadata,omitempty"` | ||
} | ||
|
||
type BedrockMessagesStopResponse struct { | ||
Type string `json:"type"` | ||
Metrics *BedrockMetrics `json:"amazon-bedrock-invocationMetrics"` | ||
} | ||
|
||
type BedrockMetrics struct { | ||
InputTokenCount int `json:"inputTokenCount"` | ||
OutputTokenCount int `json:"outputTokenCount"` | ||
InvocationLatency int `json:"invocationLatency"` | ||
FirstByteLatency int `json:"firstByteLatency"` | ||
} | ||
|
||
type BedrockMessageType struct { | ||
Type string `json:"type"` | ||
} |
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
Oops, something went wrong.