Documentation ¶
Index ¶
Constants ¶
View Source
const ( ModelClaudeV2 = "anthropic.claude-v2" ModelClaudeV1Dot3 = "anthropic.claude-v1" ModelClaudeInstantV1Dot2 = "anthropic.claude-instant-v1" )
Variables ¶
This section is empty.
Functions ¶
func ListModels ¶
func ListModels() []string
Types ¶
type BedrockRequest ¶
type BedrockRequest struct { Prompt string `json:"prompt"` MaxTokensToSample int `json:"max_tokens_to_sample"` Temperature float64 `json:"temperature,omitempty"` TopP float64 `json:"top_p,omitempty"` TopK int `json:"top_k,omitempty"` StopSequences []string `json:"stop_sequences,omitempty"` }
func (*BedrockRequest) FromChatCompletionRequest ¶
func (b *BedrockRequest) FromChatCompletionRequest(req llm.ChatCompletionRequest)
func (*BedrockRequest) Marshal ¶
func (b *BedrockRequest) Marshal() []byte
type BedrockResponse ¶
type BedrockResponse struct { Completion string `json:"completion"` Stop string `json:"stop"` StopReason string `json:"stop_reason"` }
func (*BedrockResponse) ToChatCompletionResponse ¶
func (b *BedrockResponse) ToChatCompletionResponse() llm.ChatCompletionResponse
func (*BedrockResponse) ToChatCompletionStreamResponse ¶
func (b *BedrockResponse) ToChatCompletionStreamResponse() llm.ChatCompletionStreamResponse
func (*BedrockResponse) Unmarshal ¶
func (b *BedrockResponse) Unmarshal(resp []byte)
type Client ¶
type Client struct {
*bedrockruntime.Client
}
func (*Client) CreateChatCompletion ¶
func (c *Client) CreateChatCompletion(ctx context.Context, req llm.ChatCompletionRequest) (llm.ChatCompletionResponse, error)
func (*Client) CreateChatCompletionStream ¶
func (c *Client) CreateChatCompletionStream(ctx context.Context, req llm.ChatCompletionRequest, dataChan chan llm.ChatCompletionStreamResponse, errChan chan error)
func (*Client) ListModels ¶
Click to show internal directories.
Click to hide internal directories.