bedrock_agents_sdk.plugins package

Submodules

bedrock_agents_sdk.plugins.base module

Base plugin class for Bedrock Agents SDK.

class bedrock_agents_sdk.plugins.base.AgentPlugin[source]

Bases: object

Base class for all plugins for the Bedrock Agents SDK

post_invoke(response)[source]

Called after invoke_inline_agent, can modify response

post_process(result)[source]

Called after processing the response, can modify the final result

pre_deploy(template)[source]

Called before generating the SAM template, can modify the template

Parameters:

template – The SAM template dictionary

Returns:

The modified SAM template dictionary

pre_invoke(params)[source]

Called before invoke_inline_agent, can modify params

bedrock_agents_sdk.plugins.base.BedrockAgentsPlugin

alias of AgentPlugin

bedrock_agents_sdk.plugins.base.ClientPlugin

alias of AgentPlugin

bedrock_agents_sdk.plugins.guardrail module

Guardrail plugin for Bedrock Agents SDK.

class bedrock_agents_sdk.plugins.guardrail.GuardrailPlugin(guardrail_id: str, guardrail_version: str = None)[source]

Bases: AgentPlugin

Plugin for adding guardrails to Bedrock Agents

pre_deploy(template)[source]

Add guardrail configuration to the agent in the SAM template

pre_invoke(params)[source]

Add guardrail configuration to the request parameters

bedrock_agents_sdk.plugins.knowledge_base module

Knowledge base plugin for Bedrock Agents SDK.

class bedrock_agents_sdk.plugins.knowledge_base.KnowledgeBasePlugin(knowledge_base_id: str, description: str = None, retrieval_config: dict = None)[source]

Bases: AgentPlugin

Plugin for adding knowledge base integration to Bedrock Agents

pre_deploy(template)[source]

Add knowledge base configuration to the agent in the SAM template

pre_invoke(params)[source]

Add knowledge base configuration to the request parameters

bedrock_agents_sdk.plugins.security module

Security plugin for Bedrock Agents SDK.

class bedrock_agents_sdk.plugins.security.SecurityPlugin(customer_encryption_key_arn=None)[source]

Bases: AgentPlugin

Plugin for adding security features to Bedrock Agents

pre_deploy(template)[source]

Add KMS key ARN to the agent configuration in the SAM template

pre_invoke(params)[source]

Add KMS key ARN to the request parameters

Module contents