feat: refactor AwsClaude to Aws to support both llama3 and claude (#1601)

* feat: refactor AwsClaude to Aws to support both llama3 and claude

* fix: aws llama3 ratio
This commit is contained in:
Qiying Wang
2024-07-06 13:19:41 +08:00
committed by GitHub
parent e090e76c86
commit 720fe2dfeb
18 changed files with 598 additions and 91 deletions

View File

@@ -0,0 +1,20 @@
package aws
import "github.com/songquanpeng/one-api/relay/adaptor/anthropic"
// Request is the request to AWS Claude
//
// https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters-anthropic-claude-messages.html
type Request struct {
// AnthropicVersion should be "bedrock-2023-05-31"
AnthropicVersion string `json:"anthropic_version"`
Messages []anthropic.Message `json:"messages"`
System string `json:"system,omitempty"`
MaxTokens int `json:"max_tokens,omitempty"`
Temperature float64 `json:"temperature,omitempty"`
TopP float64 `json:"top_p,omitempty"`
TopK int `json:"top_k,omitempty"`
StopSequences []string `json:"stop_sequences,omitempty"`
Tools []anthropic.Tool `json:"tools,omitempty"`
ToolChoice any `json:"tool_choice,omitempty"`
}