Documentation
¶
Overview ¶
Package agentcore provides convenience constructors for running bond agents on AWS Bedrock AgentCore Runtime. It wraps the generic runtime package with AgentCore-specific defaults (ports, paths, session headers).
For custom deployments, use the runtime package directly.
Index ¶
- Constants
- func NewA2AHandler(agent bond.Agent, opts Options) *runtime.A2AHandler
- func NewA2AHandlerFromExecutor(executor a2asrv.AgentExecutor, opts Options) *runtime.A2AHandler
- func NewHTTPHandler(agent bond.Agent, opts Options) *runtime.HTTPHandler
- func NewMCPHandler(agent bond.Agent, opts Options) *runtime.MCPHandler
- func NewMCPHandlerFromExecutor(executor a2asrv.AgentExecutor, opts Options) *runtime.MCPHandler
- func Serve(agent bond.Agent, opts Options) error
- type Options
- type Session
Constants ¶
const ( PortA2A = ":9000" PortHTTP = ":8080" PortMCP = ":8000" )
Standard AgentCore ports.
const ( // HeaderSessionID is the platform-injected session identifier. HeaderSessionID = "X-Amzn-Bedrock-AgentCore-Runtime-Session-Id" // HeaderCustomPrefix is the prefix for custom runtime headers. HeaderCustomPrefix = "X-Amzn-Bedrock-AgentCore-Runtime-Custom-" )
Standard AgentCore runtime headers.
Variables ¶
This section is empty.
Functions ¶
func NewA2AHandler ¶
func NewA2AHandler(agent bond.Agent, opts Options) *runtime.A2AHandler
NewA2AHandler creates an A2A handler with AgentCore defaults (port 9000, session middleware).
func NewA2AHandlerFromExecutor ¶
func NewA2AHandlerFromExecutor(executor a2asrv.AgentExecutor, opts Options) *runtime.A2AHandler
NewA2AHandlerFromExecutor creates an A2A handler from a custom executor with AgentCore defaults.
func NewHTTPHandler ¶
func NewHTTPHandler(agent bond.Agent, opts Options) *runtime.HTTPHandler
NewHTTPHandler creates an HTTP handler with AgentCore defaults (port 8080, /invocations path).
func NewMCPHandler ¶
func NewMCPHandler(agent bond.Agent, opts Options) *runtime.MCPHandler
NewMCPHandler creates an MCP handler with AgentCore defaults (port 8000, /mcp path).
func NewMCPHandlerFromExecutor ¶
func NewMCPHandlerFromExecutor(executor a2asrv.AgentExecutor, opts Options) *runtime.MCPHandler
NewMCPHandlerFromExecutor creates an MCP handler from a custom executor with AgentCore defaults.
Types ¶
type Options ¶
type Options struct {
runtime.Options
// ShutdownTimeout is how long to wait for in-flight requests during graceful
// shutdown. Defaults to 30 seconds if zero.
ShutdownTimeout time.Duration
}
Options configures AgentCore handlers.
type Session ¶
type Session struct {
// SessionID is the platform-managed session identifier.
SessionID string
// Headers contains all request headers (for custom header access).
Headers http.Header
}
Session holds AgentCore runtime metadata extracted from request headers.
func SessionFromContext ¶
SessionFromContext retrieves the AgentCore Session from ctx. Returns nil if not running inside an AgentCore handler.
func (*Session) CustomHeader ¶
CustomHeader returns the value of a custom AgentCore header by suffix. For example, CustomHeader("UserId") returns the value of "X-Amzn-Bedrock-AgentCore-Runtime-Custom-UserId".