Documentation
¶
Overview ¶
Package aws provides the AWS adaptor for the relay service.
Index ¶
- func Handler(c *gin.Context, awsCli *bedrockruntime.Client, modelName string) (*relaymodel.ErrorWithStatusCode, *relaymodel.Usage)
- func StreamHandler(c *gin.Context, awsCli *bedrockruntime.Client) (*relaymodel.ErrorWithStatusCode, *relaymodel.Usage)
- type Adaptor
- func (a *Adaptor) ConvertImageRequest(request *model.ImageRequest) (any, error)
- func (a *Adaptor) ConvertRequest(c *gin.Context, relayMode int, request *model.GeneralOpenAIRequest) (any, error)
- func (a *Adaptor) DoRequest(c *gin.Context, meta *meta.Meta, requestBody io.Reader) (*http.Response, error)
- func (a *Adaptor) DoResponse(c *gin.Context, resp *http.Response, meta *meta.Meta) (usage *model.Usage, err *model.ErrorWithStatusCode)
- func (a *Adaptor) GetChannelName() string
- func (a *Adaptor) GetModelList() (models []string)
- func (a *Adaptor) GetRequestURL(meta *meta.Meta) (string, error)
- func (a *Adaptor) Init(meta *meta.Meta)
- func (a *Adaptor) SetupRequestHeader(c *gin.Context, req *http.Request, meta *meta.Meta) error
- type Request
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Handler ¶
func Handler(c *gin.Context, awsCli *bedrockruntime.Client, modelName string) (*relaymodel.ErrorWithStatusCode, *relaymodel.Usage)
func StreamHandler ¶
func StreamHandler(c *gin.Context, awsCli *bedrockruntime.Client) (*relaymodel.ErrorWithStatusCode, *relaymodel.Usage)
Types ¶
type Adaptor ¶
type Adaptor struct {
// contains filtered or unexported fields
}
func (*Adaptor) ConvertImageRequest ¶
func (a *Adaptor) ConvertImageRequest(request *model.ImageRequest) (any, error)
func (*Adaptor) ConvertRequest ¶
func (*Adaptor) DoResponse ¶
func (*Adaptor) GetChannelName ¶
func (*Adaptor) GetModelList ¶
type Request ¶
type Request struct { // AnthropicVersion should be "bedrock-2023-05-31" AnthropicVersion string `json:"anthropic_version"` Messages []anthropic.Message `json:"messages"` 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"` }
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.