types

package
v0.0.0-...-2355180 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccessDeniedException

type AccessDeniedException struct {
	Message *string

	ErrorCodeOverride *string
	// contains filtered or unexported fields
}

The request is denied because of missing access permissions.

func (*AccessDeniedException) Error

func (e *AccessDeniedException) Error() string

func (*AccessDeniedException) ErrorCode

func (e *AccessDeniedException) ErrorCode() string

func (*AccessDeniedException) ErrorFault

func (e *AccessDeniedException) ErrorFault() smithy.ErrorFault

func (*AccessDeniedException) ErrorMessage

func (e *AccessDeniedException) ErrorMessage() string

type AnyToolChoice

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

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

type AutoToolChoice

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

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

type ContentBlock

type ContentBlock interface {
	// contains filtered or unexported methods
}

A block of content for a message that you pass to, or receive from, a model with the Converseor ConverseStream API operations.

The following types satisfy this interface:

ContentBlockMemberDocument
ContentBlockMemberGuardContent
ContentBlockMemberImage
ContentBlockMemberText
ContentBlockMemberToolResult
ContentBlockMemberToolUse
Example (OutputUsage)
package main

import (
	"fmt"
	"github.com/aws/aws-sdk-go-v2/service/bedrockruntime/types"
)

func main() {
	var union types.ContentBlock
	// type switches can be used to check the union value
	switch v := union.(type) {
	case *types.ContentBlockMemberDocument:
		_ = v.Value // Value is types.DocumentBlock

	case *types.ContentBlockMemberGuardContent:
		_ = v.Value // Value is types.GuardrailConverseContentBlock

	case *types.ContentBlockMemberImage:
		_ = v.Value // Value is types.ImageBlock

	case *types.ContentBlockMemberText:
		_ = v.Value // Value is string

	case *types.ContentBlockMemberToolResult:
		_ = v.Value // Value is types.ToolResultBlock

	case *types.ContentBlockMemberToolUse:
		_ = v.Value // Value is types.ToolUseBlock

	case *types.UnknownUnionMember:
		fmt.Println("unknown tag:", v.Tag)

	default:
		fmt.Println("union is nil or unknown type")

	}
}
Output:

type ContentBlockDelta

type ContentBlockDelta interface {
	// contains filtered or unexported methods
}

A bock of content in a streaming response.

The following types satisfy this interface:

ContentBlockDeltaMemberText
ContentBlockDeltaMemberToolUse
Example (OutputUsage)
package main

import (
	"fmt"
	"github.com/aws/aws-sdk-go-v2/service/bedrockruntime/types"
)

func main() {
	var union types.ContentBlockDelta
	// type switches can be used to check the union value
	switch v := union.(type) {
	case *types.ContentBlockDeltaMemberText:
		_ = v.Value // Value is string

	case *types.ContentBlockDeltaMemberToolUse:
		_ = v.Value // Value is types.ToolUseBlockDelta

	case *types.UnknownUnionMember:
		fmt.Println("unknown tag:", v.Tag)

	default:
		fmt.Println("union is nil or unknown type")

	}
}
Output:

type ContentBlockDeltaEvent

type ContentBlockDeltaEvent struct {

	// The block index for a content block delta event.
	//
	// This member is required.
	ContentBlockIndex *int32

	// The delta for a content block delta event.
	//
	// This member is required.
	Delta ContentBlockDelta
	// contains filtered or unexported fields
}

The content block delta event.

type ContentBlockDeltaMemberText

type ContentBlockDeltaMemberText struct {
	Value string
	// contains filtered or unexported fields
}

The content text.

type ContentBlockDeltaMemberToolUse

type ContentBlockDeltaMemberToolUse struct {
	Value ToolUseBlockDelta
	// contains filtered or unexported fields
}

Information about a tool that the model is requesting to use.

type ContentBlockMemberDocument

type ContentBlockMemberDocument struct {
	Value DocumentBlock
	// contains filtered or unexported fields
}

A document to include in the message.

type ContentBlockMemberGuardContent

type ContentBlockMemberGuardContent struct {
	Value GuardrailConverseContentBlock
	// contains filtered or unexported fields
}

Contains the content to assess with the guardrail. If you don't specify guardContent in a call to the Converse API, the guardrail (if passed in the Converse API) assesses the entire message.

For more information, see Use a guardrail with the Converse API in the Amazon Bedrock User Guide.

type ContentBlockMemberImage

type ContentBlockMemberImage struct {
	Value ImageBlock
	// contains filtered or unexported fields
}

Image to include in the message.

This field is only supported by Anthropic Claude 3 models.

type ContentBlockMemberText

type ContentBlockMemberText struct {
	Value string
	// contains filtered or unexported fields
}

Text to include in the message.

type ContentBlockMemberToolResult

type ContentBlockMemberToolResult struct {
	Value ToolResultBlock
	// contains filtered or unexported fields
}

The result for a tool request that a model makes.

type ContentBlockMemberToolUse

type ContentBlockMemberToolUse struct {
	Value ToolUseBlock
	// contains filtered or unexported fields
}

Information about a tool use request from a model.

type ContentBlockStart

type ContentBlockStart interface {
	// contains filtered or unexported methods
}

Content block start information.

The following types satisfy this interface:

ContentBlockStartMemberToolUse
Example (OutputUsage)
package main

import (
	"fmt"
	"github.com/aws/aws-sdk-go-v2/service/bedrockruntime/types"
)

func main() {
	var union types.ContentBlockStart
	// type switches can be used to check the union value
	switch v := union.(type) {
	case *types.ContentBlockStartMemberToolUse:
		_ = v.Value // Value is types.ToolUseBlockStart

	case *types.UnknownUnionMember:
		fmt.Println("unknown tag:", v.Tag)

	default:
		fmt.Println("union is nil or unknown type")

	}
}
Output:

type ContentBlockStartEvent

type ContentBlockStartEvent struct {

	// The index for a content block start event.
	//
	// This member is required.
	ContentBlockIndex *int32

	// Start information about a content block start event.
	//
	// This member is required.
	Start ContentBlockStart
	// contains filtered or unexported fields
}

Content block start event.

type ContentBlockStartMemberToolUse

type ContentBlockStartMemberToolUse struct {
	Value ToolUseBlockStart
	// contains filtered or unexported fields
}

Information about a tool that the model is requesting to use.

type ContentBlockStopEvent

type ContentBlockStopEvent struct {

	// The index for a content block.
	//
	// This member is required.
	ContentBlockIndex *int32
	// contains filtered or unexported fields
}

A content block stop event.

type ConversationRole

type ConversationRole string
const (
	ConversationRoleUser      ConversationRole = "user"
	ConversationRoleAssistant ConversationRole = "assistant"
)

Enum values for ConversationRole

func (ConversationRole) Values

Values returns all known values for ConversationRole. Note that this can be expanded in the future, and so it is only as up to date as the client.

The ordering of this slice is not guaranteed to be stable across updates.

type ConverseMetrics

type ConverseMetrics struct {

	// The latency of the call to Converse , in milliseconds.
	//
	// This member is required.
	LatencyMs *int64
	// contains filtered or unexported fields
}

Metrics for a call to Converse.

type ConverseOutput

type ConverseOutput interface {
	// contains filtered or unexported methods
}

The output from a call to Converse.

The following types satisfy this interface:

ConverseOutputMemberMessage
Example (OutputUsage)
package main

import (
	"fmt"
	"github.com/aws/aws-sdk-go-v2/service/bedrockruntime/types"
)

func main() {
	var union types.ConverseOutput
	// type switches can be used to check the union value
	switch v := union.(type) {
	case *types.ConverseOutputMemberMessage:
		_ = v.Value // Value is types.Message

	case *types.UnknownUnionMember:
		fmt.Println("unknown tag:", v.Tag)

	default:
		fmt.Println("union is nil or unknown type")

	}
}
Output:

type ConverseOutputMemberMessage

type ConverseOutputMemberMessage struct {
	Value Message
	// contains filtered or unexported fields
}

The message that the model generates.

type ConverseStreamMetadataEvent

type ConverseStreamMetadataEvent struct {

	// The metrics for the conversation stream metadata event.
	//
	// This member is required.
	Metrics *ConverseStreamMetrics

	// Usage information for the conversation stream event.
	//
	// This member is required.
	Usage *TokenUsage

	// The trace object in the response from [ConverseStream] that contains information about the
	// guardrail behavior.
	//
	// [ConverseStream]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_ConverseStream.html
	Trace *ConverseStreamTrace
	// contains filtered or unexported fields
}

A conversation stream metadata event.

type ConverseStreamMetrics

type ConverseStreamMetrics struct {

	// The latency for the streaming request, in milliseconds.
	//
	// This member is required.
	LatencyMs *int64
	// contains filtered or unexported fields
}

Metrics for the stream.

type ConverseStreamOutput

type ConverseStreamOutput interface {
	// contains filtered or unexported methods
}

The messages output stream

The following types satisfy this interface:

ConverseStreamOutputMemberContentBlockDelta
ConverseStreamOutputMemberContentBlockStart
ConverseStreamOutputMemberContentBlockStop
ConverseStreamOutputMemberMessageStart
ConverseStreamOutputMemberMessageStop
ConverseStreamOutputMemberMetadata
Example (OutputUsage)
package main

import (
	"fmt"
	"github.com/aws/aws-sdk-go-v2/service/bedrockruntime/types"
)

func main() {
	var union types.ConverseStreamOutput
	// type switches can be used to check the union value
	switch v := union.(type) {
	case *types.ConverseStreamOutputMemberContentBlockDelta:
		_ = v.Value // Value is types.ContentBlockDeltaEvent

	case *types.ConverseStreamOutputMemberContentBlockStart:
		_ = v.Value // Value is types.ContentBlockStartEvent

	case *types.ConverseStreamOutputMemberContentBlockStop:
		_ = v.Value // Value is types.ContentBlockStopEvent

	case *types.ConverseStreamOutputMemberMessageStart:
		_ = v.Value // Value is types.MessageStartEvent

	case *types.ConverseStreamOutputMemberMessageStop:
		_ = v.Value // Value is types.MessageStopEvent

	case *types.ConverseStreamOutputMemberMetadata:
		_ = v.Value // Value is types.ConverseStreamMetadataEvent

	case *types.UnknownUnionMember:
		fmt.Println("unknown tag:", v.Tag)

	default:
		fmt.Println("union is nil or unknown type")

	}
}
Output:

type ConverseStreamOutputMemberContentBlockDelta

type ConverseStreamOutputMemberContentBlockDelta struct {
	Value ContentBlockDeltaEvent
	// contains filtered or unexported fields
}

The messages output content block delta.

type ConverseStreamOutputMemberContentBlockStart

type ConverseStreamOutputMemberContentBlockStart struct {
	Value ContentBlockStartEvent
	// contains filtered or unexported fields
}

Start information for a content block.

type ConverseStreamOutputMemberContentBlockStop

type ConverseStreamOutputMemberContentBlockStop struct {
	Value ContentBlockStopEvent
	// contains filtered or unexported fields
}

Stop information for a content block.

type ConverseStreamOutputMemberMessageStart

type ConverseStreamOutputMemberMessageStart struct {
	Value MessageStartEvent
	// contains filtered or unexported fields
}

Message start information.

type ConverseStreamOutputMemberMessageStop

type ConverseStreamOutputMemberMessageStop struct {
	Value MessageStopEvent
	// contains filtered or unexported fields
}

Message stop information.

type ConverseStreamOutputMemberMetadata

type ConverseStreamOutputMemberMetadata struct {
	Value ConverseStreamMetadataEvent
	// contains filtered or unexported fields
}

Metadata for the converse output stream.

type ConverseStreamTrace

type ConverseStreamTrace struct {

	// The guardrail trace object.
	Guardrail *GuardrailTraceAssessment
	// contains filtered or unexported fields
}

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

type ConverseTrace

type ConverseTrace struct {

	// The guardrail trace object.
	Guardrail *GuardrailTraceAssessment
	// contains filtered or unexported fields
}

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

type DocumentBlock

type DocumentBlock struct {

	// The format of a document, or its extension.
	//
	// This member is required.
	Format DocumentFormat

	// A name for the document. The name can only contain the following characters:
	//
	//   - Alphanumeric characters
	//
	//   - Whitespace characters (no more than one in a row)
	//
	//   - Hyphens
	//
	//   - Parentheses
	//
	//   - Square brackets
	//
	// This field is vulnerable to prompt injections, because the model might
	// inadvertently interpret it as instructions. Therefore, we recommend that you
	// specify a neutral name.
	//
	// This member is required.
	Name *string

	// Contains the content of the document.
	//
	// This member is required.
	Source DocumentSource
	// contains filtered or unexported fields
}

A document to include in a message.

type DocumentFormat

type DocumentFormat string
const (
	DocumentFormatPdf  DocumentFormat = "pdf"
	DocumentFormatCsv  DocumentFormat = "csv"
	DocumentFormatDoc  DocumentFormat = "doc"
	DocumentFormatDocx DocumentFormat = "docx"
	DocumentFormatXls  DocumentFormat = "xls"
	DocumentFormatXlsx DocumentFormat = "xlsx"
	DocumentFormatHtml DocumentFormat = "html"
	DocumentFormatTxt  DocumentFormat = "txt"
	DocumentFormatMd   DocumentFormat = "md"
)

Enum values for DocumentFormat

func (DocumentFormat) Values

func (DocumentFormat) Values() []DocumentFormat

Values returns all known values for DocumentFormat. Note that this can be expanded in the future, and so it is only as up to date as the client.

The ordering of this slice is not guaranteed to be stable across updates.

type DocumentSource

type DocumentSource interface {
	// contains filtered or unexported methods
}

Contains the content of a document.

The following types satisfy this interface:

DocumentSourceMemberBytes
Example (OutputUsage)
package main

import (
	"fmt"
	"github.com/aws/aws-sdk-go-v2/service/bedrockruntime/types"
)

func main() {
	var union types.DocumentSource
	// type switches can be used to check the union value
	switch v := union.(type) {
	case *types.DocumentSourceMemberBytes:
		_ = v.Value // Value is []byte

	case *types.UnknownUnionMember:
		fmt.Println("unknown tag:", v.Tag)

	default:
		fmt.Println("union is nil or unknown type")

	}
}
Output:

type DocumentSourceMemberBytes

type DocumentSourceMemberBytes struct {
	Value []byte
	// contains filtered or unexported fields
}

The raw bytes for the document. If you use an Amazon Web Services SDK, you don't need to encode the bytes in base64.

type GuardrailAction

type GuardrailAction string
const (
	GuardrailActionNone                GuardrailAction = "NONE"
	GuardrailActionGuardrailIntervened GuardrailAction = "GUARDRAIL_INTERVENED"
)

Enum values for GuardrailAction

func (GuardrailAction) Values

func (GuardrailAction) Values() []GuardrailAction

Values returns all known values for GuardrailAction. Note that this can be expanded in the future, and so it is only as up to date as the client.

The ordering of this slice is not guaranteed to be stable across updates.

type GuardrailAssessment

type GuardrailAssessment struct {

	// The content policy.
	ContentPolicy *GuardrailContentPolicyAssessment

	// The contextual grounding policy used for the guardrail assessment.
	ContextualGroundingPolicy *GuardrailContextualGroundingPolicyAssessment

	// The sensitive information policy.
	SensitiveInformationPolicy *GuardrailSensitiveInformationPolicyAssessment

	// The topic policy.
	TopicPolicy *GuardrailTopicPolicyAssessment

	// The word policy.
	WordPolicy *GuardrailWordPolicyAssessment
	// contains filtered or unexported fields
}

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

type GuardrailConfiguration

type GuardrailConfiguration struct {

	// The identifier for the guardrail.
	//
	// This member is required.
	GuardrailIdentifier *string

	// The version of the guardrail.
	//
	// This member is required.
	GuardrailVersion *string

	// The trace behavior for the guardrail.
	Trace GuardrailTrace
	// contains filtered or unexported fields
}

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

type GuardrailContentBlock

type GuardrailContentBlock interface {
	// contains filtered or unexported methods
}

The content block to be evaluated by the guardrail.

The following types satisfy this interface:

GuardrailContentBlockMemberText
Example (OutputUsage)
package main

import (
	"fmt"
	"github.com/aws/aws-sdk-go-v2/service/bedrockruntime/types"
)

func main() {
	var union types.GuardrailContentBlock
	// type switches can be used to check the union value
	switch v := union.(type) {
	case *types.GuardrailContentBlockMemberText:
		_ = v.Value // Value is types.GuardrailTextBlock

	case *types.UnknownUnionMember:
		fmt.Println("unknown tag:", v.Tag)

	default:
		fmt.Println("union is nil or unknown type")

	}
}
Output:

type GuardrailContentBlockMemberText

type GuardrailContentBlockMemberText struct {
	Value GuardrailTextBlock
	// contains filtered or unexported fields
}

Text within content block to be evaluated by the guardrail.

type GuardrailContentFilter

type GuardrailContentFilter struct {

	// The guardrail action.
	//
	// This member is required.
	Action GuardrailContentPolicyAction

	// The guardrail confidence.
	//
	// This member is required.
	Confidence GuardrailContentFilterConfidence

	// The guardrail type.
	//
	// This member is required.
	Type GuardrailContentFilterType
	// contains filtered or unexported fields
}

The content filter for a guardrail.

type GuardrailContentFilterConfidence

type GuardrailContentFilterConfidence string
const (
	GuardrailContentFilterConfidenceNone   GuardrailContentFilterConfidence = "NONE"
	GuardrailContentFilterConfidenceLow    GuardrailContentFilterConfidence = "LOW"
	GuardrailContentFilterConfidenceMedium GuardrailContentFilterConfidence = "MEDIUM"
	GuardrailContentFilterConfidenceHigh   GuardrailContentFilterConfidence = "HIGH"
)

Enum values for GuardrailContentFilterConfidence

func (GuardrailContentFilterConfidence) Values

Values returns all known values for GuardrailContentFilterConfidence. Note that this can be expanded in the future, and so it is only as up to date as the client.

The ordering of this slice is not guaranteed to be stable across updates.

type GuardrailContentFilterType

type GuardrailContentFilterType string
const (
	GuardrailContentFilterTypeInsults      GuardrailContentFilterType = "INSULTS"
	GuardrailContentFilterTypeHate         GuardrailContentFilterType = "HATE"
	GuardrailContentFilterTypeSexual       GuardrailContentFilterType = "SEXUAL"
	GuardrailContentFilterTypeViolence     GuardrailContentFilterType = "VIOLENCE"
	GuardrailContentFilterTypeMisconduct   GuardrailContentFilterType = "MISCONDUCT"
	GuardrailContentFilterTypePromptAttack GuardrailContentFilterType = "PROMPT_ATTACK"
)

Enum values for GuardrailContentFilterType

func (GuardrailContentFilterType) Values

Values returns all known values for GuardrailContentFilterType. Note that this can be expanded in the future, and so it is only as up to date as the client.

The ordering of this slice is not guaranteed to be stable across updates.

type GuardrailContentPolicyAction

type GuardrailContentPolicyAction string
const (
	GuardrailContentPolicyActionBlocked GuardrailContentPolicyAction = "BLOCKED"
)

Enum values for GuardrailContentPolicyAction

func (GuardrailContentPolicyAction) Values

Values returns all known values for GuardrailContentPolicyAction. Note that this can be expanded in the future, and so it is only as up to date as the client.

The ordering of this slice is not guaranteed to be stable across updates.

type GuardrailContentPolicyAssessment

type GuardrailContentPolicyAssessment struct {

	// The content policy filters.
	//
	// This member is required.
	Filters []GuardrailContentFilter
	// contains filtered or unexported fields
}

An assessment of a content policy for a guardrail.

type GuardrailContentQualifier

type GuardrailContentQualifier string
const (
	GuardrailContentQualifierGroundingSource GuardrailContentQualifier = "grounding_source"
	GuardrailContentQualifierQuery           GuardrailContentQualifier = "query"
	GuardrailContentQualifierGuardContent    GuardrailContentQualifier = "guard_content"
)

Enum values for GuardrailContentQualifier

func (GuardrailContentQualifier) Values

Values returns all known values for GuardrailContentQualifier. Note that this can be expanded in the future, and so it is only as up to date as the client.

The ordering of this slice is not guaranteed to be stable across updates.

type GuardrailContentSource

type GuardrailContentSource string
const (
	GuardrailContentSourceInput  GuardrailContentSource = "INPUT"
	GuardrailContentSourceOutput GuardrailContentSource = "OUTPUT"
)

Enum values for GuardrailContentSource

func (GuardrailContentSource) Values

Values returns all known values for GuardrailContentSource. Note that this can be expanded in the future, and so it is only as up to date as the client.

The ordering of this slice is not guaranteed to be stable across updates.

type GuardrailContextualGroundingFilter

type GuardrailContextualGroundingFilter struct {

	// The action performed by the guardrails contextual grounding filter.
	//
	// This member is required.
	Action GuardrailContextualGroundingPolicyAction

	// The score generated by contextual grounding filter.
	//
	// This member is required.
	Score *float64

	// The threshold used by contextual grounding filter to determine whether the
	// content is grounded or not.
	//
	// This member is required.
	Threshold *float64

	// The contextual grounding filter type.
	//
	// This member is required.
	Type GuardrailContextualGroundingFilterType
	// contains filtered or unexported fields
}

The details for the guardrails contextual grounding filter.

type GuardrailContextualGroundingFilterType

type GuardrailContextualGroundingFilterType string
const (
	GuardrailContextualGroundingFilterTypeGrounding GuardrailContextualGroundingFilterType = "GROUNDING"
	GuardrailContextualGroundingFilterTypeRelevance GuardrailContextualGroundingFilterType = "RELEVANCE"
)

Enum values for GuardrailContextualGroundingFilterType

func (GuardrailContextualGroundingFilterType) Values

Values returns all known values for GuardrailContextualGroundingFilterType. Note that this can be expanded in the future, and so it is only as up to date as the client.

The ordering of this slice is not guaranteed to be stable across updates.

type GuardrailContextualGroundingPolicyAction

type GuardrailContextualGroundingPolicyAction string
const (
	GuardrailContextualGroundingPolicyActionBlocked GuardrailContextualGroundingPolicyAction = "BLOCKED"
	GuardrailContextualGroundingPolicyActionNone    GuardrailContextualGroundingPolicyAction = "NONE"
)

Enum values for GuardrailContextualGroundingPolicyAction

func (GuardrailContextualGroundingPolicyAction) Values

Values returns all known values for GuardrailContextualGroundingPolicyAction. Note that this can be expanded in the future, and so it is only as up to date as the client.

The ordering of this slice is not guaranteed to be stable across updates.

type GuardrailContextualGroundingPolicyAssessment

type GuardrailContextualGroundingPolicyAssessment struct {

	// The filter details for the guardrails contextual grounding filter.
	Filters []GuardrailContextualGroundingFilter
	// contains filtered or unexported fields
}

The policy assessment details for the guardrails contextual grounding filter.

type GuardrailConverseContentBlock

type GuardrailConverseContentBlock interface {
	// contains filtered or unexported methods
}

A content block for selective guarding with the Converse or ConverseStream API operations.

The following types satisfy this interface:

GuardrailConverseContentBlockMemberText
Example (OutputUsage)
package main

import (
	"fmt"
	"github.com/aws/aws-sdk-go-v2/service/bedrockruntime/types"
)

func main() {
	var union types.GuardrailConverseContentBlock
	// type switches can be used to check the union value
	switch v := union.(type) {
	case *types.GuardrailConverseContentBlockMemberText:
		_ = v.Value // Value is types.GuardrailConverseTextBlock

	case *types.UnknownUnionMember:
		fmt.Println("unknown tag:", v.Tag)

	default:
		fmt.Println("union is nil or unknown type")

	}
}
Output:

type GuardrailConverseContentBlockMemberText

type GuardrailConverseContentBlockMemberText struct {
	Value GuardrailConverseTextBlock
	// contains filtered or unexported fields
}

The text to guard.

type GuardrailConverseContentQualifier

type GuardrailConverseContentQualifier string
const (
	GuardrailConverseContentQualifierGroundingSource GuardrailConverseContentQualifier = "grounding_source"
	GuardrailConverseContentQualifierQuery           GuardrailConverseContentQualifier = "query"
	GuardrailConverseContentQualifierGuardContent    GuardrailConverseContentQualifier = "guard_content"
)

Enum values for GuardrailConverseContentQualifier

func (GuardrailConverseContentQualifier) Values

Values returns all known values for GuardrailConverseContentQualifier. Note that this can be expanded in the future, and so it is only as up to date as the client.

The ordering of this slice is not guaranteed to be stable across updates.

type GuardrailConverseTextBlock

type GuardrailConverseTextBlock struct {

	// The text that you want to guard.
	//
	// This member is required.
	Text *string

	// The qualifier details for the guardrails contextual grounding filter.
	Qualifiers []GuardrailConverseContentQualifier
	// contains filtered or unexported fields
}

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

type GuardrailCustomWord

type GuardrailCustomWord struct {

	// The action for the custom word.
	//
	// This member is required.
	Action GuardrailWordPolicyAction

	// The match for the custom word.
	//
	// This member is required.
	Match *string
	// contains filtered or unexported fields
}

A custom word configured in a guardrail.

type GuardrailManagedWord

type GuardrailManagedWord struct {

	// The action for the managed word.
	//
	// This member is required.
	Action GuardrailWordPolicyAction

	// The match for the managed word.
	//
	// This member is required.
	Match *string

	// The type for the managed word.
	//
	// This member is required.
	Type GuardrailManagedWordType
	// contains filtered or unexported fields
}

A managed word configured in a guardrail.

type GuardrailManagedWordType

type GuardrailManagedWordType string
const (
	GuardrailManagedWordTypeProfanity GuardrailManagedWordType = "PROFANITY"
)

Enum values for GuardrailManagedWordType

func (GuardrailManagedWordType) Values

Values returns all known values for GuardrailManagedWordType. Note that this can be expanded in the future, and so it is only as up to date as the client.

The ordering of this slice is not guaranteed to be stable across updates.

type GuardrailOutputContent

type GuardrailOutputContent struct {

	// The specific text for the output content produced by the guardrail.
	Text *string
	// contains filtered or unexported fields
}

The output content produced by the guardrail.

type GuardrailPiiEntityFilter

type GuardrailPiiEntityFilter struct {

	// The PII entity filter action.
	//
	// This member is required.
	Action GuardrailSensitiveInformationPolicyAction

	// The PII entity filter match.
	//
	// This member is required.
	Match *string

	// The PII entity filter type.
	//
	// This member is required.
	Type GuardrailPiiEntityType
	// contains filtered or unexported fields
}

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

type GuardrailPiiEntityType

type GuardrailPiiEntityType string
const (
	GuardrailPiiEntityTypeAddress                             GuardrailPiiEntityType = "ADDRESS"
	GuardrailPiiEntityTypeAge                                 GuardrailPiiEntityType = "AGE"
	GuardrailPiiEntityTypeAwsAccessKey                        GuardrailPiiEntityType = "AWS_ACCESS_KEY"
	GuardrailPiiEntityTypeAwsSecretKey                        GuardrailPiiEntityType = "AWS_SECRET_KEY"
	GuardrailPiiEntityTypeCaHealthNumber                      GuardrailPiiEntityType = "CA_HEALTH_NUMBER"
	GuardrailPiiEntityTypeCaSocialInsuranceNumber             GuardrailPiiEntityType = "CA_SOCIAL_INSURANCE_NUMBER"
	GuardrailPiiEntityTypeCreditDebitCardCvv                  GuardrailPiiEntityType = "CREDIT_DEBIT_CARD_CVV"
	GuardrailPiiEntityTypeCreditDebitCardExpiry               GuardrailPiiEntityType = "CREDIT_DEBIT_CARD_EXPIRY"
	GuardrailPiiEntityTypeCreditDebitCardNumber               GuardrailPiiEntityType = "CREDIT_DEBIT_CARD_NUMBER"
	GuardrailPiiEntityTypeDriverId                            GuardrailPiiEntityType = "DRIVER_ID"
	GuardrailPiiEntityTypeEmail                               GuardrailPiiEntityType = "EMAIL"
	GuardrailPiiEntityTypeInternationalBankAccountNumber      GuardrailPiiEntityType = "INTERNATIONAL_BANK_ACCOUNT_NUMBER"
	GuardrailPiiEntityTypeIpAddress                           GuardrailPiiEntityType = "IP_ADDRESS"
	GuardrailPiiEntityTypeLicensePlate                        GuardrailPiiEntityType = "LICENSE_PLATE"
	GuardrailPiiEntityTypeMacAddress                          GuardrailPiiEntityType = "MAC_ADDRESS"
	GuardrailPiiEntityTypeName                                GuardrailPiiEntityType = "NAME"
	GuardrailPiiEntityTypePassword                            GuardrailPiiEntityType = "PASSWORD"
	GuardrailPiiEntityTypePhone                               GuardrailPiiEntityType = "PHONE"
	GuardrailPiiEntityTypePin                                 GuardrailPiiEntityType = "PIN"
	GuardrailPiiEntityTypeSwiftCode                           GuardrailPiiEntityType = "SWIFT_CODE"
	GuardrailPiiEntityTypeUkNationalHealthServiceNumber       GuardrailPiiEntityType = "UK_NATIONAL_HEALTH_SERVICE_NUMBER"
	GuardrailPiiEntityTypeUkNationalInsuranceNumber           GuardrailPiiEntityType = "UK_NATIONAL_INSURANCE_NUMBER"
	GuardrailPiiEntityTypeUkUniqueTaxpayerReferenceNumber     GuardrailPiiEntityType = "UK_UNIQUE_TAXPAYER_REFERENCE_NUMBER"
	GuardrailPiiEntityTypeUrl                                 GuardrailPiiEntityType = "URL"
	GuardrailPiiEntityTypeUsername                            GuardrailPiiEntityType = "USERNAME"
	GuardrailPiiEntityTypeUsBankAccountNumber                 GuardrailPiiEntityType = "US_BANK_ACCOUNT_NUMBER"
	GuardrailPiiEntityTypeUsBankRoutingNumber                 GuardrailPiiEntityType = "US_BANK_ROUTING_NUMBER"
	GuardrailPiiEntityTypeUsIndividualTaxIdentificationNumber GuardrailPiiEntityType = "US_INDIVIDUAL_TAX_IDENTIFICATION_NUMBER"
	GuardrailPiiEntityTypeUsPassportNumber                    GuardrailPiiEntityType = "US_PASSPORT_NUMBER"
	GuardrailPiiEntityTypeUsSocialSecurityNumber              GuardrailPiiEntityType = "US_SOCIAL_SECURITY_NUMBER"
	GuardrailPiiEntityTypeVehicleIdentificationNumber         GuardrailPiiEntityType = "VEHICLE_IDENTIFICATION_NUMBER"
)

Enum values for GuardrailPiiEntityType

func (GuardrailPiiEntityType) Values

Values returns all known values for GuardrailPiiEntityType. Note that this can be expanded in the future, and so it is only as up to date as the client.

The ordering of this slice is not guaranteed to be stable across updates.

type GuardrailRegexFilter

type GuardrailRegexFilter struct {

	// The region filter action.
	//
	// This member is required.
	Action GuardrailSensitiveInformationPolicyAction

	// The regesx filter match.
	Match *string

	// The regex filter name.
	Name *string

	// The regex query.
	Regex *string
	// contains filtered or unexported fields
}

A Regex filter configured in a guardrail.

type GuardrailSensitiveInformationPolicyAction

type GuardrailSensitiveInformationPolicyAction string
const (
	GuardrailSensitiveInformationPolicyActionAnonymized GuardrailSensitiveInformationPolicyAction = "ANONYMIZED"
	GuardrailSensitiveInformationPolicyActionBlocked    GuardrailSensitiveInformationPolicyAction = "BLOCKED"
)

Enum values for GuardrailSensitiveInformationPolicyAction

func (GuardrailSensitiveInformationPolicyAction) Values

Values returns all known values for GuardrailSensitiveInformationPolicyAction. Note that this can be expanded in the future, and so it is only as up to date as the client.

The ordering of this slice is not guaranteed to be stable across updates.

type GuardrailSensitiveInformationPolicyAssessment

type GuardrailSensitiveInformationPolicyAssessment struct {

	// The PII entities in the assessment.
	//
	// This member is required.
	PiiEntities []GuardrailPiiEntityFilter

	// The regex queries in the assessment.
	//
	// This member is required.
	Regexes []GuardrailRegexFilter
	// contains filtered or unexported fields
}

The assessment for aPersonally Identifiable Information (PII) policy.

type GuardrailStreamConfiguration

type GuardrailStreamConfiguration struct {

	// The identifier for the guardrail.
	//
	// This member is required.
	GuardrailIdentifier *string

	// The version of the guardrail.
	//
	// This member is required.
	GuardrailVersion *string

	// The processing mode.
	//
	// The processing mode. For more information, see Configure streaming response
	// behavior in the Amazon Bedrock User Guide.
	StreamProcessingMode GuardrailStreamProcessingMode

	// The trace behavior for the guardrail.
	Trace GuardrailTrace
	// contains filtered or unexported fields
}

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

type GuardrailStreamProcessingMode

type GuardrailStreamProcessingMode string
const (
	GuardrailStreamProcessingModeSync  GuardrailStreamProcessingMode = "sync"
	GuardrailStreamProcessingModeAsync GuardrailStreamProcessingMode = "async"
)

Enum values for GuardrailStreamProcessingMode

func (GuardrailStreamProcessingMode) Values

Values returns all known values for GuardrailStreamProcessingMode. Note that this can be expanded in the future, and so it is only as up to date as the client.

The ordering of this slice is not guaranteed to be stable across updates.

type GuardrailTextBlock

type GuardrailTextBlock struct {

	// The input text details to be evaluated by the guardrail.
	//
	// This member is required.
	Text *string

	// The qualifiers describing the text block.
	Qualifiers []GuardrailContentQualifier
	// contains filtered or unexported fields
}

The text block to be evaluated by the guardrail.

type GuardrailTopic

type GuardrailTopic struct {

	// The action the guardrail should take when it intervenes on a topic.
	//
	// This member is required.
	Action GuardrailTopicPolicyAction

	// The name for the guardrail.
	//
	// This member is required.
	Name *string

	// The type behavior that the guardrail should perform when the model detects the
	// topic.
	//
	// This member is required.
	Type GuardrailTopicType
	// contains filtered or unexported fields
}

Information about a topic guardrail.

type GuardrailTopicPolicyAction

type GuardrailTopicPolicyAction string
const (
	GuardrailTopicPolicyActionBlocked GuardrailTopicPolicyAction = "BLOCKED"
)

Enum values for GuardrailTopicPolicyAction

func (GuardrailTopicPolicyAction) Values

Values returns all known values for GuardrailTopicPolicyAction. Note that this can be expanded in the future, and so it is only as up to date as the client.

The ordering of this slice is not guaranteed to be stable across updates.

type GuardrailTopicPolicyAssessment

type GuardrailTopicPolicyAssessment struct {

	// The topics in the assessment.
	//
	// This member is required.
	Topics []GuardrailTopic
	// contains filtered or unexported fields
}

A behavior assessment of a topic policy.

type GuardrailTopicType

type GuardrailTopicType string
const (
	GuardrailTopicTypeDeny GuardrailTopicType = "DENY"
)

Enum values for GuardrailTopicType

func (GuardrailTopicType) Values

Values returns all known values for GuardrailTopicType. Note that this can be expanded in the future, and so it is only as up to date as the client.

The ordering of this slice is not guaranteed to be stable across updates.

type GuardrailTrace

type GuardrailTrace string
const (
	GuardrailTraceEnabled  GuardrailTrace = "enabled"
	GuardrailTraceDisabled GuardrailTrace = "disabled"
)

Enum values for GuardrailTrace

func (GuardrailTrace) Values

func (GuardrailTrace) Values() []GuardrailTrace

Values returns all known values for GuardrailTrace. Note that this can be expanded in the future, and so it is only as up to date as the client.

The ordering of this slice is not guaranteed to be stable across updates.

type GuardrailTraceAssessment

type GuardrailTraceAssessment struct {

	// The input assessment.
	InputAssessment map[string]GuardrailAssessment

	// The output from the model.
	ModelOutput []string

	// the output assessments.
	OutputAssessments map[string][]GuardrailAssessment
	// contains filtered or unexported fields
}

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

type GuardrailUsage

type GuardrailUsage struct {

	// The content policy units processed by the guardrail.
	//
	// This member is required.
	ContentPolicyUnits *int32

	// The contextual grounding policy units processed by the guardrail.
	//
	// This member is required.
	ContextualGroundingPolicyUnits *int32

	// The sensitive information policy free units processed by the guardrail.
	//
	// This member is required.
	SensitiveInformationPolicyFreeUnits *int32

	// The sensitive information policy units processed by the guardrail.
	//
	// This member is required.
	SensitiveInformationPolicyUnits *int32

	// The topic policy units processed by the guardrail.
	//
	// This member is required.
	TopicPolicyUnits *int32

	// The word policy units processed by the guardrail.
	//
	// This member is required.
	WordPolicyUnits *int32
	// contains filtered or unexported fields
}

The details on the use of the guardrail.

type GuardrailWordPolicyAction

type GuardrailWordPolicyAction string
const (
	GuardrailWordPolicyActionBlocked GuardrailWordPolicyAction = "BLOCKED"
)

Enum values for GuardrailWordPolicyAction

func (GuardrailWordPolicyAction) Values

Values returns all known values for GuardrailWordPolicyAction. Note that this can be expanded in the future, and so it is only as up to date as the client.

The ordering of this slice is not guaranteed to be stable across updates.

type GuardrailWordPolicyAssessment

type GuardrailWordPolicyAssessment struct {

	// Custom words in the assessment.
	//
	// This member is required.
	CustomWords []GuardrailCustomWord

	// Managed word lists in the assessment.
	//
	// This member is required.
	ManagedWordLists []GuardrailManagedWord
	// contains filtered or unexported fields
}

The word policy assessment.

type ImageBlock

type ImageBlock struct {

	// The format of the image.
	//
	// This member is required.
	Format ImageFormat

	// The source for the image.
	//
	// This member is required.
	Source ImageSource
	// contains filtered or unexported fields
}

Image content for a message.

type ImageFormat

type ImageFormat string
const (
	ImageFormatPng  ImageFormat = "png"
	ImageFormatJpeg ImageFormat = "jpeg"
	ImageFormatGif  ImageFormat = "gif"
	ImageFormatWebp ImageFormat = "webp"
)

Enum values for ImageFormat

func (ImageFormat) Values

func (ImageFormat) Values() []ImageFormat

Values returns all known values for ImageFormat. Note that this can be expanded in the future, and so it is only as up to date as the client.

The ordering of this slice is not guaranteed to be stable across updates.

type ImageSource

type ImageSource interface {
	// contains filtered or unexported methods
}

The source for an image.

The following types satisfy this interface:

ImageSourceMemberBytes
Example (OutputUsage)
package main

import (
	"fmt"
	"github.com/aws/aws-sdk-go-v2/service/bedrockruntime/types"
)

func main() {
	var union types.ImageSource
	// type switches can be used to check the union value
	switch v := union.(type) {
	case *types.ImageSourceMemberBytes:
		_ = v.Value // Value is []byte

	case *types.UnknownUnionMember:
		fmt.Println("unknown tag:", v.Tag)

	default:
		fmt.Println("union is nil or unknown type")

	}
}
Output:

type ImageSourceMemberBytes

type ImageSourceMemberBytes struct {
	Value []byte
	// contains filtered or unexported fields
}

The raw image bytes for the image. If you use an AWS SDK, you don't need to encode the image bytes in base64.

type InferenceConfiguration

type InferenceConfiguration struct {

	// The maximum number of tokens to allow in the generated response. The default
	// value is the maximum allowed value for the model that you are using. For more
	// information, see [Inference parameters for foundation models].
	//
	// [Inference parameters for foundation models]: https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html
	MaxTokens *int32

	// A list of stop sequences. A stop sequence is a sequence of characters that
	// causes the model to stop generating the response.
	StopSequences []string

	// 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].
	//
	// [Inference parameters for foundation models]: https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html
	Temperature *float32

	// 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].
	//
	// [Inference parameters for foundation models]: https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html
	TopP *float32
	// contains filtered or unexported fields
}

Base inference parameters to pass to a model in a call to Converse or ConverseStream. For more information, see Inference parameters for foundation models.

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.

type InternalServerException

type InternalServerException struct {
	Message *string

	ErrorCodeOverride *string
	// contains filtered or unexported fields
}

An internal server error occurred. Retry your request.

func (*InternalServerException) Error

func (e *InternalServerException) Error() string

func (*InternalServerException) ErrorCode

func (e *InternalServerException) ErrorCode() string

func (*InternalServerException) ErrorFault

func (e *InternalServerException) ErrorFault() smithy.ErrorFault

func (*InternalServerException) ErrorMessage

func (e *InternalServerException) ErrorMessage() string

type Message

type Message struct {

	// The message content. Note the following restrictions:
	//
	//   - You can include up to 20 images. Each image's size, height, and width must
	//   be no more than 3.75 MB, 8000 px, and 8000 px, respectively.
	//
	//   - You can include up to five documents. Each document's size must be no more
	//   than 4.5 MB.
	//
	//   - If you include a ContentBlock with a document field in the array, you must
	//   also include a ContentBlock with a text field.
	//
	//   - You can only include images and documents if the role is user .
	//
	// This member is required.
	Content []ContentBlock

	// The role that the message plays in the message.
	//
	// This member is required.
	Role ConversationRole
	// contains filtered or unexported fields
}

A message input, or returned from, a call to Converse or ConverseStream.

type MessageStartEvent

type MessageStartEvent struct {

	// The role for the message.
	//
	// This member is required.
	Role ConversationRole
	// contains filtered or unexported fields
}

The start of a message.

type MessageStopEvent

type MessageStopEvent struct {

	// The reason why the model stopped generating output.
	//
	// This member is required.
	StopReason StopReason

	// The additional model response fields.
	AdditionalModelResponseFields document.Interface
	// contains filtered or unexported fields
}

The stop event for a message.

type ModelErrorException

type ModelErrorException struct {
	Message *string

	ErrorCodeOverride *string

	OriginalStatusCode *int32
	ResourceName       *string
	// contains filtered or unexported fields
}

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

func (*ModelErrorException) Error

func (e *ModelErrorException) Error() string

func (*ModelErrorException) ErrorCode

func (e *ModelErrorException) ErrorCode() string

func (*ModelErrorException) ErrorFault

func (e *ModelErrorException) ErrorFault() smithy.ErrorFault

func (*ModelErrorException) ErrorMessage

func (e *ModelErrorException) ErrorMessage() string

type ModelNotReadyException

type ModelNotReadyException struct {
	Message *string

	ErrorCodeOverride *string
	// contains filtered or unexported fields
}

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

func (*ModelNotReadyException) Error

func (e *ModelNotReadyException) Error() string

func (*ModelNotReadyException) ErrorCode

func (e *ModelNotReadyException) ErrorCode() string

func (*ModelNotReadyException) ErrorFault

func (e *ModelNotReadyException) ErrorFault() smithy.ErrorFault

func (*ModelNotReadyException) ErrorMessage

func (e *ModelNotReadyException) ErrorMessage() string

type ModelStreamErrorException

type ModelStreamErrorException struct {
	Message *string

	ErrorCodeOverride *string

	OriginalStatusCode *int32
	OriginalMessage    *string
	// contains filtered or unexported fields
}

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

func (*ModelStreamErrorException) Error

func (e *ModelStreamErrorException) Error() string

func (*ModelStreamErrorException) ErrorCode

func (e *ModelStreamErrorException) ErrorCode() string

func (*ModelStreamErrorException) ErrorFault

func (*ModelStreamErrorException) ErrorMessage

func (e *ModelStreamErrorException) ErrorMessage() string

type ModelTimeoutException

type ModelTimeoutException struct {
	Message *string

	ErrorCodeOverride *string
	// contains filtered or unexported fields
}

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

func (*ModelTimeoutException) Error

func (e *ModelTimeoutException) Error() string

func (*ModelTimeoutException) ErrorCode

func (e *ModelTimeoutException) ErrorCode() string

func (*ModelTimeoutException) ErrorFault

func (e *ModelTimeoutException) ErrorFault() smithy.ErrorFault

func (*ModelTimeoutException) ErrorMessage

func (e *ModelTimeoutException) ErrorMessage() string

type PayloadPart

type PayloadPart struct {

	// Base64-encoded bytes of payload data.
	Bytes []byte
	// contains filtered or unexported fields
}

Payload content included in the response.

type ResourceNotFoundException

type ResourceNotFoundException struct {
	Message *string

	ErrorCodeOverride *string
	// contains filtered or unexported fields
}

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

func (*ResourceNotFoundException) Error

func (e *ResourceNotFoundException) Error() string

func (*ResourceNotFoundException) ErrorCode

func (e *ResourceNotFoundException) ErrorCode() string

func (*ResourceNotFoundException) ErrorFault

func (*ResourceNotFoundException) ErrorMessage

func (e *ResourceNotFoundException) ErrorMessage() string

type ResponseStream

type ResponseStream interface {
	// contains filtered or unexported methods
}

Definition of content in the response stream.

The following types satisfy this interface:

ResponseStreamMemberChunk
Example (OutputUsage)
package main

import (
	"fmt"
	"github.com/aws/aws-sdk-go-v2/service/bedrockruntime/types"
)

func main() {
	var union types.ResponseStream
	// type switches can be used to check the union value
	switch v := union.(type) {
	case *types.ResponseStreamMemberChunk:
		_ = v.Value // Value is types.PayloadPart

	case *types.UnknownUnionMember:
		fmt.Println("unknown tag:", v.Tag)

	default:
		fmt.Println("union is nil or unknown type")

	}
}
Output:

type ResponseStreamMemberChunk

type ResponseStreamMemberChunk struct {
	Value PayloadPart
	// contains filtered or unexported fields
}

Content included in the response.

type ServiceQuotaExceededException

type ServiceQuotaExceededException struct {
	Message *string

	ErrorCodeOverride *string
	// contains filtered or unexported fields
}

Your request exceeds the service quota for your account. You can view your quotas at Viewing service quotas. You can resubmit your request later.

func (*ServiceQuotaExceededException) Error

func (*ServiceQuotaExceededException) ErrorCode

func (e *ServiceQuotaExceededException) ErrorCode() string

func (*ServiceQuotaExceededException) ErrorFault

func (*ServiceQuotaExceededException) ErrorMessage

func (e *ServiceQuotaExceededException) ErrorMessage() string

type ServiceUnavailableException

type ServiceUnavailableException struct {
	Message *string

	ErrorCodeOverride *string
	// contains filtered or unexported fields
}

The service isn't currently available. Try again later.

func (*ServiceUnavailableException) Error

func (*ServiceUnavailableException) ErrorCode

func (e *ServiceUnavailableException) ErrorCode() string

func (*ServiceUnavailableException) ErrorFault

func (*ServiceUnavailableException) ErrorMessage

func (e *ServiceUnavailableException) ErrorMessage() string

type SpecificToolChoice

type SpecificToolChoice struct {

	// The name of the tool that the model must request.
	//
	// This member is required.
	Name *string
	// contains filtered or unexported fields
}

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

This field is only supported by Anthropic Claude 3 models.

type StopReason

type StopReason string
const (
	StopReasonEndTurn             StopReason = "end_turn"
	StopReasonToolUse             StopReason = "tool_use"
	StopReasonMaxTokens           StopReason = "max_tokens"
	StopReasonStopSequence        StopReason = "stop_sequence"
	StopReasonGuardrailIntervened StopReason = "guardrail_intervened"
	StopReasonContentFiltered     StopReason = "content_filtered"
)

Enum values for StopReason

func (StopReason) Values

func (StopReason) Values() []StopReason

Values returns all known values for StopReason. Note that this can be expanded in the future, and so it is only as up to date as the client.

The ordering of this slice is not guaranteed to be stable across updates.

type SystemContentBlock

type SystemContentBlock interface {
	// contains filtered or unexported methods
}

A system content block.

The following types satisfy this interface:

SystemContentBlockMemberGuardContent
SystemContentBlockMemberText
Example (OutputUsage)
package main

import (
	"fmt"
	"github.com/aws/aws-sdk-go-v2/service/bedrockruntime/types"
)

func main() {
	var union types.SystemContentBlock
	// type switches can be used to check the union value
	switch v := union.(type) {
	case *types.SystemContentBlockMemberGuardContent:
		_ = v.Value // Value is types.GuardrailConverseContentBlock

	case *types.SystemContentBlockMemberText:
		_ = v.Value // Value is string

	case *types.UnknownUnionMember:
		fmt.Println("unknown tag:", v.Tag)

	default:
		fmt.Println("union is nil or unknown type")

	}
}
Output:

type SystemContentBlockMemberGuardContent

type SystemContentBlockMemberGuardContent struct {
	Value GuardrailConverseContentBlock
	// contains filtered or unexported fields
}

A content block to assess with the guardrail. Use with the Converse or ConverseStream API operations.

For more information, see Use a guardrail with the Converse API in the Amazon Bedrock User Guide.

type SystemContentBlockMemberText

type SystemContentBlockMemberText struct {
	Value string
	// contains filtered or unexported fields
}

A system prompt for the model.

type ThrottlingException

type ThrottlingException struct {
	Message *string

	ErrorCodeOverride *string
	// contains filtered or unexported fields
}

Your request was throttled because of service-wide limitations. Resubmit your request later or in a different region. You can also purchase Provisioned Throughputto increase the rate or number of tokens you can process.

func (*ThrottlingException) Error

func (e *ThrottlingException) Error() string

func (*ThrottlingException) ErrorCode

func (e *ThrottlingException) ErrorCode() string

func (*ThrottlingException) ErrorFault

func (e *ThrottlingException) ErrorFault() smithy.ErrorFault

func (*ThrottlingException) ErrorMessage

func (e *ThrottlingException) ErrorMessage() string

type TokenUsage

type TokenUsage struct {

	// The number of tokens sent in the request to the model.
	//
	// This member is required.
	InputTokens *int32

	// The number of tokens that the model generated for the request.
	//
	// This member is required.
	OutputTokens *int32

	// The total of input tokens and tokens generated by the model.
	//
	// This member is required.
	TotalTokens *int32
	// contains filtered or unexported fields
}

The tokens used in a message API inference call.

type Tool

type Tool interface {
	// contains filtered or unexported methods
}

Information about a tool that you can use with the Converse API. For more information, see Tool use (function calling)in the Amazon Bedrock User Guide.

The following types satisfy this interface:

ToolMemberToolSpec
Example (OutputUsage)
package main

import (
	"fmt"
	"github.com/aws/aws-sdk-go-v2/service/bedrockruntime/types"
)

func main() {
	var union types.Tool
	// type switches can be used to check the union value
	switch v := union.(type) {
	case *types.ToolMemberToolSpec:
		_ = v.Value // Value is types.ToolSpecification

	case *types.UnknownUnionMember:
		fmt.Println("unknown tag:", v.Tag)

	default:
		fmt.Println("union is nil or unknown type")

	}
}
Output:

type ToolChoice

type ToolChoice interface {
	// contains filtered or unexported methods
}

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

The following types satisfy this interface:

ToolChoiceMemberAny
ToolChoiceMemberAuto
ToolChoiceMemberTool
Example (OutputUsage)
package main

import (
	"fmt"
	"github.com/aws/aws-sdk-go-v2/service/bedrockruntime/types"
)

func main() {
	var union types.ToolChoice
	// type switches can be used to check the union value
	switch v := union.(type) {
	case *types.ToolChoiceMemberAny:
		_ = v.Value // Value is types.AnyToolChoice

	case *types.ToolChoiceMemberAuto:
		_ = v.Value // Value is types.AutoToolChoice

	case *types.ToolChoiceMemberTool:
		_ = v.Value // Value is types.SpecificToolChoice

	case *types.UnknownUnionMember:
		fmt.Println("unknown tag:", v.Tag)

	default:
		fmt.Println("union is nil or unknown type")

	}
}
Output:

type ToolChoiceMemberAny

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

The model must request at least one tool (no text is generated).

type ToolChoiceMemberAuto

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

(Default). The Model automatically decides if a tool should be called or whether to generate text instead.

type ToolChoiceMemberTool

type ToolChoiceMemberTool struct {
	Value SpecificToolChoice
	// contains filtered or unexported fields
}

The Model must request the specified tool. Only supported by Anthropic Claude 3 models.

type ToolConfiguration

type ToolConfiguration struct {

	// An array of tools that you want to pass to a model.
	//
	// This member is required.
	Tools []Tool

	// If supported by model, forces the model to request a tool.
	ToolChoice ToolChoice
	// contains filtered or unexported fields
}

Configuration information for the tools that you pass to a model. For more information, see Tool use (function calling)in the Amazon Bedrock User Guide.

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

type ToolInputSchema

type ToolInputSchema interface {
	// contains filtered or unexported methods
}

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

The following types satisfy this interface:

ToolInputSchemaMemberJson
Example (OutputUsage)
package main

import (
	"fmt"
	"github.com/aws/aws-sdk-go-v2/service/bedrockruntime/types"
)

func main() {
	var union types.ToolInputSchema
	// type switches can be used to check the union value
	switch v := union.(type) {
	case *types.ToolInputSchemaMemberJson:
		_ = v.Value // Value is document.Interface

	case *types.UnknownUnionMember:
		fmt.Println("unknown tag:", v.Tag)

	default:
		fmt.Println("union is nil or unknown type")

	}
}
Output:

type ToolInputSchemaMemberJson

type ToolInputSchemaMemberJson struct {
	Value document.Interface
	// contains filtered or unexported fields
}

The JSON schema for the tool. For more information, see JSON Schema Reference.

type ToolMemberToolSpec

type ToolMemberToolSpec struct {
	Value ToolSpecification
	// contains filtered or unexported fields
}

The specfication for the tool.

type ToolResultBlock

type ToolResultBlock struct {

	// The content for tool result content block.
	//
	// This member is required.
	Content []ToolResultContentBlock

	// The ID of the tool request that this is the result for.
	//
	// This member is required.
	ToolUseId *string

	// The status for the tool result content block.
	//
	// This field is only supported Anthropic Claude 3 models.
	Status ToolResultStatus
	// contains filtered or unexported fields
}

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

type ToolResultContentBlock

type ToolResultContentBlock interface {
	// contains filtered or unexported methods
}

The tool result content block.

The following types satisfy this interface:

ToolResultContentBlockMemberDocument
ToolResultContentBlockMemberImage
ToolResultContentBlockMemberJson
ToolResultContentBlockMemberText
Example (OutputUsage)
package main

import (
	"fmt"
	"github.com/aws/aws-sdk-go-v2/service/bedrockruntime/types"
)

func main() {
	var union types.ToolResultContentBlock
	// type switches can be used to check the union value
	switch v := union.(type) {
	case *types.ToolResultContentBlockMemberDocument:
		_ = v.Value // Value is types.DocumentBlock

	case *types.ToolResultContentBlockMemberImage:
		_ = v.Value // Value is types.ImageBlock

	case *types.ToolResultContentBlockMemberJson:
		_ = v.Value // Value is document.Interface

	case *types.ToolResultContentBlockMemberText:
		_ = v.Value // Value is string

	case *types.UnknownUnionMember:
		fmt.Println("unknown tag:", v.Tag)

	default:
		fmt.Println("union is nil or unknown type")

	}
}
Output:

type ToolResultContentBlockMemberDocument

type ToolResultContentBlockMemberDocument struct {
	Value DocumentBlock
	// contains filtered or unexported fields
}

A tool result that is a document.

type ToolResultContentBlockMemberImage

type ToolResultContentBlockMemberImage struct {
	Value ImageBlock
	// contains filtered or unexported fields
}

A tool result that is an image.

This field is only supported by Anthropic Claude 3 models.

type ToolResultContentBlockMemberJson

type ToolResultContentBlockMemberJson struct {
	Value document.Interface
	// contains filtered or unexported fields
}

A tool result that is JSON format data.

type ToolResultContentBlockMemberText

type ToolResultContentBlockMemberText struct {
	Value string
	// contains filtered or unexported fields
}

A tool result that is text.

type ToolResultStatus

type ToolResultStatus string
const (
	ToolResultStatusSuccess ToolResultStatus = "success"
	ToolResultStatusError   ToolResultStatus = "error"
)

Enum values for ToolResultStatus

func (ToolResultStatus) Values

Values returns all known values for ToolResultStatus. Note that this can be expanded in the future, and so it is only as up to date as the client.

The ordering of this slice is not guaranteed to be stable across updates.

type ToolSpecification

type ToolSpecification struct {

	// The input schema for the tool in JSON format.
	//
	// This member is required.
	InputSchema ToolInputSchema

	// The name for the tool.
	//
	// This member is required.
	Name *string

	// The description for the tool.
	Description *string
	// contains filtered or unexported fields
}

The specification for the tool.

type ToolUseBlock

type ToolUseBlock struct {

	// The input to pass to the tool.
	//
	// This member is required.
	Input document.Interface

	// The name of the tool that the model wants to use.
	//
	// This member is required.
	Name *string

	// The ID for the tool request.
	//
	// This member is required.
	ToolUseId *string
	// contains filtered or unexported fields
}

A tool use content block. Contains information about a tool that the model is requesting be run., The model uses the result from the tool to generate a response.

type ToolUseBlockDelta

type ToolUseBlockDelta struct {

	// The input for a requested tool.
	//
	// This member is required.
	Input *string
	// contains filtered or unexported fields
}

The delta for a tool use block.

type ToolUseBlockStart

type ToolUseBlockStart struct {

	// The name of the tool that the model is requesting to use.
	//
	// This member is required.
	Name *string

	// The ID for the tool request.
	//
	// This member is required.
	ToolUseId *string
	// contains filtered or unexported fields
}

The start of a tool use block.

type Trace

type Trace string
const (
	TraceEnabled  Trace = "ENABLED"
	TraceDisabled Trace = "DISABLED"
)

Enum values for Trace

func (Trace) Values

func (Trace) Values() []Trace

Values returns all known values for Trace. Note that this can be expanded in the future, and so it is only as up to date as the client.

The ordering of this slice is not guaranteed to be stable across updates.

type UnknownUnionMember

type UnknownUnionMember struct {
	Tag   string
	Value []byte
	// contains filtered or unexported fields
}

UnknownUnionMember is returned when a union member is returned over the wire, but has an unknown tag.

type ValidationException

type ValidationException struct {
	Message *string

	ErrorCodeOverride *string
	// contains filtered or unexported fields
}

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

func (*ValidationException) Error

func (e *ValidationException) Error() string

func (*ValidationException) ErrorCode

func (e *ValidationException) ErrorCode() string

func (*ValidationException) ErrorFault

func (e *ValidationException) ErrorFault() smithy.ErrorFault

func (*ValidationException) ErrorMessage

func (e *ValidationException) ErrorMessage() string

Jump to

Keyboard shortcuts

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