Documentation
¶
Overview ¶
Package bedrock handles Bedrock Agent function-based action-group invocations.
Index ¶
- Constants
- type Configuration
- type Error
- type Event
- type FunctionResponse
- type NamedError
- type Options
- type Parameters
- func (p *Parameters) Delete(name string)
- func (p *Parameters) Get(name string) any
- func (p *Parameters) Has(name string) bool
- func (p *Parameters) Keys() []string
- func (p *Parameters) MarshalJSON() ([]byte, error)
- func (p *Parameters) Set(name string, value any)
- func (p *Parameters) Values() map[string]any
- type Resolver
- type ToolHandler
- type Undefined
Constants ¶
const ( Failure = "FAILURE" Reprompt = "REPROMPT" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Configuration ¶
type Configuration struct{ Name, Description string }
type FunctionResponse ¶
type FunctionResponse struct {
Body any
ResponseState any
SessionAttributes any
PromptSessionAttributes any
KnowledgeBasesConfiguration any
}
FunctionResponse bypasses ordinary JSON body conversion. Construct it with NewFunctionResponse to obtain the reference's empty session-attribute defaults. Set optional fields to nil to omit them. Fields remain invocation-owned.
func NewFunctionResponse ¶
func NewFunctionResponse(body any) *FunctionResponse
type NamedError ¶
func (*NamedError) Error ¶
func (e *NamedError) Error() string
func (*NamedError) ErrorName ¶
func (e *NamedError) ErrorName() string
func (*NamedError) Unwrap ¶
func (e *NamedError) Unwrap() error
type Parameters ¶
type Parameters struct {
// contains filtered or unexported fields
}
Parameters retains insertion order so returning the received parameters preserves the reference JSON body. Each invocation receives an independent instance.
func (*Parameters) Delete ¶
func (p *Parameters) Delete(name string)
func (*Parameters) Get ¶
func (p *Parameters) Get(name string) any
func (*Parameters) Has ¶
func (p *Parameters) Has(name string) bool
func (*Parameters) Keys ¶
func (p *Parameters) Keys() []string
Keys follows Object.keys ordering: numeric indices first, then insertion order.
func (*Parameters) MarshalJSON ¶
func (p *Parameters) MarshalJSON() ([]byte, error)
func (*Parameters) Set ¶
func (p *Parameters) Set(name string, value any)
Set replaces a value without moving its original key position.
func (*Parameters) Values ¶
func (p *Parameters) Values() map[string]any
Values returns a shallow map copy. Go maps do not preserve insertion order.
type Resolver ¶
type Resolver struct {
// contains filtered or unexported fields
}
func (*Resolver) Resolve ¶
Resolve validates the event before calling a tool. Business and serialization failures become Bedrock response bodies; malformed input returns an error.
func (*Resolver) Tool ¶
func (r *Resolver) Tool(handler ToolHandler, configuration Configuration)
Tool registers a handler by function name. Description is accepted for source compatibility; the reference stores it without validating or publishing it.