Documentation ¶
Overview ¶
Package aws provides the AWS adaptor for the relay service.
Index ¶
Constants ¶
View Source
const (
ConvertedRequest = "convertedRequest"
)
Variables ¶
View Source
var AwsModelIDMap = map[string]awsModelItem{ "claude-instant-1.2": { ModelConfig: model.ModelConfig{ Model: "claude-instant-1.2", Type: relaymode.ChatCompletions, Owner: model.ModelOwnerAnthropic, }, ID: "anthropic.claude-instant-v1", }, "claude-2.0": { ModelConfig: model.ModelConfig{ Model: "claude-2.0", Type: relaymode.ChatCompletions, Owner: model.ModelOwnerAnthropic, }, ID: "anthropic.claude-v2", }, "claude-2.1": { ModelConfig: model.ModelConfig{ Model: "claude-2.1", Type: relaymode.ChatCompletions, Owner: model.ModelOwnerAnthropic, }, ID: "anthropic.claude-v2:1", }, "claude-3-haiku-20240307": { ModelConfig: model.ModelConfig{ Model: "claude-3-haiku-20240307", Type: relaymode.ChatCompletions, Owner: model.ModelOwnerAnthropic, }, ID: "anthropic.claude-3-haiku-20240307-v1:0", }, "claude-3-5-sonnet-latest": { ModelConfig: model.ModelConfig{ Model: "claude-3-5-sonnet-latest", Type: relaymode.ChatCompletions, Owner: model.ModelOwnerAnthropic, }, ID: "anthropic.claude-3-5-sonnet-20241022-v2:0", }, "claude-3-5-haiku-20241022": { ModelConfig: model.ModelConfig{ Model: "claude-3-5-haiku-20241022", Type: relaymode.ChatCompletions, Owner: model.ModelOwnerAnthropic, }, ID: "anthropic.claude-3-5-haiku-20241022-v1:0", }, }
Functions ¶
func Handler ¶
func Handler(meta *meta.Meta, c *gin.Context) (*relaymodel.ErrorWithStatusCode, *relaymodel.Usage)
func StreamHandler ¶
func StreamHandler(meta *meta.Meta, c *gin.Context) (*relaymodel.ErrorWithStatusCode, *relaymodel.Usage)
Types ¶
type Request ¶
type Request struct { ToolChoice any `json:"tool_choice,omitempty"` Temperature *float64 `json:"temperature,omitempty"` TopP *float64 `json:"top_p,omitempty"` AnthropicVersion string `json:"anthropic_version"` System string `json:"system,omitempty"` Messages []anthropic.Message `json:"messages"` StopSequences []string `json:"stop_sequences,omitempty"` Tools []anthropic.Tool `json:"tools,omitempty"` MaxTokens int `json:"max_tokens,omitempty"` TopK int `json:"top_k,omitempty"` }
Request is the request to AWS Claude
https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters-anthropic-claude-messages.html
Click to show internal directories.
Click to hide internal directories.