aws

package
v2.19.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 21, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const BedrockModelFullName = "Anthropic Claude 3 Sonnet"
View Source
const BedrockModelID = "anthropic.claude-3-sonnet-20240229-v1:0"
View Source
const EnvVarCustomModel = "STRATUS_RED_TEAM_BEDROCK_MODEL"

Variables

This section is empty.

Functions

This section is empty.

Types

type BedrockUseCaseRequest

type BedrockUseCaseRequest struct {
	CompanyName         string `json:"companyName"`
	CompanyWebsite      string `json:"companyWebsite"`
	IntendedUsers       string `json:"intendedUsers"`
	IndustryOption      string `json:"industryOption"`
	OtherIndustryOption string `json:"otherIndustryOption"`
	UseCases            string `json:"useCases"`
}

type ClaudeMessage

type ClaudeMessage struct {
	Role    string `json:"role"`
	Content string `json:"content"`
}

type ClaudeMessageRequest

type ClaudeMessageRequest struct {
	AnthropicVersion  string          `json:"anthropic_version"`
	MaxTokensToSample int             `json:"max_tokens"`
	SystemPrompt      string          `json:"system"`
	Messages          []ClaudeMessage `json:"messages"`
}

type ClaudeResponse

type ClaudeResponse struct {
	Content []struct {
		Text string `json:"text"`
	} `json:"content"`
}

type CustomBedrockClient

type CustomBedrockClient struct {
	ModelID              string
	BedrockRuntimeClient *bedrockruntime.Client

	UserAgent string
	// contains filtered or unexported fields
}

func (*CustomBedrockClient) CreateFoundationModelAgreement

func (m *CustomBedrockClient) CreateFoundationModelAgreement(offerToken string) (string, error)

CreateFoundationModelAgreement requests access to the model by defining a subscription agreement in AWS Marketplace. Note: At the time of writing, this function is not available in the AWS SDK for Go v2

func (*CustomBedrockClient) EnsureModelEnabled

func (m *CustomBedrockClient) EnsureModelEnabled() error

func (*CustomBedrockClient) GetFoundationModelAvailability

func (m *CustomBedrockClient) GetFoundationModelAvailability() (*GetFoundationModelAvailabilityResponse, error)

GetFoundationModelAvailability retrieves model availability information. Note: At the time of writing, this function is not available in the AWS SDK for Go v2

func (*CustomBedrockClient) InvokeModel

func (m *CustomBedrockClient) InvokeModel(prompt string) (string, error)

func (*CustomBedrockClient) ListFoundationModelAgreementOffers

func (m *CustomBedrockClient) ListFoundationModelAgreementOffers() (string, error)

ListFoundationModelAgreementOffers retrieves information about the agreement offers for the provided model. Note: At the time of writing, this function is not available in the AWS SDK for Go v2

func (*CustomBedrockClient) PutFoundationModelEntitlement

func (m *CustomBedrockClient) PutFoundationModelEntitlement() (string, error)

PutFoundationModelEntitlement enables the entitlement for the model. Note: At the time of writing, this function is not available in the AWS SDK for Go v2

func (*CustomBedrockClient) PutUseCaseForModelAccess

func (m *CustomBedrockClient) PutUseCaseForModelAccess(bedrockUseCase *BedrockUseCaseRequest) (string, error)

PutUseCaseForModelAccess submits a use case for model access. Note: At the time of writing, this function is not available in the AWS SDK for Go v2

type GetFoundationModelAvailabilityResponse

type GetFoundationModelAvailabilityResponse struct {
	RegionAvailability    string `json:"regionAvailability"`
	AgreementAvailability struct {
		Status       string `json:"status"`
		ErrorMessage string `json:"errorMessage"`
	} `json:"agreementAvailability"`
	EntitlementAvailability string `json:"entitlementAvailability"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL