bedrockruntime

package
v1.54.12 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2024 License: Apache-2.0 Imports: 17 Imported by: 9

Documentation

Overview

Package bedrockruntime provides the client and types for making API requests to Amazon Bedrock Runtime.

Describes the API operations for running inference using Amazon Bedrock models.

See https://docs.aws.amazon.com/goto/WebAPI/bedrock-runtime-2023-09-30 for more information on this service.

See bedrockruntime package documentation for more information. https://docs.aws.amazon.com/sdk-for-go/api/service/bedrockruntime/

Using the Client

To contact Amazon Bedrock Runtime with the SDK use the New function to create a new service client. With that client you can make API requests to the service. These clients are safe to use concurrently.

See the SDK's documentation for more information on how to use the SDK. https://docs.aws.amazon.com/sdk-for-go/api/

See aws.Config documentation for more information on configuring SDK clients. https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config

See the Amazon Bedrock Runtime client BedrockRuntime for more information on creating client for this service. https://docs.aws.amazon.com/sdk-for-go/api/service/bedrockruntime/#New

Index

Constants

View Source
const (
	// ConversationRoleUser is a ConversationRole enum value
	ConversationRoleUser = "user"

	// ConversationRoleAssistant is a ConversationRole enum value
	ConversationRoleAssistant = "assistant"
)
View Source
const (
	// DocumentFormatPdf is a DocumentFormat enum value
	DocumentFormatPdf = "pdf"

	// DocumentFormatCsv is a DocumentFormat enum value
	DocumentFormatCsv = "csv"

	// DocumentFormatDoc is a DocumentFormat enum value
	DocumentFormatDoc = "doc"

	// DocumentFormatDocx is a DocumentFormat enum value
	DocumentFormatDocx = "docx"

	// DocumentFormatXls is a DocumentFormat enum value
	DocumentFormatXls = "xls"

	// DocumentFormatXlsx is a DocumentFormat enum value
	DocumentFormatXlsx = "xlsx"

	// DocumentFormatHtml is a DocumentFormat enum value
	DocumentFormatHtml = "html"

	// DocumentFormatTxt is a DocumentFormat enum value
	DocumentFormatTxt = "txt"

	// DocumentFormatMd is a DocumentFormat enum value
	DocumentFormatMd = "md"
)
View Source
const (
	// GuardrailContentFilterConfidenceNone is a GuardrailContentFilterConfidence enum value
	GuardrailContentFilterConfidenceNone = "NONE"

	// GuardrailContentFilterConfidenceLow is a GuardrailContentFilterConfidence enum value
	GuardrailContentFilterConfidenceLow = "LOW"

	// GuardrailContentFilterConfidenceMedium is a GuardrailContentFilterConfidence enum value
	GuardrailContentFilterConfidenceMedium = "MEDIUM"

	// GuardrailContentFilterConfidenceHigh is a GuardrailContentFilterConfidence enum value
	GuardrailContentFilterConfidenceHigh = "HIGH"
)
View Source
const (
	// GuardrailContentFilterTypeInsults is a GuardrailContentFilterType enum value
	GuardrailContentFilterTypeInsults = "INSULTS"

	// GuardrailContentFilterTypeHate is a GuardrailContentFilterType enum value
	GuardrailContentFilterTypeHate = "HATE"

	// GuardrailContentFilterTypeSexual is a GuardrailContentFilterType enum value
	GuardrailContentFilterTypeSexual = "SEXUAL"

	// GuardrailContentFilterTypeViolence is a GuardrailContentFilterType enum value
	GuardrailContentFilterTypeViolence = "VIOLENCE"

	// GuardrailContentFilterTypeMisconduct is a GuardrailContentFilterType enum value
	GuardrailContentFilterTypeMisconduct = "MISCONDUCT"

	// GuardrailContentFilterTypePromptAttack is a GuardrailContentFilterType enum value
	GuardrailContentFilterTypePromptAttack = "PROMPT_ATTACK"
)
View Source
const (
	// GuardrailPiiEntityTypeAddress is a GuardrailPiiEntityType enum value
	GuardrailPiiEntityTypeAddress = "ADDRESS"

	// GuardrailPiiEntityTypeAge is a GuardrailPiiEntityType enum value
	GuardrailPiiEntityTypeAge = "AGE"

	// GuardrailPiiEntityTypeAwsAccessKey is a GuardrailPiiEntityType enum value
	GuardrailPiiEntityTypeAwsAccessKey = "AWS_ACCESS_KEY"

	// GuardrailPiiEntityTypeAwsSecretKey is a GuardrailPiiEntityType enum value
	GuardrailPiiEntityTypeAwsSecretKey = "AWS_SECRET_KEY"

	// GuardrailPiiEntityTypeCaHealthNumber is a GuardrailPiiEntityType enum value
	GuardrailPiiEntityTypeCaHealthNumber = "CA_HEALTH_NUMBER"

	// GuardrailPiiEntityTypeCaSocialInsuranceNumber is a GuardrailPiiEntityType enum value
	GuardrailPiiEntityTypeCaSocialInsuranceNumber = "CA_SOCIAL_INSURANCE_NUMBER"

	// GuardrailPiiEntityTypeCreditDebitCardCvv is a GuardrailPiiEntityType enum value
	GuardrailPiiEntityTypeCreditDebitCardCvv = "CREDIT_DEBIT_CARD_CVV"

	// GuardrailPiiEntityTypeCreditDebitCardExpiry is a GuardrailPiiEntityType enum value
	GuardrailPiiEntityTypeCreditDebitCardExpiry = "CREDIT_DEBIT_CARD_EXPIRY"

	// GuardrailPiiEntityTypeCreditDebitCardNumber is a GuardrailPiiEntityType enum value
	GuardrailPiiEntityTypeCreditDebitCardNumber = "CREDIT_DEBIT_CARD_NUMBER"

	// GuardrailPiiEntityTypeDriverId is a GuardrailPiiEntityType enum value
	GuardrailPiiEntityTypeDriverId = "DRIVER_ID"

	// GuardrailPiiEntityTypeEmail is a GuardrailPiiEntityType enum value
	GuardrailPiiEntityTypeEmail = "EMAIL"

	// GuardrailPiiEntityTypeInternationalBankAccountNumber is a GuardrailPiiEntityType enum value
	GuardrailPiiEntityTypeInternationalBankAccountNumber = "INTERNATIONAL_BANK_ACCOUNT_NUMBER"

	// GuardrailPiiEntityTypeIpAddress is a GuardrailPiiEntityType enum value
	GuardrailPiiEntityTypeIpAddress = "IP_ADDRESS"

	// GuardrailPiiEntityTypeLicensePlate is a GuardrailPiiEntityType enum value
	GuardrailPiiEntityTypeLicensePlate = "LICENSE_PLATE"

	// GuardrailPiiEntityTypeMacAddress is a GuardrailPiiEntityType enum value
	GuardrailPiiEntityTypeMacAddress = "MAC_ADDRESS"

	// GuardrailPiiEntityTypeName is a GuardrailPiiEntityType enum value
	GuardrailPiiEntityTypeName = "NAME"

	// GuardrailPiiEntityTypePassword is a GuardrailPiiEntityType enum value
	GuardrailPiiEntityTypePassword = "PASSWORD"

	// GuardrailPiiEntityTypePhone is a GuardrailPiiEntityType enum value
	GuardrailPiiEntityTypePhone = "PHONE"

	// GuardrailPiiEntityTypePin is a GuardrailPiiEntityType enum value
	GuardrailPiiEntityTypePin = "PIN"

	// GuardrailPiiEntityTypeSwiftCode is a GuardrailPiiEntityType enum value
	GuardrailPiiEntityTypeSwiftCode = "SWIFT_CODE"

	// GuardrailPiiEntityTypeUkNationalHealthServiceNumber is a GuardrailPiiEntityType enum value
	GuardrailPiiEntityTypeUkNationalHealthServiceNumber = "UK_NATIONAL_HEALTH_SERVICE_NUMBER"

	// GuardrailPiiEntityTypeUkNationalInsuranceNumber is a GuardrailPiiEntityType enum value
	GuardrailPiiEntityTypeUkNationalInsuranceNumber = "UK_NATIONAL_INSURANCE_NUMBER"

	// GuardrailPiiEntityTypeUkUniqueTaxpayerReferenceNumber is a GuardrailPiiEntityType enum value
	GuardrailPiiEntityTypeUkUniqueTaxpayerReferenceNumber = "UK_UNIQUE_TAXPAYER_REFERENCE_NUMBER"

	// GuardrailPiiEntityTypeUrl is a GuardrailPiiEntityType enum value
	GuardrailPiiEntityTypeUrl = "URL"

	// GuardrailPiiEntityTypeUsername is a GuardrailPiiEntityType enum value
	GuardrailPiiEntityTypeUsername = "USERNAME"

	// GuardrailPiiEntityTypeUsBankAccountNumber is a GuardrailPiiEntityType enum value
	GuardrailPiiEntityTypeUsBankAccountNumber = "US_BANK_ACCOUNT_NUMBER"

	// GuardrailPiiEntityTypeUsBankRoutingNumber is a GuardrailPiiEntityType enum value
	GuardrailPiiEntityTypeUsBankRoutingNumber = "US_BANK_ROUTING_NUMBER"

	// GuardrailPiiEntityTypeUsIndividualTaxIdentificationNumber is a GuardrailPiiEntityType enum value
	GuardrailPiiEntityTypeUsIndividualTaxIdentificationNumber = "US_INDIVIDUAL_TAX_IDENTIFICATION_NUMBER"

	// GuardrailPiiEntityTypeUsPassportNumber is a GuardrailPiiEntityType enum value
	GuardrailPiiEntityTypeUsPassportNumber = "US_PASSPORT_NUMBER"

	// GuardrailPiiEntityTypeUsSocialSecurityNumber is a GuardrailPiiEntityType enum value
	GuardrailPiiEntityTypeUsSocialSecurityNumber = "US_SOCIAL_SECURITY_NUMBER"

	// GuardrailPiiEntityTypeVehicleIdentificationNumber is a GuardrailPiiEntityType enum value
	GuardrailPiiEntityTypeVehicleIdentificationNumber = "VEHICLE_IDENTIFICATION_NUMBER"
)
View Source
const (
	// GuardrailSensitiveInformationPolicyActionAnonymized is a GuardrailSensitiveInformationPolicyAction enum value
	GuardrailSensitiveInformationPolicyActionAnonymized = "ANONYMIZED"

	// GuardrailSensitiveInformationPolicyActionBlocked is a GuardrailSensitiveInformationPolicyAction enum value
	GuardrailSensitiveInformationPolicyActionBlocked = "BLOCKED"
)
View Source
const (
	// GuardrailStreamProcessingModeSync is a GuardrailStreamProcessingMode enum value
	GuardrailStreamProcessingModeSync = "sync"

	// GuardrailStreamProcessingModeAsync is a GuardrailStreamProcessingMode enum value
	GuardrailStreamProcessingModeAsync = "async"
)
View Source
const (
	// GuardrailTraceEnabled is a GuardrailTrace enum value
	GuardrailTraceEnabled = "enabled"

	// GuardrailTraceDisabled is a GuardrailTrace enum value
	GuardrailTraceDisabled = "disabled"
)
View Source
const (
	// ImageFormatPng is a ImageFormat enum value
	ImageFormatPng = "png"

	// ImageFormatJpeg is a ImageFormat enum value
	ImageFormatJpeg = "jpeg"

	// ImageFormatGif is a ImageFormat enum value
	ImageFormatGif = "gif"

	// ImageFormatWebp is a ImageFormat enum value
	ImageFormatWebp = "webp"
)
View Source
const (
	// StopReasonEndTurn is a StopReason enum value
	StopReasonEndTurn = "end_turn"

	// StopReasonToolUse is a StopReason enum value
	StopReasonToolUse = "tool_use"

	// StopReasonMaxTokens is a StopReason enum value
	StopReasonMaxTokens = "max_tokens"

	// StopReasonStopSequence is a StopReason enum value
	StopReasonStopSequence = "stop_sequence"

	// StopReasonGuardrailIntervened is a StopReason enum value
	StopReasonGuardrailIntervened = "guardrail_intervened"

	// StopReasonContentFiltered is a StopReason enum value
	StopReasonContentFiltered = "content_filtered"
)
View Source
const (
	// ToolResultStatusSuccess is a ToolResultStatus enum value
	ToolResultStatusSuccess = "success"

	// ToolResultStatusError is a ToolResultStatus enum value
	ToolResultStatusError = "error"
)
View Source
const (
	// TraceEnabled is a Trace enum value
	TraceEnabled = "ENABLED"

	// TraceDisabled is a Trace enum value
	TraceDisabled = "DISABLED"
)
View Source
const (

	// ErrCodeAccessDeniedException for service response error code
	// "AccessDeniedException".
	//
	// The request is denied because of missing access permissions.
	ErrCodeAccessDeniedException = "AccessDeniedException"

	// ErrCodeInternalServerException for service response error code
	// "InternalServerException".
	//
	// An internal server error occurred. Retry your request.
	ErrCodeInternalServerException = "InternalServerException"

	// ErrCodeModelErrorException for service response error code
	// "ModelErrorException".
	//
	// The request failed due to an error while processing the model.
	ErrCodeModelErrorException = "ModelErrorException"

	// ErrCodeModelNotReadyException for service response error code
	// "ModelNotReadyException".
	//
	// The model specified in the request is not ready to serve inference requests.
	ErrCodeModelNotReadyException = "ModelNotReadyException"

	// ErrCodeModelStreamErrorException for service response error code
	// "ModelStreamErrorException".
	//
	// An error occurred while streaming the response. Retry your request.
	ErrCodeModelStreamErrorException = "ModelStreamErrorException"

	// ErrCodeModelTimeoutException for service response error code
	// "ModelTimeoutException".
	//
	// The request took too long to process. Processing time exceeded the model
	// timeout length.
	ErrCodeModelTimeoutException = "ModelTimeoutException"

	// ErrCodeResourceNotFoundException for service response error code
	// "ResourceNotFoundException".
	//
	// The specified resource ARN was not found. Check the ARN and try your request
	// again.
	ErrCodeResourceNotFoundException = "ResourceNotFoundException"

	// ErrCodeServiceQuotaExceededException for service response error code
	// "ServiceQuotaExceededException".
	//
	// The number of requests exceeds the service quota. Resubmit your request later.
	ErrCodeServiceQuotaExceededException = "ServiceQuotaExceededException"

	// ErrCodeThrottlingException for service response error code
	// "ThrottlingException".
	//
	// The number of requests exceeds the limit. Resubmit your request later.
	ErrCodeThrottlingException = "ThrottlingException"

	// ErrCodeValidationException for service response error code
	// "ValidationException".
	//
	// Input validation failed. Check your request parameters and retry the request.
	ErrCodeValidationException = "ValidationException"
)
View Source
const (
	ServiceName = "Bedrock Runtime" // Name of service.
	EndpointsID = "bedrock-runtime" // ID to lookup a service endpoint with.
	ServiceID   = "Bedrock Runtime" // ServiceID is a unique identifier of a specific service.
)

Service information constants

View Source
const (
	// GuardrailContentPolicyActionBlocked is a GuardrailContentPolicyAction enum value
	GuardrailContentPolicyActionBlocked = "BLOCKED"
)
View Source
const (
	// GuardrailManagedWordTypeProfanity is a GuardrailManagedWordType enum value
	GuardrailManagedWordTypeProfanity = "PROFANITY"
)
View Source
const (
	// GuardrailTopicPolicyActionBlocked is a GuardrailTopicPolicyAction enum value
	GuardrailTopicPolicyActionBlocked = "BLOCKED"
)
View Source
const (
	// GuardrailTopicTypeDeny is a GuardrailTopicType enum value
	GuardrailTopicTypeDeny = "DENY"
)
View Source
const (
	// GuardrailWordPolicyActionBlocked is a GuardrailWordPolicyAction enum value
	GuardrailWordPolicyActionBlocked = "BLOCKED"
)

Variables

This section is empty.

Functions

func ConversationRole_Values added in v1.53.13

func ConversationRole_Values() []string

ConversationRole_Values returns all elements of the ConversationRole enum

func DocumentFormat_Values added in v1.54.6

func DocumentFormat_Values() []string

DocumentFormat_Values returns all elements of the DocumentFormat enum

func GuardrailContentFilterConfidence_Values added in v1.54.4

func GuardrailContentFilterConfidence_Values() []string

GuardrailContentFilterConfidence_Values returns all elements of the GuardrailContentFilterConfidence enum

func GuardrailContentFilterType_Values added in v1.54.4

func GuardrailContentFilterType_Values() []string

GuardrailContentFilterType_Values returns all elements of the GuardrailContentFilterType enum

func GuardrailContentPolicyAction_Values added in v1.54.4

func GuardrailContentPolicyAction_Values() []string

GuardrailContentPolicyAction_Values returns all elements of the GuardrailContentPolicyAction enum

func GuardrailManagedWordType_Values added in v1.54.4

func GuardrailManagedWordType_Values() []string

GuardrailManagedWordType_Values returns all elements of the GuardrailManagedWordType enum

func GuardrailPiiEntityType_Values added in v1.54.4

func GuardrailPiiEntityType_Values() []string

GuardrailPiiEntityType_Values returns all elements of the GuardrailPiiEntityType enum

func GuardrailSensitiveInformationPolicyAction_Values added in v1.54.4

func GuardrailSensitiveInformationPolicyAction_Values() []string

GuardrailSensitiveInformationPolicyAction_Values returns all elements of the GuardrailSensitiveInformationPolicyAction enum

func GuardrailStreamProcessingMode_Values added in v1.54.4

func GuardrailStreamProcessingMode_Values() []string

GuardrailStreamProcessingMode_Values returns all elements of the GuardrailStreamProcessingMode enum

func GuardrailTopicPolicyAction_Values added in v1.54.4

func GuardrailTopicPolicyAction_Values() []string

GuardrailTopicPolicyAction_Values returns all elements of the GuardrailTopicPolicyAction enum

func GuardrailTopicType_Values added in v1.54.4

func GuardrailTopicType_Values() []string

GuardrailTopicType_Values returns all elements of the GuardrailTopicType enum

func GuardrailTrace_Values added in v1.54.4

func GuardrailTrace_Values() []string

GuardrailTrace_Values returns all elements of the GuardrailTrace enum

func GuardrailWordPolicyAction_Values added in v1.54.4

func GuardrailWordPolicyAction_Values() []string

GuardrailWordPolicyAction_Values returns all elements of the GuardrailWordPolicyAction enum

func ImageFormat_Values added in v1.53.13

func ImageFormat_Values() []string

ImageFormat_Values returns all elements of the ImageFormat enum

func StopReason_Values added in v1.53.13

func StopReason_Values() []string

StopReason_Values returns all elements of the StopReason enum

func ToolResultStatus_Values added in v1.53.13

func ToolResultStatus_Values() []string

ToolResultStatus_Values returns all elements of the ToolResultStatus enum

func Trace_Values added in v1.51.27

func Trace_Values() []string

Trace_Values returns all elements of the Trace enum

Types

type AccessDeniedException

type AccessDeniedException struct {
	RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"`

	Message_ *string `locationName:"message" type:"string"`
	// contains filtered or unexported fields
}

The request is denied because of missing access permissions.

func (*AccessDeniedException) Code

func (s *AccessDeniedException) Code() string

Code returns the exception type name.

func (*AccessDeniedException) Error

func (s *AccessDeniedException) Error() string

func (AccessDeniedException) GoString

func (s AccessDeniedException) GoString() string

GoString returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (*AccessDeniedException) Message

func (s *AccessDeniedException) Message() string

Message returns the exception's message.

func (*AccessDeniedException) OrigErr

func (s *AccessDeniedException) OrigErr() error

OrigErr always returns nil, satisfies awserr.Error interface.

func (*AccessDeniedException) RequestID

func (s *AccessDeniedException) RequestID() string

RequestID returns the service's response RequestID for request.

func (*AccessDeniedException) StatusCode

func (s *AccessDeniedException) StatusCode() int

Status code returns the HTTP status code for the request's response error.

func (AccessDeniedException) String

func (s AccessDeniedException) String() string

String returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

type AnyToolChoice added in v1.53.13

type AnyToolChoice struct {
	// contains filtered or unexported fields
}

The model must request at least one tool (no text is generated). For example, {"any" : {}}.

func (AnyToolChoice) GoString added in v1.53.13

func (s AnyToolChoice) GoString() string

GoString returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (AnyToolChoice) String added in v1.53.13

func (s AnyToolChoice) String() string

String returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

type AutoToolChoice added in v1.53.13

type AutoToolChoice struct {
	// contains filtered or unexported fields
}

The Model automatically decides if a tool should be called or whether to generate text instead. For example, {"auto" : {}}.

func (AutoToolChoice) GoString added in v1.53.13

func (s AutoToolChoice) GoString() string

GoString returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (AutoToolChoice) String added in v1.53.13

func (s AutoToolChoice) String() string

String returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

type BedrockRuntime

type BedrockRuntime struct {
	*client.Client
}

BedrockRuntime provides the API operation methods for making requests to Amazon Bedrock Runtime. See this package's package overview docs for details on the service.

BedrockRuntime methods are safe to use concurrently. It is not safe to modify mutate any of the struct's properties though.

func New

func New(p client.ConfigProvider, cfgs ...*aws.Config) *BedrockRuntime

New creates a new instance of the BedrockRuntime client with a session. If additional configuration is needed for the client instance use the optional aws.Config parameter to add your extra config.

Example:

mySession := session.Must(session.NewSession())

// Create a BedrockRuntime client from just a session.
svc := bedrockruntime.New(mySession)

// Create a BedrockRuntime client with additional configuration
svc := bedrockruntime.New(mySession, aws.NewConfig().WithRegion("us-west-2"))

func (*BedrockRuntime) Converse added in v1.53.13

func (c *BedrockRuntime) Converse(input *ConverseInput) (*ConverseOutput, error)

Converse API operation for Amazon Bedrock Runtime.

Sends messages to the specified Amazon Bedrock model. Converse provides a consistent interface that works with all models that support messages. This allows you to write code once and use it with different models. Should a model have unique inference parameters, you can also pass those unique parameters to the model.

For information about the Converse API, see Use the Converse API in the Amazon Bedrock User Guide. To use a guardrail, see Use a guardrail with the Converse API in the Amazon Bedrock User Guide. To use a tool with a model, see Tool use (Function calling) in the Amazon Bedrock User Guide

For example code, see Converse API examples in the Amazon Bedrock User Guide.

This operation requires permission for the bedrock:InvokeModel action.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Amazon Bedrock Runtime's API operation Converse for usage and error information.

Returned Error Types:

  • AccessDeniedException The request is denied because of missing access permissions.

  • ResourceNotFoundException The specified resource ARN was not found. Check the ARN and try your request again.

  • ThrottlingException The number of requests exceeds the limit. Resubmit your request later.

  • ModelTimeoutException The request took too long to process. Processing time exceeded the model timeout length.

  • InternalServerException An internal server error occurred. Retry your request.

  • ValidationException Input validation failed. Check your request parameters and retry the request.

  • ModelNotReadyException The model specified in the request is not ready to serve inference requests.

  • ModelErrorException The request failed due to an error while processing the model.

See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-runtime-2023-09-30/Converse

func (*BedrockRuntime) ConverseRequest added in v1.53.13

func (c *BedrockRuntime) ConverseRequest(input *ConverseInput) (req *request.Request, output *ConverseOutput)

ConverseRequest generates a "aws/request.Request" representing the client's request for the Converse operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See Converse for more information on using the Converse API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the ConverseRequest method.
req, resp := client.ConverseRequest(params)

err := req.Send()
if err == nil { // resp is now filled
    fmt.Println(resp)
}

See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-runtime-2023-09-30/Converse

func (*BedrockRuntime) ConverseStream added in v1.53.13

func (c *BedrockRuntime) ConverseStream(input *ConverseStreamInput) (*ConverseStreamOutput, error)

ConverseStream API operation for Amazon Bedrock Runtime.

Sends messages to the specified Amazon Bedrock model and returns the response in a stream. ConverseStream provides a consistent API that works with all Amazon Bedrock models that support messages. This allows you to write code once and use it with different models. Should a model have unique inference parameters, you can also pass those unique parameters to the model.

To find out if a model supports streaming, call GetFoundationModel (https://docs.aws.amazon.com/bedrock/latest/APIReference/API_GetFoundationModel.html) and check the responseStreamingSupported field in the response.

For information about the Converse API, see Use the Converse API in the Amazon Bedrock User Guide. To use a guardrail, see Use a guardrail with the Converse API in the Amazon Bedrock User Guide. To use a tool with a model, see Tool use (Function calling) in the Amazon Bedrock User Guide

For example code, see Conversation streaming example in the Amazon Bedrock User Guide.

This operation requires permission for the bedrock:InvokeModelWithResponseStream action.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Amazon Bedrock Runtime's API operation ConverseStream for usage and error information.

Returned Error Types:

  • AccessDeniedException The request is denied because of missing access permissions.

  • ResourceNotFoundException The specified resource ARN was not found. Check the ARN and try your request again.

  • ThrottlingException The number of requests exceeds the limit. Resubmit your request later.

  • ModelTimeoutException The request took too long to process. Processing time exceeded the model timeout length.

  • InternalServerException An internal server error occurred. Retry your request.

  • ValidationException Input validation failed. Check your request parameters and retry the request.

  • ModelNotReadyException The model specified in the request is not ready to serve inference requests.

  • ModelErrorException The request failed due to an error while processing the model.

See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-runtime-2023-09-30/ConverseStream

func (*BedrockRuntime) ConverseStreamRequest added in v1.53.13

func (c *BedrockRuntime) ConverseStreamRequest(input *ConverseStreamInput) (req *request.Request, output *ConverseStreamOutput)

ConverseStreamRequest generates a "aws/request.Request" representing the client's request for the ConverseStream operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See ConverseStream for more information on using the ConverseStream API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the ConverseStreamRequest method.
req, resp := client.ConverseStreamRequest(params)

err := req.Send()
if err == nil { // resp is now filled
    fmt.Println(resp)
}

See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-runtime-2023-09-30/ConverseStream

func (*BedrockRuntime) ConverseStreamWithContext added in v1.53.13

func (c *BedrockRuntime) ConverseStreamWithContext(ctx aws.Context, input *ConverseStreamInput, opts ...request.Option) (*ConverseStreamOutput, error)

ConverseStreamWithContext is the same as ConverseStream with the addition of the ability to pass a context and additional request options.

See ConverseStream for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

func (*BedrockRuntime) ConverseWithContext added in v1.53.13

func (c *BedrockRuntime) ConverseWithContext(ctx aws.Context, input *ConverseInput, opts ...request.Option) (*ConverseOutput, error)

ConverseWithContext is the same as Converse with the addition of the ability to pass a context and additional request options.

See Converse for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

func (*BedrockRuntime) InvokeModel

func (c *BedrockRuntime) InvokeModel(input *InvokeModelInput) (*InvokeModelOutput, error)

InvokeModel API operation for Amazon Bedrock Runtime.

Invokes the specified Amazon Bedrock model to run inference using the prompt and inference parameters provided in the request body. You use model inference to generate text, images, and embeddings.

For example code, see Invoke model code examples in the Amazon Bedrock User Guide.

This operation requires permission for the bedrock:InvokeModel action.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Amazon Bedrock Runtime's API operation InvokeModel for usage and error information.

Returned Error Types:

  • AccessDeniedException The request is denied because of missing access permissions.

  • ResourceNotFoundException The specified resource ARN was not found. Check the ARN and try your request again.

  • ThrottlingException The number of requests exceeds the limit. Resubmit your request later.

  • ModelTimeoutException The request took too long to process. Processing time exceeded the model timeout length.

  • InternalServerException An internal server error occurred. Retry your request.

  • ValidationException Input validation failed. Check your request parameters and retry the request.

  • ModelNotReadyException The model specified in the request is not ready to serve inference requests.

  • ServiceQuotaExceededException The number of requests exceeds the service quota. Resubmit your request later.

  • ModelErrorException The request failed due to an error while processing the model.

See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-runtime-2023-09-30/InvokeModel

func (*BedrockRuntime) InvokeModelRequest

func (c *BedrockRuntime) InvokeModelRequest(input *InvokeModelInput) (req *request.Request, output *InvokeModelOutput)

InvokeModelRequest generates a "aws/request.Request" representing the client's request for the InvokeModel operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See InvokeModel for more information on using the InvokeModel API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the InvokeModelRequest method.
req, resp := client.InvokeModelRequest(params)

err := req.Send()
if err == nil { // resp is now filled
    fmt.Println(resp)
}

See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-runtime-2023-09-30/InvokeModel

func (*BedrockRuntime) InvokeModelWithContext

func (c *BedrockRuntime) InvokeModelWithContext(ctx aws.Context, input *InvokeModelInput, opts ...request.Option) (*InvokeModelOutput, error)

InvokeModelWithContext is the same as InvokeModel with the addition of the ability to pass a context and additional request options.

See InvokeModel for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

func (*BedrockRuntime) InvokeModelWithResponseStream

InvokeModelWithResponseStream API operation for Amazon Bedrock Runtime.

Invoke the specified Amazon Bedrock model to run inference using the prompt and inference parameters provided in the request body. The response is returned in a stream.

To see if a model supports streaming, call GetFoundationModel (https://docs.aws.amazon.com/bedrock/latest/APIReference/API_GetFoundationModel.html) and check the responseStreamingSupported field in the response.

The CLI doesn't support InvokeModelWithResponseStream.

For example code, see Invoke model with streaming code example in the Amazon Bedrock User Guide.

This operation requires permissions to perform the bedrock:InvokeModelWithResponseStream action.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Amazon Bedrock Runtime's API operation InvokeModelWithResponseStream for usage and error information.

Returned Error Types:

  • AccessDeniedException The request is denied because of missing access permissions.

  • ResourceNotFoundException The specified resource ARN was not found. Check the ARN and try your request again.

  • ThrottlingException The number of requests exceeds the limit. Resubmit your request later.

  • ModelTimeoutException The request took too long to process. Processing time exceeded the model timeout length.

  • InternalServerException An internal server error occurred. Retry your request.

  • ModelStreamErrorException An error occurred while streaming the response. Retry your request.

  • ValidationException Input validation failed. Check your request parameters and retry the request.

  • ModelNotReadyException The model specified in the request is not ready to serve inference requests.

  • ServiceQuotaExceededException The number of requests exceeds the service quota. Resubmit your request later.

  • ModelErrorException The request failed due to an error while processing the model.

See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-runtime-2023-09-30/InvokeModelWithResponseStream

func (*BedrockRuntime) InvokeModelWithResponseStreamRequest

func (c *BedrockRuntime) InvokeModelWithResponseStreamRequest(input *InvokeModelWithResponseStreamInput) (req *request.Request, output *InvokeModelWithResponseStreamOutput)

InvokeModelWithResponseStreamRequest generates a "aws/request.Request" representing the client's request for the InvokeModelWithResponseStream operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See InvokeModelWithResponseStream for more information on using the InvokeModelWithResponseStream API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the InvokeModelWithResponseStreamRequest method.
req, resp := client.InvokeModelWithResponseStreamRequest(params)

err := req.Send()
if err == nil { // resp is now filled
    fmt.Println(resp)
}

See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-runtime-2023-09-30/InvokeModelWithResponseStream

func (*BedrockRuntime) InvokeModelWithResponseStreamWithContext

func (c *BedrockRuntime) InvokeModelWithResponseStreamWithContext(ctx aws.Context, input *InvokeModelWithResponseStreamInput, opts ...request.Option) (*InvokeModelWithResponseStreamOutput, error)

InvokeModelWithResponseStreamWithContext is the same as InvokeModelWithResponseStream with the addition of the ability to pass a context and additional request options.

See InvokeModelWithResponseStream for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

type ContentBlock added in v1.53.13

type ContentBlock struct {

	// A document to include in the message.
	Document *DocumentBlock `locationName:"document" type:"structure"`

	// Contains the content to assess with the guardrail. If you don't specify guardContent
	// in a call to the Converse API, the guardrail (if passed in the Converse API)
	// assesses the entire message.
	GuardContent *GuardrailConverseContentBlock `locationName:"guardContent" type:"structure"`

	// Image to include in the message.
	//
	// This field is only supported by Anthropic Claude 3 models.
	Image *ImageBlock `locationName:"image" type:"structure"`

	// Text to include in the message.
	Text *string `locationName:"text" type:"string"`

	// The result for a tool request that a model makes.
	ToolResult *ToolResultBlock `locationName:"toolResult" type:"structure"`
	// contains filtered or unexported fields
}

A block of content for a message that you pass to, or receive from, a model with the Converse API (Converse and ConverseStream).

func (ContentBlock) GoString added in v1.53.13

func (s ContentBlock) GoString() string

GoString returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (*ContentBlock) SetDocument added in v1.54.6

func (s *ContentBlock) SetDocument(v *DocumentBlock) *ContentBlock

SetDocument sets the Document field's value.

func (*ContentBlock) SetGuardContent added in v1.54.4

SetGuardContent sets the GuardContent field's value.

func (*ContentBlock) SetImage added in v1.53.13

func (s *ContentBlock) SetImage(v *ImageBlock) *ContentBlock

SetImage sets the Image field's value.

func (*ContentBlock) SetText added in v1.53.13

func (s *ContentBlock) SetText(v string) *ContentBlock

SetText sets the Text field's value.

func (*ContentBlock) SetToolResult added in v1.53.13

func (s *ContentBlock) SetToolResult(v *ToolResultBlock) *ContentBlock

SetToolResult sets the ToolResult field's value.

func (ContentBlock) String added in v1.53.13

func (s ContentBlock) String() string

String returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (*ContentBlock) Validate added in v1.53.13

func (s *ContentBlock) Validate() error

Validate inspects the fields of the type to determine if they are valid.

type ContentBlockDelta added in v1.53.13

type ContentBlockDelta struct {

	// The content text.
	Text *string `locationName:"text" type:"string"`

	// Information about a tool that the model is requesting to use.
	ToolUse *ToolUseBlockDelta `locationName:"toolUse" type:"structure"`
	// contains filtered or unexported fields
}

A bock of content in a streaming response.

func (ContentBlockDelta) GoString added in v1.53.13

func (s ContentBlockDelta) GoString() string

GoString returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (*ContentBlockDelta) SetText added in v1.53.13

SetText sets the Text field's value.

func (*ContentBlockDelta) SetToolUse added in v1.53.13

SetToolUse sets the ToolUse field's value.

func (ContentBlockDelta) String added in v1.53.13

func (s ContentBlockDelta) String() string

String returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

type ContentBlockDeltaEvent added in v1.53.13

type ContentBlockDeltaEvent struct {

	// The block index for a content block delta event.
	//
	// ContentBlockIndex is a required field
	ContentBlockIndex *int64 `locationName:"contentBlockIndex" type:"integer" required:"true"`

	// The delta for a content block delta event.
	//
	// Delta is a required field
	Delta *ContentBlockDelta `locationName:"delta" type:"structure" required:"true"`
	// contains filtered or unexported fields
}

The content block delta event.

func (ContentBlockDeltaEvent) GoString added in v1.53.13

func (s ContentBlockDeltaEvent) GoString() string

GoString returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (*ContentBlockDeltaEvent) MarshalEvent added in v1.53.13

MarshalEvent marshals the type into an stream event value. This method should only used internally within the SDK's EventStream handling.

func (*ContentBlockDeltaEvent) SetContentBlockIndex added in v1.53.13

func (s *ContentBlockDeltaEvent) SetContentBlockIndex(v int64) *ContentBlockDeltaEvent

SetContentBlockIndex sets the ContentBlockIndex field's value.

func (*ContentBlockDeltaEvent) SetDelta added in v1.53.13

SetDelta sets the Delta field's value.

func (ContentBlockDeltaEvent) String added in v1.53.13

func (s ContentBlockDeltaEvent) String() string

String returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (*ContentBlockDeltaEvent) UnmarshalEvent added in v1.53.13

func (s *ContentBlockDeltaEvent) UnmarshalEvent(
	payloadUnmarshaler protocol.PayloadUnmarshaler,
	msg eventstream.Message,
) error

UnmarshalEvent unmarshals the EventStream Message into the ContentBlockDeltaEvent value. This method is only used internally within the SDK's EventStream handling.

type ContentBlockStart added in v1.53.13

type ContentBlockStart struct {

	// Information about a tool that the model is requesting to use.
	ToolUse *ToolUseBlockStart `locationName:"toolUse" type:"structure"`
	// contains filtered or unexported fields
}

Content block start information.

func (ContentBlockStart) GoString added in v1.53.13

func (s ContentBlockStart) GoString() string

GoString returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (*ContentBlockStart) SetToolUse added in v1.53.13

SetToolUse sets the ToolUse field's value.

func (ContentBlockStart) String added in v1.53.13

func (s ContentBlockStart) String() string

String returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

type ContentBlockStartEvent added in v1.53.13

type ContentBlockStartEvent struct {

	// The index for a content block start event.
	//
	// ContentBlockIndex is a required field
	ContentBlockIndex *int64 `locationName:"contentBlockIndex" type:"integer" required:"true"`

	// Start information about a content block start event.
	//
	// Start is a required field
	Start *ContentBlockStart `locationName:"start" type:"structure" required:"true"`
	// contains filtered or unexported fields
}

Content block start event.

func (ContentBlockStartEvent) GoString added in v1.53.13

func (s ContentBlockStartEvent) GoString() string

GoString returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (*ContentBlockStartEvent) MarshalEvent added in v1.53.13

MarshalEvent marshals the type into an stream event value. This method should only used internally within the SDK's EventStream handling.

func (*ContentBlockStartEvent) SetContentBlockIndex added in v1.53.13

func (s *ContentBlockStartEvent) SetContentBlockIndex(v int64) *ContentBlockStartEvent

SetContentBlockIndex sets the ContentBlockIndex field's value.

func (*ContentBlockStartEvent) SetStart added in v1.53.13

SetStart sets the Start field's value.

func (ContentBlockStartEvent) String added in v1.53.13

func (s ContentBlockStartEvent) String() string

String returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (*ContentBlockStartEvent) UnmarshalEvent added in v1.53.13

func (s *ContentBlockStartEvent) UnmarshalEvent(
	payloadUnmarshaler protocol.PayloadUnmarshaler,
	msg eventstream.Message,
) error

UnmarshalEvent unmarshals the EventStream Message into the ContentBlockStartEvent value. This method is only used internally within the SDK's EventStream handling.

type ContentBlockStopEvent added in v1.53.13

type ContentBlockStopEvent struct {

	// The index for a content block.
	//
	// ContentBlockIndex is a required field
	ContentBlockIndex *int64 `locationName:"contentBlockIndex" type:"integer" required:"true"`
	// contains filtered or unexported fields
}

A content block stop event.

func (ContentBlockStopEvent) GoString added in v1.53.13

func (s ContentBlockStopEvent) GoString() string

GoString returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (*ContentBlockStopEvent) MarshalEvent added in v1.53.13

MarshalEvent marshals the type into an stream event value. This method should only used internally within the SDK's EventStream handling.

func (*ContentBlockStopEvent) SetContentBlockIndex added in v1.53.13

func (s *ContentBlockStopEvent) SetContentBlockIndex(v int64) *ContentBlockStopEvent

SetContentBlockIndex sets the ContentBlockIndex field's value.

func (ContentBlockStopEvent) String added in v1.53.13

func (s ContentBlockStopEvent) String() string

String returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (*ContentBlockStopEvent) UnmarshalEvent added in v1.53.13

func (s *ContentBlockStopEvent) UnmarshalEvent(
	payloadUnmarshaler protocol.PayloadUnmarshaler,
	msg eventstream.Message,
) error

UnmarshalEvent unmarshals the EventStream Message into the ContentBlockStopEvent value. This method is only used internally within the SDK's EventStream handling.

type ConverseInput added in v1.53.13

type ConverseInput struct {

	// Additional model parameters field paths to return in the response. Converse
	// returns the requested fields as a JSON Pointer object in the additionalModelResponseFields
	// field. The following is example JSON for additionalModelResponseFieldPaths.
	//
	// [ "/stop_sequence" ]
	//
	// For information about the JSON Pointer syntax, see the Internet Engineering
	// Task Force (IETF) (https://datatracker.ietf.org/doc/html/rfc6901) documentation.
	//
	// Converse rejects an empty JSON Pointer or incorrectly structured JSON Pointer
	// with a 400 error code. if the JSON Pointer is valid, but the requested field
	// is not in the model response, it is ignored by Converse.
	AdditionalModelResponseFieldPaths []*string `locationName:"additionalModelResponseFieldPaths" type:"list"`

	// Configuration information for a guardrail that you want to use in the request.
	GuardrailConfig *GuardrailConfiguration `locationName:"guardrailConfig" type:"structure"`

	// Inference parameters to pass to the model. Converse supports a base set of
	// inference parameters. If you need to pass additional parameters that the
	// model supports, use the additionalModelRequestFields request field.
	InferenceConfig *InferenceConfiguration `locationName:"inferenceConfig" type:"structure"`

	// The messages that you want to send to the model.
	//
	// Messages is a required field
	Messages []*Message `locationName:"messages" type:"list" required:"true"`

	// The identifier for the model that you want to call.
	//
	// The modelId to provide depends on the type of model that you use:
	//
	//    * If you use a base model, specify the model ID or its ARN. For a list
	//    of model IDs for base models, see Amazon Bedrock base model IDs (on-demand
	//    throughput) (https://docs.aws.amazon.com/bedrock/latest/userguide/model-ids.html#model-ids-arns)
	//    in the Amazon Bedrock User Guide.
	//
	//    * If you use a provisioned model, specify the ARN of the Provisioned Throughput.
	//    For more information, see Run inference using a Provisioned Throughput
	//    (https://docs.aws.amazon.com/bedrock/latest/userguide/prov-thru-use.html)
	//    in the Amazon Bedrock User Guide.
	//
	//    * If you use a custom model, first purchase Provisioned Throughput for
	//    it. Then specify the ARN of the resulting provisioned model. For more
	//    information, see Use a custom model in Amazon Bedrock (https://docs.aws.amazon.com/bedrock/latest/userguide/model-customization-use.html)
	//    in the Amazon Bedrock User Guide.
	//
	// ModelId is a required field
	ModelId *string `location:"uri" locationName:"modelId" min:"1" type:"string" required:"true"`

	// A system prompt to pass to the model.
	System []*SystemContentBlock `locationName:"system" type:"list"`

	// Configuration information for the tools that the model can use when generating
	// a response.
	//
	// This field is only supported by Anthropic Claude 3, Cohere Command R, Cohere
	// Command R+, and Mistral Large models.
	ToolConfig *ToolConfiguration `locationName:"toolConfig" type:"structure"`
	// contains filtered or unexported fields
}

func (ConverseInput) GoString added in v1.53.13

func (s ConverseInput) GoString() string

GoString returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (*ConverseInput) SetAdditionalModelResponseFieldPaths added in v1.53.13

func (s *ConverseInput) SetAdditionalModelResponseFieldPaths(v []*string) *ConverseInput

SetAdditionalModelResponseFieldPaths sets the AdditionalModelResponseFieldPaths field's value.

func (*ConverseInput) SetGuardrailConfig added in v1.54.4

func (s *ConverseInput) SetGuardrailConfig(v *GuardrailConfiguration) *ConverseInput

SetGuardrailConfig sets the GuardrailConfig field's value.

func (*ConverseInput) SetInferenceConfig added in v1.53.13

func (s *ConverseInput) SetInferenceConfig(v *InferenceConfiguration) *ConverseInput

SetInferenceConfig sets the InferenceConfig field's value.

func (*ConverseInput) SetMessages added in v1.53.13

func (s *ConverseInput) SetMessages(v []*Message) *ConverseInput

SetMessages sets the Messages field's value.

func (*ConverseInput) SetModelId added in v1.53.13

func (s *ConverseInput) SetModelId(v string) *ConverseInput

SetModelId sets the ModelId field's value.

func (*ConverseInput) SetSystem added in v1.53.13

func (s *ConverseInput) SetSystem(v []*SystemContentBlock) *ConverseInput

SetSystem sets the System field's value.

func (*ConverseInput) SetToolConfig added in v1.53.13

func (s *ConverseInput) SetToolConfig(v *ToolConfiguration) *ConverseInput

SetToolConfig sets the ToolConfig field's value.

func (ConverseInput) String added in v1.53.13

func (s ConverseInput) String() string

String returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (*ConverseInput) Validate added in v1.53.13

func (s *ConverseInput) Validate() error

Validate inspects the fields of the type to determine if they are valid.

type ConverseMetrics added in v1.53.13

type ConverseMetrics struct {

	// The latency of the call to Converse, in milliseconds.
	//
	// LatencyMs is a required field
	LatencyMs *int64 `locationName:"latencyMs" type:"long" required:"true"`
	// contains filtered or unexported fields
}

Metrics for a call to Converse (https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_Converse.html).

func (ConverseMetrics) GoString added in v1.53.13

func (s ConverseMetrics) GoString() string

GoString returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (*ConverseMetrics) SetLatencyMs added in v1.53.13

func (s *ConverseMetrics) SetLatencyMs(v int64) *ConverseMetrics

SetLatencyMs sets the LatencyMs field's value.

func (ConverseMetrics) String added in v1.53.13

func (s ConverseMetrics) String() string

String returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

type ConverseOutput added in v1.53.13

type ConverseOutput struct {

	// Metrics for the call to Converse.
	//
	// Metrics is a required field
	Metrics *ConverseMetrics `locationName:"metrics" type:"structure" required:"true"`

	// The result from the call to Converse.
	//
	// Output is a required field
	Output *ConverseOutput_ `locationName:"output" type:"structure" required:"true"`

	// The reason why the model stopped generating output.
	//
	// StopReason is a required field
	StopReason *string `locationName:"stopReason" type:"string" required:"true" enum:"StopReason"`

	// A trace object that contains information about the Guardrail behavior.
	Trace *ConverseTrace `locationName:"trace" type:"structure"`

	// The total number of tokens used in the call to Converse. The total includes
	// the tokens input to the model and the tokens generated by the model.
	//
	// Usage is a required field
	Usage *TokenUsage `locationName:"usage" type:"structure" required:"true"`
	// contains filtered or unexported fields
}

func (ConverseOutput) GoString added in v1.53.13

func (s ConverseOutput) GoString() string

GoString returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (*ConverseOutput) SetMetrics added in v1.53.13

func (s *ConverseOutput) SetMetrics(v *ConverseMetrics) *ConverseOutput

SetMetrics sets the Metrics field's value.

func (*ConverseOutput) SetOutput added in v1.53.13

func (s *ConverseOutput) SetOutput(v *ConverseOutput_) *ConverseOutput

SetOutput sets the Output field's value.

func (*ConverseOutput) SetStopReason added in v1.53.13

func (s *ConverseOutput) SetStopReason(v string) *ConverseOutput

SetStopReason sets the StopReason field's value.

func (*ConverseOutput) SetTrace added in v1.54.4

func (s *ConverseOutput) SetTrace(v *ConverseTrace) *ConverseOutput

SetTrace sets the Trace field's value.

func (*ConverseOutput) SetUsage added in v1.53.13

func (s *ConverseOutput) SetUsage(v *TokenUsage) *ConverseOutput

SetUsage sets the Usage field's value.

func (ConverseOutput) String added in v1.53.13

func (s ConverseOutput) String() string

String returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

type ConverseOutput_ added in v1.53.13

type ConverseOutput_ struct {

	// The message that the model generates.
	Message *Message `locationName:"message" type:"structure"`
	// contains filtered or unexported fields
}

The output from a call to Converse (https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_Converse.html).

func (ConverseOutput_) GoString added in v1.53.13

func (s ConverseOutput_) GoString() string

GoString returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (*ConverseOutput_) SetMessage added in v1.53.13

func (s *ConverseOutput_) SetMessage(v *Message) *ConverseOutput_

SetMessage sets the Message field's value.

func (ConverseOutput_) String added in v1.53.13

func (s ConverseOutput_) String() string

String returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

type ConverseStreamEventStream added in v1.53.13

type ConverseStreamEventStream struct {

	// Reader is the EventStream reader for the ConverseStreamOutput_
	// events. This value is automatically set by the SDK when the API call is made
	// Use this member when unit testing your code with the SDK to mock out the
	// EventStream Reader.
	//
	// Must not be nil.
	Reader ConverseStreamOutput_Reader
	// contains filtered or unexported fields
}

ConverseStreamEventStream provides the event stream handling for the ConverseStream.

For testing and mocking the event stream this type should be initialized via the NewConverseStreamEventStream constructor function. Using the functional options to pass in nested mock behavior.

func NewConverseStreamEventStream added in v1.53.13

func NewConverseStreamEventStream(opts ...func(*ConverseStreamEventStream)) *ConverseStreamEventStream

NewConverseStreamEventStream initializes an ConverseStreamEventStream. This function should only be used for testing and mocking the ConverseStreamEventStream stream within your application.

The Reader member must be set before reading events from the stream.

es := NewConverseStreamEventStream(func(o *ConverseStreamEventStream){
    es.Reader = myMockStreamReader
})

func (*ConverseStreamEventStream) Close added in v1.53.13

func (es *ConverseStreamEventStream) Close() (err error)

Close closes the stream. This will also cause the stream to be closed. Close must be called when done using the stream API. Not calling Close may result in resource leaks.

You can use the closing of the Reader's Events channel to terminate your application's read from the API's stream.

func (*ConverseStreamEventStream) Err added in v1.53.13

func (es *ConverseStreamEventStream) Err() error

Err returns any error that occurred while reading or writing EventStream Events from the service API's response. Returns nil if there were no errors.

func (*ConverseStreamEventStream) Events added in v1.53.13

Events returns a channel to read events from.

These events are:

  • ContentBlockDeltaEvent
  • ContentBlockStartEvent
  • ContentBlockStopEvent
  • MessageStartEvent
  • MessageStopEvent
  • ConverseStreamMetadataEvent
  • ConverseStreamOutput_UnknownEvent

type ConverseStreamInput added in v1.53.13

type ConverseStreamInput struct {

	// Additional model parameters field paths to return in the response. ConverseStream
	// returns the requested fields as a JSON Pointer object in the additionalModelResponseFields
	// field. The following is example JSON for additionalModelResponseFieldPaths.
	//
	// [ "/stop_sequence" ]
	//
	// For information about the JSON Pointer syntax, see the Internet Engineering
	// Task Force (IETF) (https://datatracker.ietf.org/doc/html/rfc6901) documentation.
	//
	// ConverseStream rejects an empty JSON Pointer or incorrectly structured JSON
	// Pointer with a 400 error code. if the JSON Pointer is valid, but the requested
	// field is not in the model response, it is ignored by ConverseStream.
	AdditionalModelResponseFieldPaths []*string `locationName:"additionalModelResponseFieldPaths" type:"list"`

	// Configuration information for a guardrail that you want to use in the request.
	GuardrailConfig *GuardrailStreamConfiguration `locationName:"guardrailConfig" type:"structure"`

	// Inference parameters to pass to the model. ConverseStream supports a base
	// set of inference parameters. If you need to pass additional parameters that
	// the model supports, use the additionalModelRequestFields request field.
	InferenceConfig *InferenceConfiguration `locationName:"inferenceConfig" type:"structure"`

	// The messages that you want to send to the model.
	//
	// Messages is a required field
	Messages []*Message `locationName:"messages" type:"list" required:"true"`

	// The ID for the model.
	//
	// The modelId to provide depends on the type of model that you use:
	//
	//    * If you use a base model, specify the model ID or its ARN. For a list
	//    of model IDs for base models, see Amazon Bedrock base model IDs (on-demand
	//    throughput) (https://docs.aws.amazon.com/bedrock/latest/userguide/model-ids.html#model-ids-arns)
	//    in the Amazon Bedrock User Guide.
	//
	//    * If you use a provisioned model, specify the ARN of the Provisioned Throughput.
	//    For more information, see Run inference using a Provisioned Throughput
	//    (https://docs.aws.amazon.com/bedrock/latest/userguide/prov-thru-use.html)
	//    in the Amazon Bedrock User Guide.
	//
	//    * If you use a custom model, first purchase Provisioned Throughput for
	//    it. Then specify the ARN of the resulting provisioned model. For more
	//    information, see Use a custom model in Amazon Bedrock (https://docs.aws.amazon.com/bedrock/latest/userguide/model-customization-use.html)
	//    in the Amazon Bedrock User Guide.
	//
	// ModelId is a required field
	ModelId *string `location:"uri" locationName:"modelId" min:"1" type:"string" required:"true"`

	// A system prompt to send to the model.
	System []*SystemContentBlock `locationName:"system" type:"list"`

	// Configuration information for the tools that the model can use when generating
	// a response.
	//
	// This field is only supported by Anthropic Claude 3 models.
	ToolConfig *ToolConfiguration `locationName:"toolConfig" type:"structure"`
	// contains filtered or unexported fields
}

func (ConverseStreamInput) GoString added in v1.53.13

func (s ConverseStreamInput) GoString() string

GoString returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (*ConverseStreamInput) SetAdditionalModelResponseFieldPaths added in v1.53.13

func (s *ConverseStreamInput) SetAdditionalModelResponseFieldPaths(v []*string) *ConverseStreamInput

SetAdditionalModelResponseFieldPaths sets the AdditionalModelResponseFieldPaths field's value.

func (*ConverseStreamInput) SetGuardrailConfig added in v1.54.4

SetGuardrailConfig sets the GuardrailConfig field's value.

func (*ConverseStreamInput) SetInferenceConfig added in v1.53.13

SetInferenceConfig sets the InferenceConfig field's value.

func (*ConverseStreamInput) SetMessages added in v1.53.13

func (s *ConverseStreamInput) SetMessages(v []*Message) *ConverseStreamInput

SetMessages sets the Messages field's value.

func (*ConverseStreamInput) SetModelId added in v1.53.13

SetModelId sets the ModelId field's value.

func (*ConverseStreamInput) SetSystem added in v1.53.13

SetSystem sets the System field's value.

func (*ConverseStreamInput) SetToolConfig added in v1.53.13

SetToolConfig sets the ToolConfig field's value.

func (ConverseStreamInput) String added in v1.53.13

func (s ConverseStreamInput) String() string

String returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (*ConverseStreamInput) Validate added in v1.53.13

func (s *ConverseStreamInput) Validate() error

Validate inspects the fields of the type to determine if they are valid.

type ConverseStreamMetadataEvent added in v1.53.13

type ConverseStreamMetadataEvent struct {

	// The metrics for the conversation stream metadata event.
	//
	// Metrics is a required field
	Metrics *ConverseStreamMetrics `locationName:"metrics" type:"structure" required:"true"`

	// The trace object in the response from ConverseStream that contains information
	// about the guardrail behavior.
	Trace *ConverseStreamTrace `locationName:"trace" type:"structure"`

	// Usage information for the conversation stream event.
	//
	// Usage is a required field
	Usage *TokenUsage `locationName:"usage" type:"structure" required:"true"`
	// contains filtered or unexported fields
}

A conversation stream metadata event.

func (ConverseStreamMetadataEvent) GoString added in v1.53.13

func (s ConverseStreamMetadataEvent) GoString() string

GoString returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (*ConverseStreamMetadataEvent) MarshalEvent added in v1.53.13

MarshalEvent marshals the type into an stream event value. This method should only used internally within the SDK's EventStream handling.

func (*ConverseStreamMetadataEvent) SetMetrics added in v1.53.13

SetMetrics sets the Metrics field's value.

func (*ConverseStreamMetadataEvent) SetTrace added in v1.54.4

SetTrace sets the Trace field's value.

func (*ConverseStreamMetadataEvent) SetUsage added in v1.53.13

SetUsage sets the Usage field's value.

func (ConverseStreamMetadataEvent) String added in v1.53.13

String returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (*ConverseStreamMetadataEvent) UnmarshalEvent added in v1.53.13

func (s *ConverseStreamMetadataEvent) UnmarshalEvent(
	payloadUnmarshaler protocol.PayloadUnmarshaler,
	msg eventstream.Message,
) error

UnmarshalEvent unmarshals the EventStream Message into the ConverseStreamMetadataEvent value. This method is only used internally within the SDK's EventStream handling.

type ConverseStreamMetrics added in v1.53.13

type ConverseStreamMetrics struct {

	// The latency for the streaming request, in milliseconds.
	//
	// LatencyMs is a required field
	LatencyMs *int64 `locationName:"latencyMs" type:"long" required:"true"`
	// contains filtered or unexported fields
}

Metrics for the stream.

func (ConverseStreamMetrics) GoString added in v1.53.13

func (s ConverseStreamMetrics) GoString() string

GoString returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (*ConverseStreamMetrics) SetLatencyMs added in v1.53.13

SetLatencyMs sets the LatencyMs field's value.

func (ConverseStreamMetrics) String added in v1.53.13

func (s ConverseStreamMetrics) String() string

String returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

type ConverseStreamOutput added in v1.53.13

type ConverseStreamOutput struct {
	// contains filtered or unexported fields
}

func (*ConverseStreamOutput) GetStream added in v1.53.13

GetStream returns the type to interact with the event stream.

func (ConverseStreamOutput) GoString added in v1.53.13

func (s ConverseStreamOutput) GoString() string

GoString returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (ConverseStreamOutput) String added in v1.53.13

func (s ConverseStreamOutput) String() string

String returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

type ConverseStreamOutput_Event added in v1.53.13

type ConverseStreamOutput_Event interface {
	eventstreamapi.Marshaler
	eventstreamapi.Unmarshaler
	// contains filtered or unexported methods
}

ConverseStreamOutput_Event groups together all EventStream events writes for ConverseStreamOutput_.

These events are:

  • ContentBlockDeltaEvent
  • ContentBlockStartEvent
  • ContentBlockStopEvent
  • MessageStartEvent
  • MessageStopEvent
  • ConverseStreamMetadataEvent

type ConverseStreamOutput_Reader added in v1.53.13

type ConverseStreamOutput_Reader interface {
	// Returns a channel of events as they are read from the event stream.
	Events() <-chan ConverseStreamOutput_Event

	// Close will stop the reader reading events from the stream.
	Close() error

	// Returns any error that has occurred while reading from the event stream.
	Err() error
}

ConverseStreamOutput_Reader provides the interface for reading to the stream. The default implementation for this interface will be ConverseStreamOutput_.

The reader's Close method must allow multiple concurrent calls.

These events are:

  • ContentBlockDeltaEvent
  • ContentBlockStartEvent
  • ContentBlockStopEvent
  • MessageStartEvent
  • MessageStopEvent
  • ConverseStreamMetadataEvent
  • ConverseStreamOutput_UnknownEvent

type ConverseStreamOutput_UnknownEvent added in v1.53.13

type ConverseStreamOutput_UnknownEvent struct {
	Type    string
	Message eventstream.Message
}

ConverseStreamOutput_UnknownEvent provides a failsafe event for the ConverseStreamOutput_ group of events when an unknown event is received.

func (*ConverseStreamOutput_UnknownEvent) MarshalEvent added in v1.53.13

MarshalEvent marshals the type into an stream event value. This method should only used internally within the SDK's EventStream handling.

func (*ConverseStreamOutput_UnknownEvent) UnmarshalEvent added in v1.53.13

func (e *ConverseStreamOutput_UnknownEvent) UnmarshalEvent(
	payloadUnmarshaler protocol.PayloadUnmarshaler,
	msg eventstream.Message,
) error

UnmarshalEvent unmarshals the EventStream Message into the ConverseStreamOutput_ value. This method is only used internally within the SDK's EventStream handling.

type ConverseStreamTrace added in v1.54.4

type ConverseStreamTrace struct {

	// The guardrail trace object.
	Guardrail *GuardrailTraceAssessment `locationName:"guardrail" type:"structure"`
	// contains filtered or unexported fields
}

The trace object in a response from ConverseStream. Currently, you can only trace guardrails.

func (ConverseStreamTrace) GoString added in v1.54.4

func (s ConverseStreamTrace) GoString() string

GoString returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (*ConverseStreamTrace) SetGuardrail added in v1.54.4

SetGuardrail sets the Guardrail field's value.

func (ConverseStreamTrace) String added in v1.54.4

func (s ConverseStreamTrace) String() string

String returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

type ConverseTrace added in v1.54.4

type ConverseTrace struct {

	// The guardrail trace object.
	Guardrail *GuardrailTraceAssessment `locationName:"guardrail" type:"structure"`
	// contains filtered or unexported fields
}

The trace object in a response from Converse. Currently, you can only trace guardrails.

func (ConverseTrace) GoString added in v1.54.4

func (s ConverseTrace) GoString() string

GoString returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (*ConverseTrace) SetGuardrail added in v1.54.4

SetGuardrail sets the Guardrail field's value.

func (ConverseTrace) String added in v1.54.4

func (s ConverseTrace) String() string

String returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

type DocumentBlock added in v1.54.6

type DocumentBlock struct {

	// The format of a document, or its extension.
	//
	// Format is a required field
	Format *string `locationName:"format" type:"string" required:"true" enum:"DocumentFormat"`

	// A name for the document.
	//
	// Name is a required field
	Name *string `locationName:"name" min:"1" type:"string" required:"true"`

	// Contains the content of the document.
	//
	// Source is a required field
	Source *DocumentSource `locationName:"source" type:"structure" required:"true"`
	// contains filtered or unexported fields
}

A document to include in a message when sending a Converse (https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_Converse.html) or ConverseStream (https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_ConverseStream.html) request. You can include up to 5 documents in a request. The maximum document size is 50 MB.

func (DocumentBlock) GoString added in v1.54.6

func (s DocumentBlock) GoString() string

GoString returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (*DocumentBlock) SetFormat added in v1.54.6

func (s *DocumentBlock) SetFormat(v string) *DocumentBlock

SetFormat sets the Format field's value.

func (*DocumentBlock) SetName added in v1.54.6

func (s *DocumentBlock) SetName(v string) *DocumentBlock

SetName sets the Name field's value.

func (*DocumentBlock) SetSource added in v1.54.6

func (s *DocumentBlock) SetSource(v *DocumentSource) *DocumentBlock

SetSource sets the Source field's value.

func (DocumentBlock) String added in v1.54.6

func (s DocumentBlock) String() string

String returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (*DocumentBlock) Validate added in v1.54.6

func (s *DocumentBlock) Validate() error

Validate inspects the fields of the type to determine if they are valid.

type DocumentSource added in v1.54.6

type DocumentSource struct {

	// A base64-encoded string of a UTF-8 encoded file, that is the document to
	// include in the message.
	// Bytes is automatically base64 encoded/decoded by the SDK.
	Bytes []byte `locationName:"bytes" min:"1" type:"blob"`
	// contains filtered or unexported fields
}

Contains the content of the document included in a message when sending a Converse (https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_Converse.html) or ConverseStream (https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_ConverseStream.html) request or in the response.

func (DocumentSource) GoString added in v1.54.6

func (s DocumentSource) GoString() string

GoString returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (*DocumentSource) SetBytes added in v1.54.6

func (s *DocumentSource) SetBytes(v []byte) *DocumentSource

SetBytes sets the Bytes field's value.

func (DocumentSource) String added in v1.54.6

func (s DocumentSource) String() string

String returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (*DocumentSource) Validate added in v1.54.6

func (s *DocumentSource) Validate() error

Validate inspects the fields of the type to determine if they are valid.

type GuardrailAssessment added in v1.54.4

type GuardrailAssessment struct {

	// The content policy.
	ContentPolicy *GuardrailContentPolicyAssessment `locationName:"contentPolicy" type:"structure"`

	// The sensitive information policy.
	SensitiveInformationPolicy *GuardrailSensitiveInformationPolicyAssessment `locationName:"sensitiveInformationPolicy" type:"structure"`

	// The topic policy.
	TopicPolicy *GuardrailTopicPolicyAssessment `locationName:"topicPolicy" type:"structure"`

	// The word policy.
	WordPolicy *GuardrailWordPolicyAssessment `locationName:"wordPolicy" type:"structure"`
	// contains filtered or unexported fields
}

A behavior assessment of the guardrail policies used in a call to the Converse API.

func (GuardrailAssessment) GoString added in v1.54.4

func (s GuardrailAssessment) GoString() string

GoString returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (*GuardrailAssessment) SetContentPolicy added in v1.54.4

SetContentPolicy sets the ContentPolicy field's value.

func (*GuardrailAssessment) SetSensitiveInformationPolicy added in v1.54.4

SetSensitiveInformationPolicy sets the SensitiveInformationPolicy field's value.

func (*GuardrailAssessment) SetTopicPolicy added in v1.54.4

SetTopicPolicy sets the TopicPolicy field's value.

func (*GuardrailAssessment) SetWordPolicy added in v1.54.4

SetWordPolicy sets the WordPolicy field's value.

func (GuardrailAssessment) String added in v1.54.4

func (s GuardrailAssessment) String() string

String returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

type GuardrailConfiguration added in v1.54.4

type GuardrailConfiguration struct {

	// The identifier for the guardrail.
	//
	// GuardrailIdentifier is a required field
	GuardrailIdentifier *string `locationName:"guardrailIdentifier" type:"string" required:"true"`

	// The version of the guardrail.
	//
	// GuardrailVersion is a required field
	GuardrailVersion *string `locationName:"guardrailVersion" type:"string" required:"true"`

	// The trace behavior for the guardrail.
	Trace *string `locationName:"trace" type:"string" enum:"GuardrailTrace"`
	// contains filtered or unexported fields
}

Configuration information for a guardrail that you use with the Converse action.

func (GuardrailConfiguration) GoString added in v1.54.4

func (s GuardrailConfiguration) GoString() string

GoString returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (*GuardrailConfiguration) SetGuardrailIdentifier added in v1.54.4

func (s *GuardrailConfiguration) SetGuardrailIdentifier(v string) *GuardrailConfiguration

SetGuardrailIdentifier sets the GuardrailIdentifier field's value.

func (*GuardrailConfiguration) SetGuardrailVersion added in v1.54.4

func (s *GuardrailConfiguration) SetGuardrailVersion(v string) *GuardrailConfiguration

SetGuardrailVersion sets the GuardrailVersion field's value.

func (*GuardrailConfiguration) SetTrace added in v1.54.4

SetTrace sets the Trace field's value.

func (GuardrailConfiguration) String added in v1.54.4

func (s GuardrailConfiguration) String() string

String returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (*GuardrailConfiguration) Validate added in v1.54.4

func (s *GuardrailConfiguration) Validate() error

Validate inspects the fields of the type to determine if they are valid.

type GuardrailContentFilter added in v1.54.4

type GuardrailContentFilter struct {

	// The guardrail action.
	//
	// Action is a required field
	Action *string `locationName:"action" type:"string" required:"true" enum:"GuardrailContentPolicyAction"`

	// The guardrail confidence.
	//
	// Confidence is a required field
	Confidence *string `locationName:"confidence" type:"string" required:"true" enum:"GuardrailContentFilterConfidence"`

	// The guardrail type.
	//
	// Type is a required field
	Type *string `locationName:"type" type:"string" required:"true" enum:"GuardrailContentFilterType"`
	// contains filtered or unexported fields
}

The content filter for a guardrail.

func (GuardrailContentFilter) GoString added in v1.54.4

func (s GuardrailContentFilter) GoString() string

GoString returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (*GuardrailContentFilter) SetAction added in v1.54.4

SetAction sets the Action field's value.

func (*GuardrailContentFilter) SetConfidence added in v1.54.4

SetConfidence sets the Confidence field's value.

func (*GuardrailContentFilter) SetType added in v1.54.4

SetType sets the Type field's value.

func (GuardrailContentFilter) String added in v1.54.4

func (s GuardrailContentFilter) String() string

String returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

type GuardrailContentPolicyAssessment added in v1.54.4

type GuardrailContentPolicyAssessment struct {

	// The content policy filters.
	//
	// Filters is a required field
	Filters []*GuardrailContentFilter `locationName:"filters" type:"list" required:"true"`
	// contains filtered or unexported fields
}

An assessment of a content policy for a guardrail.

func (GuardrailContentPolicyAssessment) GoString added in v1.54.4

GoString returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (*GuardrailContentPolicyAssessment) SetFilters added in v1.54.4

SetFilters sets the Filters field's value.

func (GuardrailContentPolicyAssessment) String added in v1.54.4

String returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

type GuardrailConverseContentBlock added in v1.54.4

type GuardrailConverseContentBlock struct {

	// The text to guard.
	Text *GuardrailConverseTextBlock `locationName:"text" type:"structure"`
	// contains filtered or unexported fields
}

A content block for selective guarding with the Converse API (Converse and ConverseStream).

func (GuardrailConverseContentBlock) GoString added in v1.54.4

GoString returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (*GuardrailConverseContentBlock) SetText added in v1.54.4

SetText sets the Text field's value.

func (GuardrailConverseContentBlock) String added in v1.54.4

String returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (*GuardrailConverseContentBlock) Validate added in v1.54.4

func (s *GuardrailConverseContentBlock) Validate() error

Validate inspects the fields of the type to determine if they are valid.

type GuardrailConverseTextBlock added in v1.54.4

type GuardrailConverseTextBlock struct {

	// The text that you want to guard.
	//
	// Text is a required field
	Text *string `locationName:"text" type:"string" required:"true"`
	// contains filtered or unexported fields
}

A text block that contains text that you want to assess with a guardrail. For more information, see GuardrailConverseContentBlock.

func (GuardrailConverseTextBlock) GoString added in v1.54.4

func (s GuardrailConverseTextBlock) GoString() string

GoString returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (*GuardrailConverseTextBlock) SetText added in v1.54.4

SetText sets the Text field's value.

func (GuardrailConverseTextBlock) String added in v1.54.4

String returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (*GuardrailConverseTextBlock) Validate added in v1.54.4

func (s *GuardrailConverseTextBlock) Validate() error

Validate inspects the fields of the type to determine if they are valid.

type GuardrailCustomWord added in v1.54.4

type GuardrailCustomWord struct {

	// The action for the custom word.
	//
	// Action is a required field
	Action *string `locationName:"action" type:"string" required:"true" enum:"GuardrailWordPolicyAction"`

	// The match for the custom word.
	//
	// Match is a required field
	Match *string `locationName:"match" type:"string" required:"true"`
	// contains filtered or unexported fields
}

A custom word configured in a guardrail.

func (GuardrailCustomWord) GoString added in v1.54.4

func (s GuardrailCustomWord) GoString() string

GoString returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (*GuardrailCustomWord) SetAction added in v1.54.4

SetAction sets the Action field's value.

func (*GuardrailCustomWord) SetMatch added in v1.54.4

SetMatch sets the Match field's value.

func (GuardrailCustomWord) String added in v1.54.4

func (s GuardrailCustomWord) String() string

String returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

type GuardrailManagedWord added in v1.54.4

type GuardrailManagedWord struct {

	// The action for the managed word.
	//
	// Action is a required field
	Action *string `locationName:"action" type:"string" required:"true" enum:"GuardrailWordPolicyAction"`

	// The match for the managed word.
	//
	// Match is a required field
	Match *string `locationName:"match" type:"string" required:"true"`

	// The type for the managed word.
	//
	// Type is a required field
	Type *string `locationName:"type" type:"string" required:"true" enum:"GuardrailManagedWordType"`
	// contains filtered or unexported fields
}

A managed word configured in a guardrail.

func (GuardrailManagedWord) GoString added in v1.54.4

func (s GuardrailManagedWord) GoString() string

GoString returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (*GuardrailManagedWord) SetAction added in v1.54.4

SetAction sets the Action field's value.

func (*GuardrailManagedWord) SetMatch added in v1.54.4

SetMatch sets the Match field's value.

func (*GuardrailManagedWord) SetType added in v1.54.4

SetType sets the Type field's value.

func (GuardrailManagedWord) String added in v1.54.4

func (s GuardrailManagedWord) String() string

String returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

type GuardrailPiiEntityFilter added in v1.54.4

type GuardrailPiiEntityFilter struct {

	// The PII entity filter action.
	//
	// Action is a required field
	Action *string `locationName:"action" type:"string" required:"true" enum:"GuardrailSensitiveInformationPolicyAction"`

	// The PII entity filter match.
	//
	// Match is a required field
	Match *string `locationName:"match" type:"string" required:"true"`

	// The PII entity filter type.
	//
	// Type is a required field
	Type *string `locationName:"type" type:"string" required:"true" enum:"GuardrailPiiEntityType"`
	// contains filtered or unexported fields
}

A Personally Identifiable Information (PII) entity configured in a guardrail.

func (GuardrailPiiEntityFilter) GoString added in v1.54.4

func (s GuardrailPiiEntityFilter) GoString() string

GoString returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (*GuardrailPiiEntityFilter) SetAction added in v1.54.4

SetAction sets the Action field's value.

func (*GuardrailPiiEntityFilter) SetMatch added in v1.54.4

SetMatch sets the Match field's value.

func (*GuardrailPiiEntityFilter) SetType added in v1.54.4

SetType sets the Type field's value.

func (GuardrailPiiEntityFilter) String added in v1.54.4

func (s GuardrailPiiEntityFilter) String() string

String returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

type GuardrailRegexFilter added in v1.54.4

type GuardrailRegexFilter struct {

	// The region filter action.
	//
	// Action is a required field
	Action *string `locationName:"action" type:"string" required:"true" enum:"GuardrailSensitiveInformationPolicyAction"`

	// The regesx filter match.
	Match *string `locationName:"match" type:"string"`

	// The regex filter name.
	Name *string `locationName:"name" type:"string"`

	// The regex query.
	Regex *string `locationName:"regex" type:"string"`
	// contains filtered or unexported fields
}

A Regex filter configured in a guardrail.

func (GuardrailRegexFilter) GoString added in v1.54.4

func (s GuardrailRegexFilter) GoString() string

GoString returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (*GuardrailRegexFilter) SetAction added in v1.54.4

SetAction sets the Action field's value.

func (*GuardrailRegexFilter) SetMatch added in v1.54.4

SetMatch sets the Match field's value.

func (*GuardrailRegexFilter) SetName added in v1.54.4

SetName sets the Name field's value.

func (*GuardrailRegexFilter) SetRegex added in v1.54.4

SetRegex sets the Regex field's value.

func (GuardrailRegexFilter) String added in v1.54.4

func (s GuardrailRegexFilter) String() string

String returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

type GuardrailSensitiveInformationPolicyAssessment added in v1.54.4

type GuardrailSensitiveInformationPolicyAssessment struct {

	// The PII entities in the assessment.
	//
	// PiiEntities is a required field
	PiiEntities []*GuardrailPiiEntityFilter `locationName:"piiEntities" type:"list" required:"true"`

	// The regex queries in the assessment.
	//
	// Regexes is a required field
	Regexes []*GuardrailRegexFilter `locationName:"regexes" type:"list" required:"true"`
	// contains filtered or unexported fields
}

The assessment for aPersonally Identifiable Information (PII) policy.

func (GuardrailSensitiveInformationPolicyAssessment) GoString added in v1.54.4

GoString returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (*GuardrailSensitiveInformationPolicyAssessment) SetPiiEntities added in v1.54.4

SetPiiEntities sets the PiiEntities field's value.

func (*GuardrailSensitiveInformationPolicyAssessment) SetRegexes added in v1.54.4

SetRegexes sets the Regexes field's value.

func (GuardrailSensitiveInformationPolicyAssessment) String added in v1.54.4

String returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

type GuardrailStreamConfiguration added in v1.54.4

type GuardrailStreamConfiguration struct {

	// The identifier for the guardrail.
	//
	// GuardrailIdentifier is a required field
	GuardrailIdentifier *string `locationName:"guardrailIdentifier" type:"string" required:"true"`

	// The version of the guardrail.
	//
	// GuardrailVersion is a required field
	GuardrailVersion *string `locationName:"guardrailVersion" type:"string" required:"true"`

	// The processing mode.
	//
	// The processing mode. For more information, see Configure streaming response
	// behavior in the Amazon Bedrock User Guide.
	StreamProcessingMode *string `locationName:"streamProcessingMode" type:"string" enum:"GuardrailStreamProcessingMode"`

	// The trace behavior for the guardrail.
	Trace *string `locationName:"trace" type:"string" enum:"GuardrailTrace"`
	// contains filtered or unexported fields
}

Configuration information for a guardrail that you use with the ConverseStream action.

func (GuardrailStreamConfiguration) GoString added in v1.54.4

func (s GuardrailStreamConfiguration) GoString() string

GoString returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (*GuardrailStreamConfiguration) SetGuardrailIdentifier added in v1.54.4

SetGuardrailIdentifier sets the GuardrailIdentifier field's value.

func (*GuardrailStreamConfiguration) SetGuardrailVersion added in v1.54.4

SetGuardrailVersion sets the GuardrailVersion field's value.

func (*GuardrailStreamConfiguration) SetStreamProcessingMode added in v1.54.4

func (s *GuardrailStreamConfiguration) SetStreamProcessingMode(v string) *GuardrailStreamConfiguration

SetStreamProcessingMode sets the StreamProcessingMode field's value.

func (*GuardrailStreamConfiguration) SetTrace added in v1.54.4

SetTrace sets the Trace field's value.

func (GuardrailStreamConfiguration) String added in v1.54.4

String returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (*GuardrailStreamConfiguration) Validate added in v1.54.4

func (s *GuardrailStreamConfiguration) Validate() error

Validate inspects the fields of the type to determine if they are valid.

type GuardrailTopic added in v1.54.4

type GuardrailTopic struct {

	// The action the guardrail should take when it intervenes on a topic.
	//
	// Action is a required field
	Action *string `locationName:"action" type:"string" required:"true" enum:"GuardrailTopicPolicyAction"`

	// The name for the guardrail.
	//
	// Name is a required field
	Name *string `locationName:"name" type:"string" required:"true"`

	// The type behavior that the guardrail should perform when the model detects
	// the topic.
	//
	// Type is a required field
	Type *string `locationName:"type" type:"string" required:"true" enum:"GuardrailTopicType"`
	// contains filtered or unexported fields
}

Information about a topic guardrail.

func (GuardrailTopic) GoString added in v1.54.4

func (s GuardrailTopic) GoString() string

GoString returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (*GuardrailTopic) SetAction added in v1.54.4

func (s *GuardrailTopic) SetAction(v string) *GuardrailTopic

SetAction sets the Action field's value.

func (*GuardrailTopic) SetName added in v1.54.4

func (s *GuardrailTopic) SetName(v string) *GuardrailTopic

SetName sets the Name field's value.

func (*GuardrailTopic) SetType added in v1.54.4

func (s *GuardrailTopic) SetType(v string) *GuardrailTopic

SetType sets the Type field's value.

func (GuardrailTopic) String added in v1.54.4

func (s GuardrailTopic) String() string

String returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

type GuardrailTopicPolicyAssessment added in v1.54.4

type GuardrailTopicPolicyAssessment struct {

	// The topics in the assessment.
	//
	// Topics is a required field
	Topics []*GuardrailTopic `locationName:"topics" type:"list" required:"true"`
	// contains filtered or unexported fields
}

A behavior assessment of a topic policy.

func (GuardrailTopicPolicyAssessment) GoString added in v1.54.4

GoString returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (*GuardrailTopicPolicyAssessment) SetTopics added in v1.54.4

SetTopics sets the Topics field's value.

func (GuardrailTopicPolicyAssessment) String added in v1.54.4

String returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

type GuardrailTraceAssessment added in v1.54.4

type GuardrailTraceAssessment struct {

	// The input assessment.
	InputAssessment map[string]*GuardrailAssessment `locationName:"inputAssessment" type:"map"`

	// The output from the model.
	ModelOutput []*string `locationName:"modelOutput" type:"list"`

	// the output assessments.
	OutputAssessments map[string][]*GuardrailAssessment `locationName:"outputAssessments" type:"map"`
	// contains filtered or unexported fields
}

A Top level guardrail trace object. For more information, see ConverseTrace.

func (GuardrailTraceAssessment) GoString added in v1.54.4

func (s GuardrailTraceAssessment) GoString() string

GoString returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (*GuardrailTraceAssessment) SetInputAssessment added in v1.54.4

SetInputAssessment sets the InputAssessment field's value.

func (*GuardrailTraceAssessment) SetModelOutput added in v1.54.4

func (s *GuardrailTraceAssessment) SetModelOutput(v []*string) *GuardrailTraceAssessment

SetModelOutput sets the ModelOutput field's value.

func (*GuardrailTraceAssessment) SetOutputAssessments added in v1.54.4

SetOutputAssessments sets the OutputAssessments field's value.

func (GuardrailTraceAssessment) String added in v1.54.4

func (s GuardrailTraceAssessment) String() string

String returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

type GuardrailWordPolicyAssessment added in v1.54.4

type GuardrailWordPolicyAssessment struct {

	// Custom words in the assessment.
	//
	// CustomWords is a required field
	CustomWords []*GuardrailCustomWord `locationName:"customWords" type:"list" required:"true"`

	// Managed word lists in the assessment.
	//
	// ManagedWordLists is a required field
	ManagedWordLists []*GuardrailManagedWord `locationName:"managedWordLists" type:"list" required:"true"`
	// contains filtered or unexported fields
}

The word policy assessment.

func (GuardrailWordPolicyAssessment) GoString added in v1.54.4

GoString returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (*GuardrailWordPolicyAssessment) SetCustomWords added in v1.54.4

SetCustomWords sets the CustomWords field's value.

func (*GuardrailWordPolicyAssessment) SetManagedWordLists added in v1.54.4

SetManagedWordLists sets the ManagedWordLists field's value.

func (GuardrailWordPolicyAssessment) String added in v1.54.4

String returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

type ImageBlock added in v1.53.13

type ImageBlock struct {

	// The format of the image.
	//
	// Format is a required field
	Format *string `locationName:"format" type:"string" required:"true" enum:"ImageFormat"`

	// The source for the image.
	//
	// Source is a required field
	Source *ImageSource `locationName:"source" type:"structure" required:"true"`
	// contains filtered or unexported fields
}

Image content for a message.

func (ImageBlock) GoString added in v1.53.13

func (s ImageBlock) GoString() string

GoString returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (*ImageBlock) SetFormat added in v1.53.13

func (s *ImageBlock) SetFormat(v string) *ImageBlock

SetFormat sets the Format field's value.

func (*ImageBlock) SetSource added in v1.53.13

func (s *ImageBlock) SetSource(v *ImageSource) *ImageBlock

SetSource sets the Source field's value.

func (ImageBlock) String added in v1.53.13

func (s ImageBlock) String() string

String returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (*ImageBlock) Validate added in v1.53.13

func (s *ImageBlock) Validate() error

Validate inspects the fields of the type to determine if they are valid.

type ImageSource added in v1.53.13

type ImageSource struct {

	// The raw image bytes for the image. If you use an AWS SDK, you don't need
	// to base64 encode the image bytes.
	// Bytes is automatically base64 encoded/decoded by the SDK.
	Bytes []byte `locationName:"bytes" min:"1" type:"blob"`
	// contains filtered or unexported fields
}

The source for an image.

func (ImageSource) GoString added in v1.53.13

func (s ImageSource) GoString() string

GoString returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (*ImageSource) SetBytes added in v1.53.13

func (s *ImageSource) SetBytes(v []byte) *ImageSource

SetBytes sets the Bytes field's value.

func (ImageSource) String added in v1.53.13

func (s ImageSource) String() string

String returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (*ImageSource) Validate added in v1.53.13

func (s *ImageSource) Validate() error

Validate inspects the fields of the type to determine if they are valid.

type InferenceConfiguration added in v1.53.13

type InferenceConfiguration struct {

	// The maximum number of tokens to allow in the generated response. The default
	// value is the maximum allowed value for the model that you are using. For
	// more information, see Inference parameters for foundation models (https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html).
	MaxTokens *int64 `locationName:"maxTokens" min:"1" type:"integer"`

	// A list of stop sequences. A stop sequence is a sequence of characters that
	// causes the model to stop generating the response.
	StopSequences []*string `locationName:"stopSequences" type:"list"`

	// The likelihood of the model selecting higher-probability options while generating
	// a response. A lower value makes the model more likely to choose higher-probability
	// options, while a higher value makes the model more likely to choose lower-probability
	// options.
	//
	// The default value is the default value for the model that you are using.
	// For more information, see Inference parameters for foundation models (https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html).
	Temperature *float64 `locationName:"temperature" type:"float"`

	// The percentage of most-likely candidates that the model considers for the
	// next token. For example, if you choose a value of 0.8 for topP, the model
	// selects from the top 80% of the probability distribution of tokens that could
	// be next in the sequence.
	//
	// The default value is the default value for the model that you are using.
	// For more information, see Inference parameters for foundation models (https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html).
	TopP *float64 `locationName:"topP" type:"float"`
	// contains filtered or unexported fields
}

Base inference parameters to pass to a model in a call to Converse (https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_Converse.html) or ConverseStream (https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_ConverseStream.html). For more information, see Inference parameters for foundation models (https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html).

If you need to pass additional parameters that the model supports, use the additionalModelRequestFields request field in the call to Converse or ConverseStream. For more information, see Model parameters (https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html).

func (InferenceConfiguration) GoString added in v1.53.13

func (s InferenceConfiguration) GoString() string

GoString returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (*InferenceConfiguration) SetMaxTokens added in v1.53.13

SetMaxTokens sets the MaxTokens field's value.

func (*InferenceConfiguration) SetStopSequences added in v1.53.13

func (s *InferenceConfiguration) SetStopSequences(v []*string) *InferenceConfiguration

SetStopSequences sets the StopSequences field's value.

func (*InferenceConfiguration) SetTemperature added in v1.53.13

SetTemperature sets the Temperature field's value.

func (*InferenceConfiguration) SetTopP added in v1.53.13

SetTopP sets the TopP field's value.

func (InferenceConfiguration) String added in v1.53.13

func (s InferenceConfiguration) String() string

String returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (*InferenceConfiguration) Validate added in v1.53.13

func (s *InferenceConfiguration) Validate() error

Validate inspects the fields of the type to determine if they are valid.

type InternalServerException

type InternalServerException struct {
	RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"`

	Message_ *string `locationName:"message" type:"string"`
	// contains filtered or unexported fields
}

An internal server error occurred. Retry your request.

func (*InternalServerException) Code

func (s *InternalServerException) Code() string

Code returns the exception type name.

func (*InternalServerException) Error

func (s *InternalServerException) Error() string

func (InternalServerException) GoString

func (s InternalServerException) GoString() string

GoString returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (*InternalServerException) MarshalEvent

MarshalEvent marshals the type into an stream event value. This method should only used internally within the SDK's EventStream handling.

func (*InternalServerException) Message

func (s *InternalServerException) Message() string

Message returns the exception's message.

func (*InternalServerException) OrigErr

func (s *InternalServerException) OrigErr() error

OrigErr always returns nil, satisfies awserr.Error interface.

func (*InternalServerException) RequestID

func (s *InternalServerException) RequestID() string

RequestID returns the service's response RequestID for request.

func (*InternalServerException) StatusCode

func (s *InternalServerException) StatusCode() int

Status code returns the HTTP status code for the request's response error.

func (InternalServerException) String

func (s InternalServerException) String() string

String returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (*InternalServerException) UnmarshalEvent

func (s *InternalServerException) UnmarshalEvent(
	payloadUnmarshaler protocol.PayloadUnmarshaler,
	msg eventstream.Message,
) error

UnmarshalEvent unmarshals the EventStream Message into the InternalServerException value. This method is only used internally within the SDK's EventStream handling.

type InvokeModelInput

type InvokeModelInput struct {

	// The desired MIME type of the inference body in the response. The default
	// value is application/json.
	Accept *string `location:"header" locationName:"Accept" type:"string"`

	// The prompt and inference parameters in the format specified in the contentType
	// in the header. You must provide the body in JSON format. To see the format
	// and content of the request and response bodies for different models, refer
	// to Inference parameters (https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html).
	// For more information, see Run inference (https://docs.aws.amazon.com/bedrock/latest/userguide/api-methods-run.html)
	// in the Bedrock User Guide.
	//
	// Body is a sensitive parameter and its value will be
	// replaced with "sensitive" in string returned by InvokeModelInput's
	// String and GoString methods.
	//
	// Body is a required field
	Body []byte `locationName:"body" type:"blob" required:"true" sensitive:"true"`

	// The MIME type of the input data in the request. You must specify application/json.
	ContentType *string `location:"header" locationName:"Content-Type" type:"string"`

	// The unique identifier of the guardrail that you want to use. If you don't
	// provide a value, no guardrail is applied to the invocation.
	//
	// An error will be thrown in the following situations.
	//
	//    * You don't provide a guardrail identifier but you specify the amazon-bedrock-guardrailConfig
	//    field in the request body.
	//
	//    * You enable the guardrail but the contentType isn't application/json.
	//
	//    * You provide a guardrail identifier, but guardrailVersion isn't specified.
	GuardrailIdentifier *string `location:"header" locationName:"X-Amzn-Bedrock-GuardrailIdentifier" type:"string"`

	// The version number for the guardrail. The value can also be DRAFT.
	GuardrailVersion *string `location:"header" locationName:"X-Amzn-Bedrock-GuardrailVersion" type:"string"`

	// The unique identifier of the model to invoke to run inference.
	//
	// The modelId to provide depends on the type of model that you use:
	//
	//    * If you use a base model, specify the model ID or its ARN. For a list
	//    of model IDs for base models, see Amazon Bedrock base model IDs (on-demand
	//    throughput) (https://docs.aws.amazon.com/bedrock/latest/userguide/model-ids.html#model-ids-arns)
	//    in the Amazon Bedrock User Guide.
	//
	//    * If you use a provisioned model, specify the ARN of the Provisioned Throughput.
	//    For more information, see Run inference using a Provisioned Throughput
	//    (https://docs.aws.amazon.com/bedrock/latest/userguide/prov-thru-use.html)
	//    in the Amazon Bedrock User Guide.
	//
	//    * If you use a custom model, first purchase Provisioned Throughput for
	//    it. Then specify the ARN of the resulting provisioned model. For more
	//    information, see Use a custom model in Amazon Bedrock (https://docs.aws.amazon.com/bedrock/latest/userguide/model-customization-use.html)
	//    in the Amazon Bedrock User Guide.
	//
	// ModelId is a required field
	ModelId *string `location:"uri" locationName:"modelId" min:"1" type:"string" required:"true"`

	// Specifies whether to enable or disable the Bedrock trace. If enabled, you
	// can see the full Bedrock trace.
	Trace *string `location:"header" locationName:"X-Amzn-Bedrock-Trace" type:"string" enum:"Trace"`
	// contains filtered or unexported fields
}

func (InvokeModelInput) GoString

func (s InvokeModelInput) GoString() string

GoString returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (*InvokeModelInput) SetAccept

func (s *InvokeModelInput) SetAccept(v string) *InvokeModelInput

SetAccept sets the Accept field's value.

func (*InvokeModelInput) SetBody

func (s *InvokeModelInput) SetBody(v []byte) *InvokeModelInput

SetBody sets the Body field's value.

func (*InvokeModelInput) SetContentType

func (s *InvokeModelInput) SetContentType(v string) *InvokeModelInput

SetContentType sets the ContentType field's value.

func (*InvokeModelInput) SetGuardrailIdentifier added in v1.51.27

func (s *InvokeModelInput) SetGuardrailIdentifier(v string) *InvokeModelInput

SetGuardrailIdentifier sets the GuardrailIdentifier field's value.

func (*InvokeModelInput) SetGuardrailVersion added in v1.51.27

func (s *InvokeModelInput) SetGuardrailVersion(v string) *InvokeModelInput

SetGuardrailVersion sets the GuardrailVersion field's value.

func (*InvokeModelInput) SetModelId

func (s *InvokeModelInput) SetModelId(v string) *InvokeModelInput

SetModelId sets the ModelId field's value.

func (*InvokeModelInput) SetTrace added in v1.51.27

func (s *InvokeModelInput) SetTrace(v string) *InvokeModelInput

SetTrace sets the Trace field's value.

func (InvokeModelInput) String

func (s InvokeModelInput) String() string

String returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (*InvokeModelInput) Validate

func (s *InvokeModelInput) Validate() error

Validate inspects the fields of the type to determine if they are valid.

type InvokeModelOutput

type InvokeModelOutput struct {

	// Inference response from the model in the format specified in the contentType
	// header. To see the format and content of the request and response bodies
	// for different models, refer to Inference parameters (https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html).
	//
	// Body is a sensitive parameter and its value will be
	// replaced with "sensitive" in string returned by InvokeModelOutput's
	// String and GoString methods.
	//
	// Body is a required field
	Body []byte `locationName:"body" type:"blob" required:"true" sensitive:"true"`

	// The MIME type of the inference result.
	//
	// ContentType is a required field
	ContentType *string `location:"header" locationName:"Content-Type" type:"string" required:"true"`
	// contains filtered or unexported fields
}

func (InvokeModelOutput) GoString

func (s InvokeModelOutput) GoString() string

GoString returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (*InvokeModelOutput) SetBody

func (s *InvokeModelOutput) SetBody(v []byte) *InvokeModelOutput

SetBody sets the Body field's value.

func (*InvokeModelOutput) SetContentType

func (s *InvokeModelOutput) SetContentType(v string) *InvokeModelOutput

SetContentType sets the ContentType field's value.

func (InvokeModelOutput) String

func (s InvokeModelOutput) String() string

String returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

type InvokeModelWithResponseStreamEventStream

type InvokeModelWithResponseStreamEventStream struct {

	// Reader is the EventStream reader for the ResponseStream
	// events. This value is automatically set by the SDK when the API call is made
	// Use this member when unit testing your code with the SDK to mock out the
	// EventStream Reader.
	//
	// Must not be nil.
	Reader ResponseStreamReader
	// contains filtered or unexported fields
}

InvokeModelWithResponseStreamEventStream provides the event stream handling for the InvokeModelWithResponseStream.

For testing and mocking the event stream this type should be initialized via the NewInvokeModelWithResponseStreamEventStream constructor function. Using the functional options to pass in nested mock behavior.

func NewInvokeModelWithResponseStreamEventStream

func NewInvokeModelWithResponseStreamEventStream(opts ...func(*InvokeModelWithResponseStreamEventStream)) *InvokeModelWithResponseStreamEventStream

NewInvokeModelWithResponseStreamEventStream initializes an InvokeModelWithResponseStreamEventStream. This function should only be used for testing and mocking the InvokeModelWithResponseStreamEventStream stream within your application.

The Reader member must be set before reading events from the stream.

es := NewInvokeModelWithResponseStreamEventStream(func(o *InvokeModelWithResponseStreamEventStream){
    es.Reader = myMockStreamReader
})

func (*InvokeModelWithResponseStreamEventStream) Close

Close closes the stream. This will also cause the stream to be closed. Close must be called when done using the stream API. Not calling Close may result in resource leaks.

You can use the closing of the Reader's Events channel to terminate your application's read from the API's stream.

func (*InvokeModelWithResponseStreamEventStream) Err

Err returns any error that occurred while reading or writing EventStream Events from the service API's response. Returns nil if there were no errors.

func (*InvokeModelWithResponseStreamEventStream) Events

Events returns a channel to read events from.

These events are:

  • PayloadPart
  • ResponseStreamUnknownEvent

type InvokeModelWithResponseStreamInput

type InvokeModelWithResponseStreamInput struct {

	// The desired MIME type of the inference body in the response. The default
	// value is application/json.
	Accept *string `location:"header" locationName:"X-Amzn-Bedrock-Accept" type:"string"`

	// The prompt and inference parameters in the format specified in the contentType
	// in the header. You must provide the body in JSON format. To see the format
	// and content of the request and response bodies for different models, refer
	// to Inference parameters (https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html).
	// For more information, see Run inference (https://docs.aws.amazon.com/bedrock/latest/userguide/api-methods-run.html)
	// in the Bedrock User Guide.
	//
	// Body is a sensitive parameter and its value will be
	// replaced with "sensitive" in string returned by InvokeModelWithResponseStreamInput's
	// String and GoString methods.
	//
	// Body is a required field
	Body []byte `locationName:"body" type:"blob" required:"true" sensitive:"true"`

	// The MIME type of the input data in the request. You must specify application/json.
	ContentType *string `location:"header" locationName:"Content-Type" type:"string"`

	// The unique identifier of the guardrail that you want to use. If you don't
	// provide a value, no guardrail is applied to the invocation.
	//
	// An error is thrown in the following situations.
	//
	//    * You don't provide a guardrail identifier but you specify the amazon-bedrock-guardrailConfig
	//    field in the request body.
	//
	//    * You enable the guardrail but the contentType isn't application/json.
	//
	//    * You provide a guardrail identifier, but guardrailVersion isn't specified.
	GuardrailIdentifier *string `location:"header" locationName:"X-Amzn-Bedrock-GuardrailIdentifier" type:"string"`

	// The version number for the guardrail. The value can also be DRAFT.
	GuardrailVersion *string `location:"header" locationName:"X-Amzn-Bedrock-GuardrailVersion" type:"string"`

	// The unique identifier of the model to invoke to run inference.
	//
	// The modelId to provide depends on the type of model that you use:
	//
	//    * If you use a base model, specify the model ID or its ARN. For a list
	//    of model IDs for base models, see Amazon Bedrock base model IDs (on-demand
	//    throughput) (https://docs.aws.amazon.com/bedrock/latest/userguide/model-ids.html#model-ids-arns)
	//    in the Amazon Bedrock User Guide.
	//
	//    * If you use a provisioned model, specify the ARN of the Provisioned Throughput.
	//    For more information, see Run inference using a Provisioned Throughput
	//    (https://docs.aws.amazon.com/bedrock/latest/userguide/prov-thru-use.html)
	//    in the Amazon Bedrock User Guide.
	//
	//    * If you use a custom model, first purchase Provisioned Throughput for
	//    it. Then specify the ARN of the resulting provisioned model. For more
	//    information, see Use a custom model in Amazon Bedrock (https://docs.aws.amazon.com/bedrock/latest/userguide/model-customization-use.html)
	//    in the Amazon Bedrock User Guide.
	//
	// ModelId is a required field
	ModelId *string `location:"uri" locationName:"modelId" min:"1" type:"string" required:"true"`

	// Specifies whether to enable or disable the Bedrock trace. If enabled, you
	// can see the full Bedrock trace.
	Trace *string `location:"header" locationName:"X-Amzn-Bedrock-Trace" type:"string" enum:"Trace"`
	// contains filtered or unexported fields
}

func (InvokeModelWithResponseStreamInput) GoString

GoString returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (*InvokeModelWithResponseStreamInput) SetAccept

SetAccept sets the Accept field's value.

func (*InvokeModelWithResponseStreamInput) SetBody

SetBody sets the Body field's value.

func (*InvokeModelWithResponseStreamInput) SetContentType

SetContentType sets the ContentType field's value.

func (*InvokeModelWithResponseStreamInput) SetGuardrailIdentifier added in v1.51.27

SetGuardrailIdentifier sets the GuardrailIdentifier field's value.

func (*InvokeModelWithResponseStreamInput) SetGuardrailVersion added in v1.51.27

SetGuardrailVersion sets the GuardrailVersion field's value.

func (*InvokeModelWithResponseStreamInput) SetModelId

SetModelId sets the ModelId field's value.

func (*InvokeModelWithResponseStreamInput) SetTrace added in v1.51.27

SetTrace sets the Trace field's value.

func (InvokeModelWithResponseStreamInput) String

String returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (*InvokeModelWithResponseStreamInput) Validate

Validate inspects the fields of the type to determine if they are valid.

type InvokeModelWithResponseStreamOutput

type InvokeModelWithResponseStreamOutput struct {

	// The MIME type of the inference result.
	//
	// ContentType is a required field
	ContentType *string `location:"header" locationName:"X-Amzn-Bedrock-Content-Type" type:"string" required:"true"`
	// contains filtered or unexported fields
}

func (*InvokeModelWithResponseStreamOutput) GetStream

GetStream returns the type to interact with the event stream.

func (InvokeModelWithResponseStreamOutput) GoString

GoString returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (*InvokeModelWithResponseStreamOutput) SetContentType

SetContentType sets the ContentType field's value.

func (InvokeModelWithResponseStreamOutput) String

String returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

type Message added in v1.53.13

type Message struct {

	// The message content.
	//
	// Content is a required field
	Content []*ContentBlock `locationName:"content" type:"list" required:"true"`

	// The role that the message plays in the message.
	//
	// Role is a required field
	Role *string `locationName:"role" type:"string" required:"true" enum:"ConversationRole"`
	// contains filtered or unexported fields
}

A message input, or returned from, a call to Converse (https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_Converse.html) or ConverseStream (https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_ConverseStream.html).

func (Message) GoString added in v1.53.13

func (s Message) GoString() string

GoString returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (*Message) SetContent added in v1.53.13

func (s *Message) SetContent(v []*ContentBlock) *Message

SetContent sets the Content field's value.

func (*Message) SetRole added in v1.53.13

func (s *Message) SetRole(v string) *Message

SetRole sets the Role field's value.

func (Message) String added in v1.53.13

func (s Message) String() string

String returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (*Message) Validate added in v1.53.13

func (s *Message) Validate() error

Validate inspects the fields of the type to determine if they are valid.

type MessageStartEvent added in v1.53.13

type MessageStartEvent struct {

	// The role for the message.
	//
	// Role is a required field
	Role *string `locationName:"role" type:"string" required:"true" enum:"ConversationRole"`
	// contains filtered or unexported fields
}

The start of a message.

func (MessageStartEvent) GoString added in v1.53.13

func (s MessageStartEvent) GoString() string

GoString returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (*MessageStartEvent) MarshalEvent added in v1.53.13

func (s *MessageStartEvent) MarshalEvent(pm protocol.PayloadMarshaler) (msg eventstream.Message, err error)

MarshalEvent marshals the type into an stream event value. This method should only used internally within the SDK's EventStream handling.

func (*MessageStartEvent) SetRole added in v1.53.13

SetRole sets the Role field's value.

func (MessageStartEvent) String added in v1.53.13

func (s MessageStartEvent) String() string

String returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (*MessageStartEvent) UnmarshalEvent added in v1.53.13

func (s *MessageStartEvent) UnmarshalEvent(
	payloadUnmarshaler protocol.PayloadUnmarshaler,
	msg eventstream.Message,
) error

UnmarshalEvent unmarshals the EventStream Message into the MessageStartEvent value. This method is only used internally within the SDK's EventStream handling.

type MessageStopEvent added in v1.53.13

type MessageStopEvent struct {

	// The reason why the model stopped generating output.
	//
	// StopReason is a required field
	StopReason *string `locationName:"stopReason" type:"string" required:"true" enum:"StopReason"`
	// contains filtered or unexported fields
}

The stop event for a message.

func (MessageStopEvent) GoString added in v1.53.13

func (s MessageStopEvent) GoString() string

GoString returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (*MessageStopEvent) MarshalEvent added in v1.53.13

func (s *MessageStopEvent) MarshalEvent(pm protocol.PayloadMarshaler) (msg eventstream.Message, err error)

MarshalEvent marshals the type into an stream event value. This method should only used internally within the SDK's EventStream handling.

func (*MessageStopEvent) SetStopReason added in v1.53.13

func (s *MessageStopEvent) SetStopReason(v string) *MessageStopEvent

SetStopReason sets the StopReason field's value.

func (MessageStopEvent) String added in v1.53.13

func (s MessageStopEvent) String() string

String returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (*MessageStopEvent) UnmarshalEvent added in v1.53.13

func (s *MessageStopEvent) UnmarshalEvent(
	payloadUnmarshaler protocol.PayloadUnmarshaler,
	msg eventstream.Message,
) error

UnmarshalEvent unmarshals the EventStream Message into the MessageStopEvent value. This method is only used internally within the SDK's EventStream handling.

type ModelErrorException

type ModelErrorException struct {
	RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"`

	Message_ *string `locationName:"message" type:"string"`

	// The original status code.
	OriginalStatusCode *int64 `locationName:"originalStatusCode" min:"100" type:"integer"`

	// The resource name.
	ResourceName *string `locationName:"resourceName" type:"string"`
	// contains filtered or unexported fields
}

The request failed due to an error while processing the model.

func (*ModelErrorException) Code

func (s *ModelErrorException) Code() string

Code returns the exception type name.

func (*ModelErrorException) Error

func (s *ModelErrorException) Error() string

func (ModelErrorException) GoString

func (s ModelErrorException) GoString() string

GoString returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (*ModelErrorException) Message

func (s *ModelErrorException) Message() string

Message returns the exception's message.

func (*ModelErrorException) OrigErr

func (s *ModelErrorException) OrigErr() error

OrigErr always returns nil, satisfies awserr.Error interface.

func (*ModelErrorException) RequestID

func (s *ModelErrorException) RequestID() string

RequestID returns the service's response RequestID for request.

func (*ModelErrorException) StatusCode

func (s *ModelErrorException) StatusCode() int

Status code returns the HTTP status code for the request's response error.

func (ModelErrorException) String

func (s ModelErrorException) String() string

String returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

type ModelNotReadyException

type ModelNotReadyException struct {
	RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"`

	Message_ *string `locationName:"message" type:"string"`
	// contains filtered or unexported fields
}

The model specified in the request is not ready to serve inference requests.

func (*ModelNotReadyException) Code

func (s *ModelNotReadyException) Code() string

Code returns the exception type name.

func (*ModelNotReadyException) Error

func (s *ModelNotReadyException) Error() string

func (ModelNotReadyException) GoString

func (s ModelNotReadyException) GoString() string

GoString returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (*ModelNotReadyException) Message

func (s *ModelNotReadyException) Message() string

Message returns the exception's message.

func (*ModelNotReadyException) OrigErr

func (s *ModelNotReadyException) OrigErr() error

OrigErr always returns nil, satisfies awserr.Error interface.

func (*ModelNotReadyException) RequestID

func (s *ModelNotReadyException) RequestID() string

RequestID returns the service's response RequestID for request.

func (*ModelNotReadyException) StatusCode

func (s *ModelNotReadyException) StatusCode() int

Status code returns the HTTP status code for the request's response error.

func (ModelNotReadyException) String

func (s ModelNotReadyException) String() string

String returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

type ModelStreamErrorException

type ModelStreamErrorException struct {
	RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"`

	Message_ *string `locationName:"message" type:"string"`

	// The original message.
	OriginalMessage *string `locationName:"originalMessage" type:"string"`

	// The original status code.
	OriginalStatusCode *int64 `locationName:"originalStatusCode" min:"100" type:"integer"`
	// contains filtered or unexported fields
}

An error occurred while streaming the response. Retry your request.

func (*ModelStreamErrorException) Code

Code returns the exception type name.

func (*ModelStreamErrorException) Error

func (s *ModelStreamErrorException) Error() string

func (ModelStreamErrorException) GoString

func (s ModelStreamErrorException) GoString() string

GoString returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (*ModelStreamErrorException) MarshalEvent

MarshalEvent marshals the type into an stream event value. This method should only used internally within the SDK's EventStream handling.

func (*ModelStreamErrorException) Message

func (s *ModelStreamErrorException) Message() string

Message returns the exception's message.

func (*ModelStreamErrorException) OrigErr

func (s *ModelStreamErrorException) OrigErr() error

OrigErr always returns nil, satisfies awserr.Error interface.

func (*ModelStreamErrorException) RequestID

func (s *ModelStreamErrorException) RequestID() string

RequestID returns the service's response RequestID for request.

func (*ModelStreamErrorException) StatusCode

func (s *ModelStreamErrorException) StatusCode() int

Status code returns the HTTP status code for the request's response error.

func (ModelStreamErrorException) String

func (s ModelStreamErrorException) String() string

String returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (*ModelStreamErrorException) UnmarshalEvent

func (s *ModelStreamErrorException) UnmarshalEvent(
	payloadUnmarshaler protocol.PayloadUnmarshaler,
	msg eventstream.Message,
) error

UnmarshalEvent unmarshals the EventStream Message into the ModelStreamErrorException value. This method is only used internally within the SDK's EventStream handling.

type ModelTimeoutException

type ModelTimeoutException struct {
	RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"`

	Message_ *string `locationName:"message" type:"string"`
	// contains filtered or unexported fields
}

The request took too long to process. Processing time exceeded the model timeout length.

func (*ModelTimeoutException) Code

func (s *ModelTimeoutException) Code() string

Code returns the exception type name.

func (*ModelTimeoutException) Error

func (s *ModelTimeoutException) Error() string

func (ModelTimeoutException) GoString

func (s ModelTimeoutException) GoString() string

GoString returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (*ModelTimeoutException) MarshalEvent added in v1.45.20

MarshalEvent marshals the type into an stream event value. This method should only used internally within the SDK's EventStream handling.

func (*ModelTimeoutException) Message

func (s *ModelTimeoutException) Message() string

Message returns the exception's message.

func (*ModelTimeoutException) OrigErr

func (s *ModelTimeoutException) OrigErr() error

OrigErr always returns nil, satisfies awserr.Error interface.

func (*ModelTimeoutException) RequestID

func (s *ModelTimeoutException) RequestID() string

RequestID returns the service's response RequestID for request.

func (*ModelTimeoutException) StatusCode

func (s *ModelTimeoutException) StatusCode() int

Status code returns the HTTP status code for the request's response error.

func (ModelTimeoutException) String

func (s ModelTimeoutException) String() string

String returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (*ModelTimeoutException) UnmarshalEvent added in v1.45.20

func (s *ModelTimeoutException) UnmarshalEvent(
	payloadUnmarshaler protocol.PayloadUnmarshaler,
	msg eventstream.Message,
) error

UnmarshalEvent unmarshals the EventStream Message into the ModelTimeoutException value. This method is only used internally within the SDK's EventStream handling.

type PayloadPart

type PayloadPart struct {

	// Base64-encoded bytes of payload data.
	//
	// Bytes is a sensitive parameter and its value will be
	// replaced with "sensitive" in string returned by PayloadPart's
	// String and GoString methods.
	//
	// Bytes is automatically base64 encoded/decoded by the SDK.
	Bytes []byte `locationName:"bytes" type:"blob" sensitive:"true"`
	// contains filtered or unexported fields
}

Payload content included in the response.

func (PayloadPart) GoString

func (s PayloadPart) GoString() string

GoString returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (*PayloadPart) MarshalEvent

func (s *PayloadPart) MarshalEvent(pm protocol.PayloadMarshaler) (msg eventstream.Message, err error)

MarshalEvent marshals the type into an stream event value. This method should only used internally within the SDK's EventStream handling.

func (*PayloadPart) SetBytes

func (s *PayloadPart) SetBytes(v []byte) *PayloadPart

SetBytes sets the Bytes field's value.

func (PayloadPart) String

func (s PayloadPart) String() string

String returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (*PayloadPart) UnmarshalEvent

func (s *PayloadPart) UnmarshalEvent(
	payloadUnmarshaler protocol.PayloadUnmarshaler,
	msg eventstream.Message,
) error

UnmarshalEvent unmarshals the EventStream Message into the PayloadPart value. This method is only used internally within the SDK's EventStream handling.

type ResourceNotFoundException

type ResourceNotFoundException struct {
	RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"`

	Message_ *string `locationName:"message" type:"string"`
	// contains filtered or unexported fields
}

The specified resource ARN was not found. Check the ARN and try your request again.

func (*ResourceNotFoundException) Code

Code returns the exception type name.

func (*ResourceNotFoundException) Error

func (s *ResourceNotFoundException) Error() string

func (ResourceNotFoundException) GoString

func (s ResourceNotFoundException) GoString() string

GoString returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (*ResourceNotFoundException) Message

func (s *ResourceNotFoundException) Message() string

Message returns the exception's message.

func (*ResourceNotFoundException) OrigErr

func (s *ResourceNotFoundException) OrigErr() error

OrigErr always returns nil, satisfies awserr.Error interface.

func (*ResourceNotFoundException) RequestID

func (s *ResourceNotFoundException) RequestID() string

RequestID returns the service's response RequestID for request.

func (*ResourceNotFoundException) StatusCode

func (s *ResourceNotFoundException) StatusCode() int

Status code returns the HTTP status code for the request's response error.

func (ResourceNotFoundException) String

func (s ResourceNotFoundException) String() string

String returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

type ResponseStreamEvent

type ResponseStreamEvent interface {
	eventstreamapi.Marshaler
	eventstreamapi.Unmarshaler
	// contains filtered or unexported methods
}

ResponseStreamEvent groups together all EventStream events writes for ResponseStream.

These events are:

  • PayloadPart

type ResponseStreamReader

type ResponseStreamReader interface {
	// Returns a channel of events as they are read from the event stream.
	Events() <-chan ResponseStreamEvent

	// Close will stop the reader reading events from the stream.
	Close() error

	// Returns any error that has occurred while reading from the event stream.
	Err() error
}

ResponseStreamReader provides the interface for reading to the stream. The default implementation for this interface will be ResponseStream.

The reader's Close method must allow multiple concurrent calls.

These events are:

  • PayloadPart
  • ResponseStreamUnknownEvent

type ResponseStreamUnknownEvent

type ResponseStreamUnknownEvent struct {
	Type    string
	Message eventstream.Message
}

ResponseStreamUnknownEvent provides a failsafe event for the ResponseStream group of events when an unknown event is received.

func (*ResponseStreamUnknownEvent) MarshalEvent

MarshalEvent marshals the type into an stream event value. This method should only used internally within the SDK's EventStream handling.

func (*ResponseStreamUnknownEvent) UnmarshalEvent

func (e *ResponseStreamUnknownEvent) UnmarshalEvent(
	payloadUnmarshaler protocol.PayloadUnmarshaler,
	msg eventstream.Message,
) error

UnmarshalEvent unmarshals the EventStream Message into the ResponseStream value. This method is only used internally within the SDK's EventStream handling.

type ServiceQuotaExceededException

type ServiceQuotaExceededException struct {
	RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"`

	Message_ *string `locationName:"message" type:"string"`
	// contains filtered or unexported fields
}

The number of requests exceeds the service quota. Resubmit your request later.

func (*ServiceQuotaExceededException) Code

Code returns the exception type name.

func (*ServiceQuotaExceededException) Error

func (ServiceQuotaExceededException) GoString

GoString returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (*ServiceQuotaExceededException) Message

Message returns the exception's message.

func (*ServiceQuotaExceededException) OrigErr

func (s *ServiceQuotaExceededException) OrigErr() error

OrigErr always returns nil, satisfies awserr.Error interface.

func (*ServiceQuotaExceededException) RequestID

func (s *ServiceQuotaExceededException) RequestID() string

RequestID returns the service's response RequestID for request.

func (*ServiceQuotaExceededException) StatusCode

func (s *ServiceQuotaExceededException) StatusCode() int

Status code returns the HTTP status code for the request's response error.

func (ServiceQuotaExceededException) String

String returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

type SpecificToolChoice added in v1.53.13

type SpecificToolChoice struct {

	// The name of the tool that the model must request.
	//
	// Name is a required field
	Name *string `locationName:"name" min:"1" type:"string" required:"true"`
	// contains filtered or unexported fields
}

The model must request a specific tool. For example, {"tool" : {"name" : "Your tool name"}}.

This field is only supported by Anthropic Claude 3 models.

func (SpecificToolChoice) GoString added in v1.53.13

func (s SpecificToolChoice) GoString() string

GoString returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (*SpecificToolChoice) SetName added in v1.53.13

SetName sets the Name field's value.

func (SpecificToolChoice) String added in v1.53.13

func (s SpecificToolChoice) String() string

String returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (*SpecificToolChoice) Validate added in v1.53.13

func (s *SpecificToolChoice) Validate() error

Validate inspects the fields of the type to determine if they are valid.

type SystemContentBlock added in v1.53.13

type SystemContentBlock struct {

	// A content block to assess with the guardrail. Use with the Converse API (Converse
	// and ConverseStream).
	//
	// For more information, see Use a guardrail with the Converse API in the Amazon
	// Bedrock User Guide.
	GuardContent *GuardrailConverseContentBlock `locationName:"guardContent" type:"structure"`

	// A system prompt for the model.
	Text *string `locationName:"text" min:"1" type:"string"`
	// contains filtered or unexported fields
}

A system content block.

func (SystemContentBlock) GoString added in v1.53.13

func (s SystemContentBlock) GoString() string

GoString returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (*SystemContentBlock) SetGuardContent added in v1.54.4

SetGuardContent sets the GuardContent field's value.

func (*SystemContentBlock) SetText added in v1.53.13

SetText sets the Text field's value.

func (SystemContentBlock) String added in v1.53.13

func (s SystemContentBlock) String() string

String returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (*SystemContentBlock) Validate added in v1.53.13

func (s *SystemContentBlock) Validate() error

Validate inspects the fields of the type to determine if they are valid.

type ThrottlingException

type ThrottlingException struct {
	RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"`

	Message_ *string `locationName:"message" type:"string"`
	// contains filtered or unexported fields
}

The number of requests exceeds the limit. Resubmit your request later.

func (*ThrottlingException) Code

func (s *ThrottlingException) Code() string

Code returns the exception type name.

func (*ThrottlingException) Error

func (s *ThrottlingException) Error() string

func (ThrottlingException) GoString

func (s ThrottlingException) GoString() string

GoString returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (*ThrottlingException) MarshalEvent

func (s *ThrottlingException) MarshalEvent(pm protocol.PayloadMarshaler) (msg eventstream.Message, err error)

MarshalEvent marshals the type into an stream event value. This method should only used internally within the SDK's EventStream handling.

func (*ThrottlingException) Message

func (s *ThrottlingException) Message() string

Message returns the exception's message.

func (*ThrottlingException) OrigErr

func (s *ThrottlingException) OrigErr() error

OrigErr always returns nil, satisfies awserr.Error interface.

func (*ThrottlingException) RequestID

func (s *ThrottlingException) RequestID() string

RequestID returns the service's response RequestID for request.

func (*ThrottlingException) StatusCode

func (s *ThrottlingException) StatusCode() int

Status code returns the HTTP status code for the request's response error.

func (ThrottlingException) String

func (s ThrottlingException) String() string

String returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (*ThrottlingException) UnmarshalEvent

func (s *ThrottlingException) UnmarshalEvent(
	payloadUnmarshaler protocol.PayloadUnmarshaler,
	msg eventstream.Message,
) error

UnmarshalEvent unmarshals the EventStream Message into the ThrottlingException value. This method is only used internally within the SDK's EventStream handling.

type TokenUsage added in v1.53.13

type TokenUsage struct {

	// The number of tokens sent in the request to the model.
	//
	// InputTokens is a required field
	InputTokens *int64 `locationName:"inputTokens" type:"integer" required:"true"`

	// The number of tokens that the model generated for the request.
	//
	// OutputTokens is a required field
	OutputTokens *int64 `locationName:"outputTokens" type:"integer" required:"true"`

	// The total of input tokens and tokens generated by the model.
	//
	// TotalTokens is a required field
	TotalTokens *int64 `locationName:"totalTokens" type:"integer" required:"true"`
	// contains filtered or unexported fields
}

The tokens used in a message API inference call.

func (TokenUsage) GoString added in v1.53.13

func (s TokenUsage) GoString() string

GoString returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (*TokenUsage) SetInputTokens added in v1.53.13

func (s *TokenUsage) SetInputTokens(v int64) *TokenUsage

SetInputTokens sets the InputTokens field's value.

func (*TokenUsage) SetOutputTokens added in v1.53.13

func (s *TokenUsage) SetOutputTokens(v int64) *TokenUsage

SetOutputTokens sets the OutputTokens field's value.

func (*TokenUsage) SetTotalTokens added in v1.53.13

func (s *TokenUsage) SetTotalTokens(v int64) *TokenUsage

SetTotalTokens sets the TotalTokens field's value.

func (TokenUsage) String added in v1.53.13

func (s TokenUsage) String() string

String returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

type Tool added in v1.53.13

type Tool struct {

	// The specfication for the tool.
	ToolSpec *ToolSpecification `locationName:"toolSpec" type:"structure"`
	// contains filtered or unexported fields
}

Information about a tool that you can use with the Converse API.

func (Tool) GoString added in v1.53.13

func (s Tool) GoString() string

GoString returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (*Tool) SetToolSpec added in v1.53.13

func (s *Tool) SetToolSpec(v *ToolSpecification) *Tool

SetToolSpec sets the ToolSpec field's value.

func (Tool) String added in v1.53.13

func (s Tool) String() string

String returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (*Tool) Validate added in v1.53.13

func (s *Tool) Validate() error

Validate inspects the fields of the type to determine if they are valid.

type ToolChoice added in v1.53.13

type ToolChoice struct {

	// The model must request at least one tool (no text is generated).
	Any *AnyToolChoice `locationName:"any" type:"structure"`

	// (Default). The Model automatically decides if a tool should be called or
	// whether to generate text instead.
	Auto *AutoToolChoice `locationName:"auto" type:"structure"`

	// The Model must request the specified tool. Only supported by Anthropic Claude
	// 3 models.
	Tool *SpecificToolChoice `locationName:"tool" type:"structure"`
	// contains filtered or unexported fields
}

Determines which tools the model should request in a call to Converse or ConverseStream. ToolChoice is only supported by Anthropic Claude 3 models and by Mistral AI Mistral Large.

func (ToolChoice) GoString added in v1.53.13

func (s ToolChoice) GoString() string

GoString returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (*ToolChoice) SetAny added in v1.53.13

func (s *ToolChoice) SetAny(v *AnyToolChoice) *ToolChoice

SetAny sets the Any field's value.

func (*ToolChoice) SetAuto added in v1.53.13

func (s *ToolChoice) SetAuto(v *AutoToolChoice) *ToolChoice

SetAuto sets the Auto field's value.

func (*ToolChoice) SetTool added in v1.53.13

func (s *ToolChoice) SetTool(v *SpecificToolChoice) *ToolChoice

SetTool sets the Tool field's value.

func (ToolChoice) String added in v1.53.13

func (s ToolChoice) String() string

String returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (*ToolChoice) Validate added in v1.53.13

func (s *ToolChoice) Validate() error

Validate inspects the fields of the type to determine if they are valid.

type ToolConfiguration added in v1.53.13

type ToolConfiguration struct {

	// If supported by model, forces the model to request a tool.
	ToolChoice *ToolChoice `locationName:"toolChoice" type:"structure"`

	// An array of tools that you want to pass to a model.
	//
	// Tools is a required field
	Tools []*Tool `locationName:"tools" min:"1" type:"list" required:"true"`
	// contains filtered or unexported fields
}

Configuration information for the tools that you pass to a model.

This field is only supported by Anthropic Claude 3, Cohere Command R, Cohere Command R+, and Mistral Large models.

func (ToolConfiguration) GoString added in v1.53.13

func (s ToolConfiguration) GoString() string

GoString returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (*ToolConfiguration) SetToolChoice added in v1.53.13

func (s *ToolConfiguration) SetToolChoice(v *ToolChoice) *ToolConfiguration

SetToolChoice sets the ToolChoice field's value.

func (*ToolConfiguration) SetTools added in v1.53.13

func (s *ToolConfiguration) SetTools(v []*Tool) *ToolConfiguration

SetTools sets the Tools field's value.

func (ToolConfiguration) String added in v1.53.13

func (s ToolConfiguration) String() string

String returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (*ToolConfiguration) Validate added in v1.53.13

func (s *ToolConfiguration) Validate() error

Validate inspects the fields of the type to determine if they are valid.

type ToolInputSchema added in v1.53.13

type ToolInputSchema struct {
	// contains filtered or unexported fields
}

The schema for the tool. The top level schema type must be object.

func (ToolInputSchema) GoString added in v1.53.13

func (s ToolInputSchema) GoString() string

GoString returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (ToolInputSchema) String added in v1.53.13

func (s ToolInputSchema) String() string

String returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

type ToolResultBlock added in v1.53.13

type ToolResultBlock struct {

	// The content for tool result content block.
	//
	// Content is a required field
	Content []*ToolResultContentBlock `locationName:"content" type:"list" required:"true"`

	// The status for the tool result content block.
	//
	// This field is only supported Anthropic Claude 3 models.
	Status *string `locationName:"status" type:"string" enum:"ToolResultStatus"`

	// The ID of the tool request that this is the result for.
	//
	// ToolUseId is a required field
	ToolUseId *string `locationName:"toolUseId" min:"1" type:"string" required:"true"`
	// contains filtered or unexported fields
}

A tool result block that contains the results for a tool request that the model previously made.

func (ToolResultBlock) GoString added in v1.53.13

func (s ToolResultBlock) GoString() string

GoString returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (*ToolResultBlock) SetContent added in v1.53.13

SetContent sets the Content field's value.

func (*ToolResultBlock) SetStatus added in v1.53.13

func (s *ToolResultBlock) SetStatus(v string) *ToolResultBlock

SetStatus sets the Status field's value.

func (*ToolResultBlock) SetToolUseId added in v1.53.13

func (s *ToolResultBlock) SetToolUseId(v string) *ToolResultBlock

SetToolUseId sets the ToolUseId field's value.

func (ToolResultBlock) String added in v1.53.13

func (s ToolResultBlock) String() string

String returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (*ToolResultBlock) Validate added in v1.53.13

func (s *ToolResultBlock) Validate() error

Validate inspects the fields of the type to determine if they are valid.

type ToolResultContentBlock added in v1.53.13

type ToolResultContentBlock struct {

	// A tool result that is a document.
	Document *DocumentBlock `locationName:"document" type:"structure"`

	// A tool result that is an image.
	//
	// This field is only supported by Anthropic Claude 3 models.
	Image *ImageBlock `locationName:"image" type:"structure"`

	// A tool result that is text.
	Text *string `locationName:"text" type:"string"`
	// contains filtered or unexported fields
}

The tool result content block.

func (ToolResultContentBlock) GoString added in v1.53.13

func (s ToolResultContentBlock) GoString() string

GoString returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (*ToolResultContentBlock) SetDocument added in v1.54.6

SetDocument sets the Document field's value.

func (*ToolResultContentBlock) SetImage added in v1.53.13

SetImage sets the Image field's value.

func (*ToolResultContentBlock) SetText added in v1.53.13

SetText sets the Text field's value.

func (ToolResultContentBlock) String added in v1.53.13

func (s ToolResultContentBlock) String() string

String returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (*ToolResultContentBlock) Validate added in v1.53.13

func (s *ToolResultContentBlock) Validate() error

Validate inspects the fields of the type to determine if they are valid.

type ToolSpecification added in v1.53.13

type ToolSpecification struct {

	// The description for the tool.
	Description *string `locationName:"description" min:"1" type:"string"`

	// The input schema for the tool in JSON format.
	//
	// InputSchema is a required field
	InputSchema *ToolInputSchema `locationName:"inputSchema" type:"structure" required:"true"`

	// The name for the tool.
	//
	// Name is a required field
	Name *string `locationName:"name" min:"1" type:"string" required:"true"`
	// contains filtered or unexported fields
}

The specification for the tool.

func (ToolSpecification) GoString added in v1.53.13

func (s ToolSpecification) GoString() string

GoString returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (*ToolSpecification) SetDescription added in v1.53.13

func (s *ToolSpecification) SetDescription(v string) *ToolSpecification

SetDescription sets the Description field's value.

func (*ToolSpecification) SetInputSchema added in v1.53.13

func (s *ToolSpecification) SetInputSchema(v *ToolInputSchema) *ToolSpecification

SetInputSchema sets the InputSchema field's value.

func (*ToolSpecification) SetName added in v1.53.13

SetName sets the Name field's value.

func (ToolSpecification) String added in v1.53.13

func (s ToolSpecification) String() string

String returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (*ToolSpecification) Validate added in v1.53.13

func (s *ToolSpecification) Validate() error

Validate inspects the fields of the type to determine if they are valid.

type ToolUseBlockDelta added in v1.53.13

type ToolUseBlockDelta struct {

	// The input for a requested tool.
	//
	// Input is a required field
	Input *string `locationName:"input" type:"string" required:"true"`
	// contains filtered or unexported fields
}

The delta for a tool use block.

func (ToolUseBlockDelta) GoString added in v1.53.13

func (s ToolUseBlockDelta) GoString() string

GoString returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (*ToolUseBlockDelta) SetInput added in v1.53.13

func (s *ToolUseBlockDelta) SetInput(v string) *ToolUseBlockDelta

SetInput sets the Input field's value.

func (ToolUseBlockDelta) String added in v1.53.13

func (s ToolUseBlockDelta) String() string

String returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

type ToolUseBlockStart added in v1.53.13

type ToolUseBlockStart struct {

	// The name of the tool that the model is requesting to use.
	//
	// Name is a required field
	Name *string `locationName:"name" min:"1" type:"string" required:"true"`

	// The ID for the tool request.
	//
	// ToolUseId is a required field
	ToolUseId *string `locationName:"toolUseId" min:"1" type:"string" required:"true"`
	// contains filtered or unexported fields
}

The start of a tool use block.

func (ToolUseBlockStart) GoString added in v1.53.13

func (s ToolUseBlockStart) GoString() string

GoString returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (*ToolUseBlockStart) SetName added in v1.53.13

SetName sets the Name field's value.

func (*ToolUseBlockStart) SetToolUseId added in v1.53.13

func (s *ToolUseBlockStart) SetToolUseId(v string) *ToolUseBlockStart

SetToolUseId sets the ToolUseId field's value.

func (ToolUseBlockStart) String added in v1.53.13

func (s ToolUseBlockStart) String() string

String returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

type ValidationException

type ValidationException struct {
	RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"`

	Message_ *string `locationName:"message" type:"string"`
	// contains filtered or unexported fields
}

Input validation failed. Check your request parameters and retry the request.

func (*ValidationException) Code

func (s *ValidationException) Code() string

Code returns the exception type name.

func (*ValidationException) Error

func (s *ValidationException) Error() string

func (ValidationException) GoString

func (s ValidationException) GoString() string

GoString returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (*ValidationException) MarshalEvent

func (s *ValidationException) MarshalEvent(pm protocol.PayloadMarshaler) (msg eventstream.Message, err error)

MarshalEvent marshals the type into an stream event value. This method should only used internally within the SDK's EventStream handling.

func (*ValidationException) Message

func (s *ValidationException) Message() string

Message returns the exception's message.

func (*ValidationException) OrigErr

func (s *ValidationException) OrigErr() error

OrigErr always returns nil, satisfies awserr.Error interface.

func (*ValidationException) RequestID

func (s *ValidationException) RequestID() string

RequestID returns the service's response RequestID for request.

func (*ValidationException) StatusCode

func (s *ValidationException) StatusCode() int

Status code returns the HTTP status code for the request's response error.

func (ValidationException) String

func (s ValidationException) String() string

String returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (*ValidationException) UnmarshalEvent

func (s *ValidationException) UnmarshalEvent(
	payloadUnmarshaler protocol.PayloadUnmarshaler,
	msg eventstream.Message,
) error

UnmarshalEvent unmarshals the EventStream Message into the ValidationException value. This method is only used internally within the SDK's EventStream handling.

Directories

Path Synopsis
Package bedrockruntimeiface provides an interface to enable mocking the Amazon Bedrock Runtime service client for testing your code.
Package bedrockruntimeiface provides an interface to enable mocking the Amazon Bedrock Runtime service client for testing your code.

Jump to

Keyboard shortcuts

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