Documentation
¶
Overview ¶
Package bedrock connects to the Amazon Bedrock Converse API.
Index ¶
- Constants
- type Config
- type Credentials
- type CredentialsProvider
- type Provider
- func (p *Provider) Capabilities() litellm.Capabilities
- func (p *Provider) Chat(ctx context.Context, req *litellm.Request) (*litellm.Response, error)
- func (p *Provider) ListModels(ctx context.Context) ([]litellm.ModelInfo, error)
- func (p *Provider) Name() string
- func (p *Provider) Stream(ctx context.Context, req *litellm.Request) (litellm.Stream, error)
Constants ¶
const ( ProviderOptionAdditionalModelRequestFields = "additionalModelRequestFields" ProviderOptionAdditionalModelResponseFieldPaths = "additionalModelResponseFieldPaths" ProviderOptionGuardrailConfig = "guardrailConfig" ProviderOptionPerformanceConfig = "performanceConfig" ProviderOptionPromptVariables = "promptVariables" ProviderOptionRequestMetadata = "requestMetadata" )
ProviderOptions are native Converse fields copied into the body. An option naming a generated object is merged into it, so model-specific fields go under "additionalModelRequestFields".
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// Region selects the endpoints and signing region, us-east-1 by default.
Region string
// BaseURL overrides the bedrock-runtime endpoint and ControlPlaneBaseURL
// the bedrock endpoint used by ListModels.
BaseURL string
ControlPlaneBaseURL string
// Credentials is required and resolved for every request.
Credentials CredentialsProvider
HTTPClient litellm.HTTPClient
}
Config configures Converse. HTTPClient, when set, sends the SigV4-signed requests; wrap it with retry.NewHTTPClient to retry.
type Credentials ¶
Credentials are AWS credentials; SessionToken is for temporary ones.
type CredentialsProvider ¶
type CredentialsProvider interface {
Credentials(context.Context) (Credentials, error)
}
CredentialsProvider supplies credentials, allowing rotation.
func StaticCredentials ¶
func StaticCredentials(accessKeyID, secretAccessKey, sessionToken string) CredentialsProvider
StaticCredentials returns a CredentialsProvider with fixed credentials.
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider implements litellm.Provider, litellm.CapabilityProvider and litellm.ModelLister.
func (*Provider) Capabilities ¶ added in v1.8.1
func (p *Provider) Capabilities() litellm.Capabilities
Capabilities reports the static protocol facts.
func (*Provider) Chat ¶
Chat sends a Converse request; Request.Model is the model or inference profile ID.
func (*Provider) ListModels ¶
ListModels lists the foundation models in the region.