Documentation ¶
Index ¶
Constants ¶
const ( Ai21CompletionReasonLength = "length" Ai21CompletionReasonStop = "stop" Ai21CompletionReasonEndOfText = "endoftext" )
Finish reason for the completion of the generation for AI21 Models.
const ( AmazonCompletionReasonFinish = "FINISH" AmazonCompletionReasonMaxTokens = "LENGTH" AmazonCompletionReasonContentFiltered = "CONTENT_FILTERED" )
Finish reason for the completion of the generation for Amazon Models.
const ( AnthropicCompletionReasonEndTurn = "end_turn" AnthropicCompletionReasonMaxTokens = "max_tokens" AnthropicCompletionReasonStopSequence = "stop_sequence" )
Finish reason for the completion of the generation.
const ( AnthropicSystem = "system" AnthropicRoleUser = "user" AnthropicRoleAssistant = "assistant" )
Role attribute for the anthropic message.
const ( AnthropicMessageTypeText = "text" AnthropicMessageTypeImage = "image" )
Type attribute for the anthropic message.
const ( CohereCompletionReasonComplete = "COMPLETE" CohereCompletionReasonMaxTokens = "MAX_TOKENS" CohereCompletionReasonError = "ERROR" CohereCompletionReasonErrorToxic = "ERROR_TOXIC" )
Finish reason for the completion of the generation for Cohere Models.
const ( MetaCompletionReasonStop = "stop" MetaCompletionReasonLength = "length" )
Finish reason for the completion of the generation.
const (
AnthropicLatestVersion = "bedrock-2023-05-31"
)
The latest version of the model.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a Bedrock client.
func NewClient ¶
func NewClient(client *bedrockruntime.Client) *Client
NewClient creates a new Bedrock client.
func (*Client) CreateCompletion ¶
func (c *Client) CreateCompletion(ctx context.Context, modelID string, messages []Message, options llms.CallOptions, ) (*llms.ContentResponse, error)
CreateCompletion creates a new completion response from the provider after sending the messages to the provider.
type Message ¶
type Message struct { Role llms.ChatMessageType Content string // Type may be "text" or "image" Type string // MimeType is the MIME type MimeType string }
Message is a chunk of text or an data that will be sent to the provider.
The provider may then transform the message to its own format before sending it to the LLM model API.