Documentation
¶
Index ¶
- Constants
- type BedrockUseCaseRequest
- type ClaudeMessage
- type ClaudeMessageRequest
- type ClaudeResponse
- type CustomBedrockClient
- func (m *CustomBedrockClient) CreateFoundationModelAgreement(offerToken string) (string, error)
- func (m *CustomBedrockClient) EnsureModelEnabled() error
- func (m *CustomBedrockClient) GetFoundationModelAvailability() (*GetFoundationModelAvailabilityResponse, error)
- func (m *CustomBedrockClient) InvokeModel(prompt string) (string, error)
- func (m *CustomBedrockClient) ListFoundationModelAgreementOffers() (string, error)
- func (m *CustomBedrockClient) PutFoundationModelEntitlement() (string, error)
- func (m *CustomBedrockClient) PutUseCaseForModelAccess(bedrockUseCase *BedrockUseCaseRequest) (string, error)
- type GetFoundationModelAvailabilityResponse
Constants ¶
const BedrockModelFullName = "Anthropic Claude 3 Sonnet"
const BedrockModelID = "anthropic.claude-3-sonnet-20240229-v1:0"
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 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"`
}