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
- func ConversationRole_Values() []string
- func ImageFormat_Values() []string
- func StopReason_Values() []string
- func ToolResultStatus_Values() []string
- func Trace_Values() []string
- type AccessDeniedException
- func (s *AccessDeniedException) Code() string
- func (s *AccessDeniedException) Error() string
- func (s AccessDeniedException) GoString() string
- func (s *AccessDeniedException) Message() string
- func (s *AccessDeniedException) OrigErr() error
- func (s *AccessDeniedException) RequestID() string
- func (s *AccessDeniedException) StatusCode() int
- func (s AccessDeniedException) String() string
- type AnyToolChoice
- type AutoToolChoice
- type BedrockRuntime
- func (c *BedrockRuntime) Converse(input *ConverseInput) (*ConverseOutput, error)
- func (c *BedrockRuntime) ConverseRequest(input *ConverseInput) (req *request.Request, output *ConverseOutput)
- func (c *BedrockRuntime) ConverseStream(input *ConverseStreamInput) (*ConverseStreamOutput, error)
- func (c *BedrockRuntime) ConverseStreamRequest(input *ConverseStreamInput) (req *request.Request, output *ConverseStreamOutput)
- func (c *BedrockRuntime) ConverseStreamWithContext(ctx aws.Context, input *ConverseStreamInput, opts ...request.Option) (*ConverseStreamOutput, error)
- func (c *BedrockRuntime) ConverseWithContext(ctx aws.Context, input *ConverseInput, opts ...request.Option) (*ConverseOutput, error)
- func (c *BedrockRuntime) InvokeModel(input *InvokeModelInput) (*InvokeModelOutput, error)
- func (c *BedrockRuntime) InvokeModelRequest(input *InvokeModelInput) (req *request.Request, output *InvokeModelOutput)
- func (c *BedrockRuntime) InvokeModelWithContext(ctx aws.Context, input *InvokeModelInput, opts ...request.Option) (*InvokeModelOutput, error)
- func (c *BedrockRuntime) InvokeModelWithResponseStream(input *InvokeModelWithResponseStreamInput) (*InvokeModelWithResponseStreamOutput, error)
- func (c *BedrockRuntime) InvokeModelWithResponseStreamRequest(input *InvokeModelWithResponseStreamInput) (req *request.Request, output *InvokeModelWithResponseStreamOutput)
- func (c *BedrockRuntime) InvokeModelWithResponseStreamWithContext(ctx aws.Context, input *InvokeModelWithResponseStreamInput, ...) (*InvokeModelWithResponseStreamOutput, error)
- type ContentBlock
- func (s ContentBlock) GoString() string
- func (s *ContentBlock) SetImage(v *ImageBlock) *ContentBlock
- func (s *ContentBlock) SetText(v string) *ContentBlock
- func (s *ContentBlock) SetToolResult(v *ToolResultBlock) *ContentBlock
- func (s ContentBlock) String() string
- func (s *ContentBlock) Validate() error
- type ContentBlockDelta
- type ContentBlockDeltaEvent
- func (s ContentBlockDeltaEvent) GoString() string
- func (s *ContentBlockDeltaEvent) MarshalEvent(pm protocol.PayloadMarshaler) (msg eventstream.Message, err error)
- func (s *ContentBlockDeltaEvent) SetContentBlockIndex(v int64) *ContentBlockDeltaEvent
- func (s *ContentBlockDeltaEvent) SetDelta(v *ContentBlockDelta) *ContentBlockDeltaEvent
- func (s ContentBlockDeltaEvent) String() string
- func (s *ContentBlockDeltaEvent) UnmarshalEvent(payloadUnmarshaler protocol.PayloadUnmarshaler, msg eventstream.Message) error
- type ContentBlockStart
- type ContentBlockStartEvent
- func (s ContentBlockStartEvent) GoString() string
- func (s *ContentBlockStartEvent) MarshalEvent(pm protocol.PayloadMarshaler) (msg eventstream.Message, err error)
- func (s *ContentBlockStartEvent) SetContentBlockIndex(v int64) *ContentBlockStartEvent
- func (s *ContentBlockStartEvent) SetStart(v *ContentBlockStart) *ContentBlockStartEvent
- func (s ContentBlockStartEvent) String() string
- func (s *ContentBlockStartEvent) UnmarshalEvent(payloadUnmarshaler protocol.PayloadUnmarshaler, msg eventstream.Message) error
- type ContentBlockStopEvent
- func (s ContentBlockStopEvent) GoString() string
- func (s *ContentBlockStopEvent) MarshalEvent(pm protocol.PayloadMarshaler) (msg eventstream.Message, err error)
- func (s *ContentBlockStopEvent) SetContentBlockIndex(v int64) *ContentBlockStopEvent
- func (s ContentBlockStopEvent) String() string
- func (s *ContentBlockStopEvent) UnmarshalEvent(payloadUnmarshaler protocol.PayloadUnmarshaler, msg eventstream.Message) error
- type ConverseInput
- func (s ConverseInput) GoString() string
- func (s *ConverseInput) SetAdditionalModelResponseFieldPaths(v []*string) *ConverseInput
- func (s *ConverseInput) SetInferenceConfig(v *InferenceConfiguration) *ConverseInput
- func (s *ConverseInput) SetMessages(v []*Message) *ConverseInput
- func (s *ConverseInput) SetModelId(v string) *ConverseInput
- func (s *ConverseInput) SetSystem(v []*SystemContentBlock) *ConverseInput
- func (s *ConverseInput) SetToolConfig(v *ToolConfiguration) *ConverseInput
- func (s ConverseInput) String() string
- func (s *ConverseInput) Validate() error
- type ConverseMetrics
- type ConverseOutput
- func (s ConverseOutput) GoString() string
- func (s *ConverseOutput) SetMetrics(v *ConverseMetrics) *ConverseOutput
- func (s *ConverseOutput) SetOutput(v *ConverseOutput_) *ConverseOutput
- func (s *ConverseOutput) SetStopReason(v string) *ConverseOutput
- func (s *ConverseOutput) SetUsage(v *TokenUsage) *ConverseOutput
- func (s ConverseOutput) String() string
- type ConverseOutput_
- type ConverseStreamEventStream
- type ConverseStreamInput
- func (s ConverseStreamInput) GoString() string
- func (s *ConverseStreamInput) SetAdditionalModelResponseFieldPaths(v []*string) *ConverseStreamInput
- func (s *ConverseStreamInput) SetInferenceConfig(v *InferenceConfiguration) *ConverseStreamInput
- func (s *ConverseStreamInput) SetMessages(v []*Message) *ConverseStreamInput
- func (s *ConverseStreamInput) SetModelId(v string) *ConverseStreamInput
- func (s *ConverseStreamInput) SetSystem(v []*SystemContentBlock) *ConverseStreamInput
- func (s *ConverseStreamInput) SetToolConfig(v *ToolConfiguration) *ConverseStreamInput
- func (s ConverseStreamInput) String() string
- func (s *ConverseStreamInput) Validate() error
- type ConverseStreamMetadataEvent
- func (s ConverseStreamMetadataEvent) GoString() string
- func (s *ConverseStreamMetadataEvent) MarshalEvent(pm protocol.PayloadMarshaler) (msg eventstream.Message, err error)
- func (s *ConverseStreamMetadataEvent) SetMetrics(v *ConverseStreamMetrics) *ConverseStreamMetadataEvent
- func (s *ConverseStreamMetadataEvent) SetUsage(v *TokenUsage) *ConverseStreamMetadataEvent
- func (s ConverseStreamMetadataEvent) String() string
- func (s *ConverseStreamMetadataEvent) UnmarshalEvent(payloadUnmarshaler protocol.PayloadUnmarshaler, msg eventstream.Message) error
- type ConverseStreamMetrics
- type ConverseStreamOutput
- type ConverseStreamOutput_Event
- type ConverseStreamOutput_Reader
- type ConverseStreamOutput_UnknownEvent
- type ImageBlock
- type ImageSource
- type InferenceConfiguration
- func (s InferenceConfiguration) GoString() string
- func (s *InferenceConfiguration) SetMaxTokens(v int64) *InferenceConfiguration
- func (s *InferenceConfiguration) SetStopSequences(v []*string) *InferenceConfiguration
- func (s *InferenceConfiguration) SetTemperature(v float64) *InferenceConfiguration
- func (s *InferenceConfiguration) SetTopP(v float64) *InferenceConfiguration
- func (s InferenceConfiguration) String() string
- func (s *InferenceConfiguration) Validate() error
- type InternalServerException
- func (s *InternalServerException) Code() string
- func (s *InternalServerException) Error() string
- func (s InternalServerException) GoString() string
- func (s *InternalServerException) MarshalEvent(pm protocol.PayloadMarshaler) (msg eventstream.Message, err error)
- func (s *InternalServerException) Message() string
- func (s *InternalServerException) OrigErr() error
- func (s *InternalServerException) RequestID() string
- func (s *InternalServerException) StatusCode() int
- func (s InternalServerException) String() string
- func (s *InternalServerException) UnmarshalEvent(payloadUnmarshaler protocol.PayloadUnmarshaler, msg eventstream.Message) error
- type InvokeModelInput
- func (s InvokeModelInput) GoString() string
- func (s *InvokeModelInput) SetAccept(v string) *InvokeModelInput
- func (s *InvokeModelInput) SetBody(v []byte) *InvokeModelInput
- func (s *InvokeModelInput) SetContentType(v string) *InvokeModelInput
- func (s *InvokeModelInput) SetGuardrailIdentifier(v string) *InvokeModelInput
- func (s *InvokeModelInput) SetGuardrailVersion(v string) *InvokeModelInput
- func (s *InvokeModelInput) SetModelId(v string) *InvokeModelInput
- func (s *InvokeModelInput) SetTrace(v string) *InvokeModelInput
- func (s InvokeModelInput) String() string
- func (s *InvokeModelInput) Validate() error
- type InvokeModelOutput
- type InvokeModelWithResponseStreamEventStream
- type InvokeModelWithResponseStreamInput
- func (s InvokeModelWithResponseStreamInput) GoString() string
- func (s *InvokeModelWithResponseStreamInput) SetAccept(v string) *InvokeModelWithResponseStreamInput
- func (s *InvokeModelWithResponseStreamInput) SetBody(v []byte) *InvokeModelWithResponseStreamInput
- func (s *InvokeModelWithResponseStreamInput) SetContentType(v string) *InvokeModelWithResponseStreamInput
- func (s *InvokeModelWithResponseStreamInput) SetGuardrailIdentifier(v string) *InvokeModelWithResponseStreamInput
- func (s *InvokeModelWithResponseStreamInput) SetGuardrailVersion(v string) *InvokeModelWithResponseStreamInput
- func (s *InvokeModelWithResponseStreamInput) SetModelId(v string) *InvokeModelWithResponseStreamInput
- func (s *InvokeModelWithResponseStreamInput) SetTrace(v string) *InvokeModelWithResponseStreamInput
- func (s InvokeModelWithResponseStreamInput) String() string
- func (s *InvokeModelWithResponseStreamInput) Validate() error
- type InvokeModelWithResponseStreamOutput
- func (s *InvokeModelWithResponseStreamOutput) GetStream() *InvokeModelWithResponseStreamEventStream
- func (s InvokeModelWithResponseStreamOutput) GoString() string
- func (s *InvokeModelWithResponseStreamOutput) SetContentType(v string) *InvokeModelWithResponseStreamOutput
- func (s InvokeModelWithResponseStreamOutput) String() string
- type Message
- type MessageStartEvent
- func (s MessageStartEvent) GoString() string
- func (s *MessageStartEvent) MarshalEvent(pm protocol.PayloadMarshaler) (msg eventstream.Message, err error)
- func (s *MessageStartEvent) SetRole(v string) *MessageStartEvent
- func (s MessageStartEvent) String() string
- func (s *MessageStartEvent) UnmarshalEvent(payloadUnmarshaler protocol.PayloadUnmarshaler, msg eventstream.Message) error
- type MessageStopEvent
- func (s MessageStopEvent) GoString() string
- func (s *MessageStopEvent) MarshalEvent(pm protocol.PayloadMarshaler) (msg eventstream.Message, err error)
- func (s *MessageStopEvent) SetStopReason(v string) *MessageStopEvent
- func (s MessageStopEvent) String() string
- func (s *MessageStopEvent) UnmarshalEvent(payloadUnmarshaler protocol.PayloadUnmarshaler, msg eventstream.Message) error
- type ModelErrorException
- func (s *ModelErrorException) Code() string
- func (s *ModelErrorException) Error() string
- func (s ModelErrorException) GoString() string
- func (s *ModelErrorException) Message() string
- func (s *ModelErrorException) OrigErr() error
- func (s *ModelErrorException) RequestID() string
- func (s *ModelErrorException) StatusCode() int
- func (s ModelErrorException) String() string
- type ModelNotReadyException
- func (s *ModelNotReadyException) Code() string
- func (s *ModelNotReadyException) Error() string
- func (s ModelNotReadyException) GoString() string
- func (s *ModelNotReadyException) Message() string
- func (s *ModelNotReadyException) OrigErr() error
- func (s *ModelNotReadyException) RequestID() string
- func (s *ModelNotReadyException) StatusCode() int
- func (s ModelNotReadyException) String() string
- type ModelStreamErrorException
- func (s *ModelStreamErrorException) Code() string
- func (s *ModelStreamErrorException) Error() string
- func (s ModelStreamErrorException) GoString() string
- func (s *ModelStreamErrorException) MarshalEvent(pm protocol.PayloadMarshaler) (msg eventstream.Message, err error)
- func (s *ModelStreamErrorException) Message() string
- func (s *ModelStreamErrorException) OrigErr() error
- func (s *ModelStreamErrorException) RequestID() string
- func (s *ModelStreamErrorException) StatusCode() int
- func (s ModelStreamErrorException) String() string
- func (s *ModelStreamErrorException) UnmarshalEvent(payloadUnmarshaler protocol.PayloadUnmarshaler, msg eventstream.Message) error
- type ModelTimeoutException
- func (s *ModelTimeoutException) Code() string
- func (s *ModelTimeoutException) Error() string
- func (s ModelTimeoutException) GoString() string
- func (s *ModelTimeoutException) MarshalEvent(pm protocol.PayloadMarshaler) (msg eventstream.Message, err error)
- func (s *ModelTimeoutException) Message() string
- func (s *ModelTimeoutException) OrigErr() error
- func (s *ModelTimeoutException) RequestID() string
- func (s *ModelTimeoutException) StatusCode() int
- func (s ModelTimeoutException) String() string
- func (s *ModelTimeoutException) UnmarshalEvent(payloadUnmarshaler protocol.PayloadUnmarshaler, msg eventstream.Message) error
- type PayloadPart
- func (s PayloadPart) GoString() string
- func (s *PayloadPart) MarshalEvent(pm protocol.PayloadMarshaler) (msg eventstream.Message, err error)
- func (s *PayloadPart) SetBytes(v []byte) *PayloadPart
- func (s PayloadPart) String() string
- func (s *PayloadPart) UnmarshalEvent(payloadUnmarshaler protocol.PayloadUnmarshaler, msg eventstream.Message) error
- type ResourceNotFoundException
- func (s *ResourceNotFoundException) Code() string
- func (s *ResourceNotFoundException) Error() string
- func (s ResourceNotFoundException) GoString() string
- func (s *ResourceNotFoundException) Message() string
- func (s *ResourceNotFoundException) OrigErr() error
- func (s *ResourceNotFoundException) RequestID() string
- func (s *ResourceNotFoundException) StatusCode() int
- func (s ResourceNotFoundException) String() string
- type ResponseStreamEvent
- type ResponseStreamReader
- type ResponseStreamUnknownEvent
- type ServiceQuotaExceededException
- func (s *ServiceQuotaExceededException) Code() string
- func (s *ServiceQuotaExceededException) Error() string
- func (s ServiceQuotaExceededException) GoString() string
- func (s *ServiceQuotaExceededException) Message() string
- func (s *ServiceQuotaExceededException) OrigErr() error
- func (s *ServiceQuotaExceededException) RequestID() string
- func (s *ServiceQuotaExceededException) StatusCode() int
- func (s ServiceQuotaExceededException) String() string
- type SpecificToolChoice
- type SystemContentBlock
- type ThrottlingException
- func (s *ThrottlingException) Code() string
- func (s *ThrottlingException) Error() string
- func (s ThrottlingException) GoString() string
- func (s *ThrottlingException) MarshalEvent(pm protocol.PayloadMarshaler) (msg eventstream.Message, err error)
- func (s *ThrottlingException) Message() string
- func (s *ThrottlingException) OrigErr() error
- func (s *ThrottlingException) RequestID() string
- func (s *ThrottlingException) StatusCode() int
- func (s ThrottlingException) String() string
- func (s *ThrottlingException) UnmarshalEvent(payloadUnmarshaler protocol.PayloadUnmarshaler, msg eventstream.Message) error
- type TokenUsage
- type Tool
- type ToolChoice
- type ToolConfiguration
- type ToolInputSchema
- type ToolResultBlock
- func (s ToolResultBlock) GoString() string
- func (s *ToolResultBlock) SetContent(v []*ToolResultContentBlock) *ToolResultBlock
- func (s *ToolResultBlock) SetStatus(v string) *ToolResultBlock
- func (s *ToolResultBlock) SetToolUseId(v string) *ToolResultBlock
- func (s ToolResultBlock) String() string
- func (s *ToolResultBlock) Validate() error
- type ToolResultContentBlock
- func (s ToolResultContentBlock) GoString() string
- func (s *ToolResultContentBlock) SetImage(v *ImageBlock) *ToolResultContentBlock
- func (s *ToolResultContentBlock) SetText(v string) *ToolResultContentBlock
- func (s ToolResultContentBlock) String() string
- func (s *ToolResultContentBlock) Validate() error
- type ToolSpecification
- func (s ToolSpecification) GoString() string
- func (s *ToolSpecification) SetDescription(v string) *ToolSpecification
- func (s *ToolSpecification) SetInputSchema(v *ToolInputSchema) *ToolSpecification
- func (s *ToolSpecification) SetName(v string) *ToolSpecification
- func (s ToolSpecification) String() string
- func (s *ToolSpecification) Validate() error
- type ToolUseBlockDelta
- type ToolUseBlockStart
- type ValidationException
- func (s *ValidationException) Code() string
- func (s *ValidationException) Error() string
- func (s ValidationException) GoString() string
- func (s *ValidationException) MarshalEvent(pm protocol.PayloadMarshaler) (msg eventstream.Message, err error)
- func (s *ValidationException) Message() string
- func (s *ValidationException) OrigErr() error
- func (s *ValidationException) RequestID() string
- func (s *ValidationException) StatusCode() int
- func (s ValidationException) String() string
- func (s *ValidationException) UnmarshalEvent(payloadUnmarshaler protocol.PayloadUnmarshaler, msg eventstream.Message) error
Constants ¶
const ( // ConversationRoleUser is a ConversationRole enum value ConversationRoleUser = "user" // ConversationRoleAssistant is a ConversationRole enum value ConversationRoleAssistant = "assistant" )
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" )
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" // StopReasonContentFiltered is a StopReason enum value StopReasonContentFiltered = "content_filtered" )
const ( // ToolResultStatusSuccess is a ToolResultStatus enum value ToolResultStatusSuccess = "success" // ToolResultStatusError is a ToolResultStatus enum value ToolResultStatusError = "error" )
const ( // TraceEnabled is a Trace enum value TraceEnabled = "ENABLED" // TraceDisabled is a Trace enum value TraceDisabled = "DISABLED" )
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" )
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
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 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).
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 to whether to generate text instead.
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 ¶
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 more information, see Run inference (https://docs.aws.amazon.com/bedrock/latest/userguide/api-methods-run.html) in the 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. For more information, see Run inference (https://docs.aws.amazon.com/bedrock/latest/userguide/api-methods-run.html) in the Bedrock User Guide.
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 example code, see Invoke model with streaming code 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 ¶
func (c *BedrockRuntime) InvokeModelWithResponseStream(input *InvokeModelWithResponseStreamInput) (*InvokeModelWithResponseStreamOutput, error)
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 { // 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.
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) 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
func (s *ContentBlockDelta) SetText(v string) *ContentBlockDelta
SetText sets the Text field's value.
func (*ContentBlockDelta) SetToolUse ¶ added in v1.53.13
func (s *ContentBlockDelta) SetToolUse(v *ToolUseBlockDelta) *ContentBlockDelta
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
func (s *ContentBlockDeltaEvent) 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 (*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
func (s *ContentBlockDeltaEvent) SetDelta(v *ContentBlockDelta) *ContentBlockDeltaEvent
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
func (s *ContentBlockStart) SetToolUse(v *ToolUseBlockStart) *ContentBlockStart
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
func (s *ContentBlockStartEvent) 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 (*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
func (s *ContentBlockStartEvent) SetStart(v *ContentBlockStart) *ContentBlockStartEvent
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
func (s *ContentBlockStopEvent) 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 (*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 additionalModelResultFields // 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"` // 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) 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"` // 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) 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
func (es *ConverseStreamEventStream) Events() <-chan ConverseStreamOutput_Event
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 additionalModelResultFields // 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"` // 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) SetInferenceConfig ¶ added in v1.53.13
func (s *ConverseStreamInput) SetInferenceConfig(v *InferenceConfiguration) *ConverseStreamInput
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
func (s *ConverseStreamInput) SetModelId(v string) *ConverseStreamInput
SetModelId sets the ModelId field's value.
func (*ConverseStreamInput) SetSystem ¶ added in v1.53.13
func (s *ConverseStreamInput) SetSystem(v []*SystemContentBlock) *ConverseStreamInput
SetSystem sets the System field's value.
func (*ConverseStreamInput) SetToolConfig ¶ added in v1.53.13
func (s *ConverseStreamInput) SetToolConfig(v *ToolConfiguration) *ConverseStreamInput
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"` // 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
func (s *ConverseStreamMetadataEvent) 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 (*ConverseStreamMetadataEvent) SetMetrics ¶ added in v1.53.13
func (s *ConverseStreamMetadataEvent) SetMetrics(v *ConverseStreamMetrics) *ConverseStreamMetadataEvent
SetMetrics sets the Metrics field's value.
func (*ConverseStreamMetadataEvent) SetUsage ¶ added in v1.53.13
func (s *ConverseStreamMetadataEvent) SetUsage(v *TokenUsage) *ConverseStreamMetadataEvent
SetUsage sets the Usage field's value.
func (ConverseStreamMetadataEvent) String ¶ added in v1.53.13
func (s ConverseStreamMetadataEvent) 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 (*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
func (s *ConverseStreamMetrics) SetLatencyMs(v int64) *ConverseStreamMetrics
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
func (s *ConverseStreamOutput) GetStream() *ConverseStreamEventStream
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
func (e *ConverseStreamOutput_UnknownEvent) 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 (*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 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 foundatio{ "messages": [ { // "role": "user", "content": [ { "text": "what's the weather in Queens, NY // and Austin, TX?" } ] }, { "role": "assistant", "content": [ { "toolUse": // { "toolUseId": "1", "name": "get_weather", "input": { "city": "Queens", "state": // "NY" } } }, { "toolUse": { "toolUseId": "2", "name": "get_weather", "input": // { "city": "Austin", "state": "TX" } } } ] }, { "role": "user", "content": // [ { "toolResult": { "toolUseId": "2", "content": [ { "json": { "weather": // "40" } } ] } }, { "text": "..." }, { "toolResult": { "toolUseId": "1", "content": // [ { "text": "result text" } ] } } ] } ], "toolConfig": { "tools": [ { "name": // "get_weather", "description": "Get weather", "inputSchema": { "type": "object", // "properties": { "city": { "type": "string", "description": "City of location" // }, "state": { "type": "string", "description": "State of location" } }, "required": // ["city", "state"] } } ] } } n 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
func (s *InferenceConfiguration) SetMaxTokens(v int64) *InferenceConfiguration
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
func (s *InferenceConfiguration) SetTemperature(v float64) *InferenceConfiguration
SetTemperature sets the Temperature field's value.
func (*InferenceConfiguration) SetTopP ¶ added in v1.53.13
func (s *InferenceConfiguration) SetTopP(v float64) *InferenceConfiguration
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 ¶
func (s *InternalServerException) 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 (*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. 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. The default value is 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 ¶
func (es *InvokeModelWithResponseStreamEventStream) 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 (*InvokeModelWithResponseStreamEventStream) Err ¶
func (es *InvokeModelWithResponseStreamEventStream) 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 (*InvokeModelWithResponseStreamEventStream) Events ¶
func (es *InvokeModelWithResponseStreamEventStream) Events() <-chan ResponseStreamEvent
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. 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. The default value is 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 ¶
func (s InvokeModelWithResponseStreamInput) 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 (*InvokeModelWithResponseStreamInput) SetAccept ¶
func (s *InvokeModelWithResponseStreamInput) SetAccept(v string) *InvokeModelWithResponseStreamInput
SetAccept sets the Accept field's value.
func (*InvokeModelWithResponseStreamInput) SetBody ¶
func (s *InvokeModelWithResponseStreamInput) SetBody(v []byte) *InvokeModelWithResponseStreamInput
SetBody sets the Body field's value.
func (*InvokeModelWithResponseStreamInput) SetContentType ¶
func (s *InvokeModelWithResponseStreamInput) SetContentType(v string) *InvokeModelWithResponseStreamInput
SetContentType sets the ContentType field's value.
func (*InvokeModelWithResponseStreamInput) SetGuardrailIdentifier ¶ added in v1.51.27
func (s *InvokeModelWithResponseStreamInput) SetGuardrailIdentifier(v string) *InvokeModelWithResponseStreamInput
SetGuardrailIdentifier sets the GuardrailIdentifier field's value.
func (*InvokeModelWithResponseStreamInput) SetGuardrailVersion ¶ added in v1.51.27
func (s *InvokeModelWithResponseStreamInput) SetGuardrailVersion(v string) *InvokeModelWithResponseStreamInput
SetGuardrailVersion sets the GuardrailVersion field's value.
func (*InvokeModelWithResponseStreamInput) SetModelId ¶
func (s *InvokeModelWithResponseStreamInput) SetModelId(v string) *InvokeModelWithResponseStreamInput
SetModelId sets the ModelId field's value.
func (*InvokeModelWithResponseStreamInput) SetTrace ¶ added in v1.51.27
func (s *InvokeModelWithResponseStreamInput) SetTrace(v string) *InvokeModelWithResponseStreamInput
SetTrace sets the Trace field's value.
func (InvokeModelWithResponseStreamInput) String ¶
func (s InvokeModelWithResponseStreamInput) 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 (*InvokeModelWithResponseStreamInput) Validate ¶
func (s *InvokeModelWithResponseStreamInput) Validate() error
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 ¶
func (s *InvokeModelWithResponseStreamOutput) GetStream() *InvokeModelWithResponseStreamEventStream
GetStream returns the type to interact with the event stream.
func (InvokeModelWithResponseStreamOutput) GoString ¶
func (s InvokeModelWithResponseStreamOutput) 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 (*InvokeModelWithResponseStreamOutput) SetContentType ¶
func (s *InvokeModelWithResponseStreamOutput) SetContentType(v string) *InvokeModelWithResponseStreamOutput
SetContentType sets the ContentType field's value.
func (InvokeModelWithResponseStreamOutput) String ¶
func (s InvokeModelWithResponseStreamOutput) 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 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 in the Message (https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_Message.html) field. Use to send a message in a call to Converse (https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_Converse.html).
func (Message) GoString ¶ added in v1.53.13
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.
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
func (s *MessageStartEvent) SetRole(v string) *MessageStartEvent
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 ¶
func (s *ModelStreamErrorException) Code() string
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 ¶
func (s *ModelStreamErrorException) 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 (*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
func (s *ModelTimeoutException) 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 (*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 ¶
func (s *ResourceNotFoundException) Code() string
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 ¶
func (e *ResponseStreamUnknownEvent) 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 (*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 ¶
func (s *ServiceQuotaExceededException) Code() string
Code returns the exception type name.
func (*ServiceQuotaExceededException) Error ¶
func (s *ServiceQuotaExceededException) Error() string
func (ServiceQuotaExceededException) GoString ¶
func (s ServiceQuotaExceededException) 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 (*ServiceQuotaExceededException) Message ¶
func (s *ServiceQuotaExceededException) Message() string
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 ¶
func (s ServiceQuotaExceededException) 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 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.
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
func (s *SpecificToolChoice) SetName(v string) *SpecificToolChoice
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 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) SetText ¶ added in v1.53.13
func (s *SystemContentBlock) SetText(v string) *SystemContentBlock
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
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.
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"` // The Model automatically decides if a tool should be called or to whether // to generate text instead. Auto *AutoToolChoice `locationName:"auto" type:"structure"` // The Model must request the specified tool. Tool *SpecificToolChoice `locationName:"tool" type:"structure"` // contains filtered or unexported fields }
Forces a model to use a tool.
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
func (s *ToolResultBlock) SetContent(v []*ToolResultContentBlock) *ToolResultBlock
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 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) SetImage ¶ added in v1.53.13
func (s *ToolResultContentBlock) SetImage(v *ImageBlock) *ToolResultContentBlock
SetImage sets the Image field's value.
func (*ToolResultContentBlock) SetText ¶ added in v1.53.13
func (s *ToolResultContentBlock) SetText(v string) *ToolResultContentBlock
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
func (s *ToolSpecification) SetName(v string) *ToolSpecification
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
func (s *ToolUseBlockStart) SetName(v string) *ToolUseBlockStart
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. |