Skip to content

AgentsforBedrockClient#

Index > AgentsforBedrock > AgentsforBedrockClient

Auto-generated documentation for AgentsforBedrock type annotations stubs module mypy-boto3-bedrock-agent.

AgentsforBedrockClient#

Type annotations and code completion for boto3.client("bedrock-agent"). boto3 documentation

# AgentsforBedrockClient usage example

from boto3.session import Session
from mypy_boto3_bedrock_agent.client import AgentsforBedrockClient

def get_bedrock-agent_client() -> AgentsforBedrockClient:
    return Session().client("bedrock-agent")

Exceptions#

boto3 client exceptions are generated in runtime. This class provides code completion for boto3.client("bedrock-agent").exceptions structure.

# Exceptions.exceptions usage example

client = boto3.client("bedrock-agent")

try:
    do_something(client)
except (
    client.exceptions.AccessDeniedException,
    client.exceptions.ClientError,
    client.exceptions.ConflictException,
    client.exceptions.InternalServerException,
    client.exceptions.ResourceNotFoundException,
    client.exceptions.ServiceQuotaExceededException,
    client.exceptions.ThrottlingException,
    client.exceptions.ValidationException,
) as e:
    print(e)
# Exceptions.exceptions type checking example

from mypy_boto3_bedrock_agent.client import Exceptions

def handle_error(exc: Exceptions.AccessDeniedException) -> None:
    ...

Methods#

associate_agent_knowledge_base#

Associates a knowledge base with an agent.

Type annotations and code completion for boto3.client("bedrock-agent").associate_agent_knowledge_base method. boto3 documentation

# associate_agent_knowledge_base method definition

def associate_agent_knowledge_base(
    self,
    *,
    agentId: str,
    agentVersion: str,
    description: str,
    knowledgeBaseId: str,
    knowledgeBaseState: KnowledgeBaseStateType = ...,  # (1)
) -> AssociateAgentKnowledgeBaseResponseTypeDef:  # (2)
    ...
  1. See KnowledgeBaseStateType
  2. See AssociateAgentKnowledgeBaseResponseTypeDef
# associate_agent_knowledge_base method usage example with argument unpacking

kwargs: AssociateAgentKnowledgeBaseRequestRequestTypeDef = {  # (1)
    "agentId": ...,
    "agentVersion": ...,
    "description": ...,
    "knowledgeBaseId": ...,
}

parent.associate_agent_knowledge_base(**kwargs)
  1. See AssociateAgentKnowledgeBaseRequestRequestTypeDef

can_paginate#

Check if an operation can be paginated.

Type annotations and code completion for boto3.client("bedrock-agent").can_paginate method. boto3 documentation

# can_paginate method definition

def can_paginate(
    self,
    operation_name: str,
) -> bool:
    ...

close#

Closes underlying endpoint connections.

Type annotations and code completion for boto3.client("bedrock-agent").close method. boto3 documentation

# close method definition

def close(
    self,
) -> None:
    ...

create_agent#

Creates an agent that orchestrates interactions between foundation models, data sources, software applications, user conversations, and APIs to carry out tasks to help customers.

Type annotations and code completion for boto3.client("bedrock-agent").create_agent method. boto3 documentation

# create_agent method definition

def create_agent(
    self,
    *,
    agentName: str,
    agentResourceRoleArn: str = ...,
    clientToken: str = ...,
    customerEncryptionKeyArn: str = ...,
    description: str = ...,
    foundationModel: str = ...,
    guardrailConfiguration: GuardrailConfigurationTypeDef = ...,  # (1)
    idleSessionTTLInSeconds: int = ...,
    instruction: str = ...,
    promptOverrideConfiguration: Union[PromptOverrideConfigurationTypeDef, PromptOverrideConfigurationOutputTypeDef] = ...,  # (2)
    tags: Mapping[str, str] = ...,
) -> CreateAgentResponseTypeDef:  # (3)
    ...
  1. See GuardrailConfigurationTypeDef
  2. See PromptOverrideConfigurationTypeDef PromptOverrideConfigurationOutputTypeDef
  3. See CreateAgentResponseTypeDef
# create_agent method usage example with argument unpacking

kwargs: CreateAgentRequestRequestTypeDef = {  # (1)
    "agentName": ...,
}

parent.create_agent(**kwargs)
  1. See CreateAgentRequestRequestTypeDef

create_agent_action_group#

Creates an action group for an agent.

Type annotations and code completion for boto3.client("bedrock-agent").create_agent_action_group method. boto3 documentation

# create_agent_action_group method definition

def create_agent_action_group(
    self,
    *,
    actionGroupName: str,
    agentId: str,
    agentVersion: str,
    actionGroupExecutor: ActionGroupExecutorTypeDef = ...,  # (1)
    actionGroupState: ActionGroupStateType = ...,  # (2)
    apiSchema: APISchemaTypeDef = ...,  # (3)
    clientToken: str = ...,
    description: str = ...,
    functionSchema: Union[FunctionSchemaTypeDef, FunctionSchemaOutputTypeDef] = ...,  # (4)
    parentActionGroupSignature: ActionGroupSignatureType = ...,  # (5)
) -> CreateAgentActionGroupResponseTypeDef:  # (6)
    ...
  1. See ActionGroupExecutorTypeDef
  2. See ActionGroupStateType
  3. See APISchemaTypeDef
  4. See FunctionSchemaTypeDef FunctionSchemaOutputTypeDef
  5. See ActionGroupSignatureType
  6. See CreateAgentActionGroupResponseTypeDef
# create_agent_action_group method usage example with argument unpacking

kwargs: CreateAgentActionGroupRequestRequestTypeDef = {  # (1)
    "actionGroupName": ...,
    "agentId": ...,
    "agentVersion": ...,
}

parent.create_agent_action_group(**kwargs)
  1. See CreateAgentActionGroupRequestRequestTypeDef

create_agent_alias#

Creates an alias of an agent that can be used to deploy the agent.

Type annotations and code completion for boto3.client("bedrock-agent").create_agent_alias method. boto3 documentation

# create_agent_alias method definition

def create_agent_alias(
    self,
    *,
    agentAliasName: str,
    agentId: str,
    clientToken: str = ...,
    description: str = ...,
    routingConfiguration: Sequence[AgentAliasRoutingConfigurationListItemTypeDef] = ...,  # (1)
    tags: Mapping[str, str] = ...,
) -> CreateAgentAliasResponseTypeDef:  # (2)
    ...
  1. See AgentAliasRoutingConfigurationListItemTypeDef
  2. See CreateAgentAliasResponseTypeDef
# create_agent_alias method usage example with argument unpacking

kwargs: CreateAgentAliasRequestRequestTypeDef = {  # (1)
    "agentAliasName": ...,
    "agentId": ...,
}

parent.create_agent_alias(**kwargs)
  1. See CreateAgentAliasRequestRequestTypeDef

create_data_source#

Sets up a data source to be added to a knowledge base.

Type annotations and code completion for boto3.client("bedrock-agent").create_data_source method. boto3 documentation

# create_data_source method definition

def create_data_source(
    self,
    *,
    dataSourceConfiguration: Union[DataSourceConfigurationTypeDef, DataSourceConfigurationOutputTypeDef],  # (1)
    knowledgeBaseId: str,
    name: str,
    clientToken: str = ...,
    dataDeletionPolicy: DataDeletionPolicyType = ...,  # (2)
    description: str = ...,
    serverSideEncryptionConfiguration: ServerSideEncryptionConfigurationTypeDef = ...,  # (3)
    vectorIngestionConfiguration: VectorIngestionConfigurationTypeDef = ...,  # (4)
) -> CreateDataSourceResponseTypeDef:  # (5)
    ...
  1. See DataSourceConfigurationTypeDef DataSourceConfigurationOutputTypeDef
  2. See DataDeletionPolicyType
  3. See ServerSideEncryptionConfigurationTypeDef
  4. See VectorIngestionConfigurationTypeDef
  5. See CreateDataSourceResponseTypeDef
# create_data_source method usage example with argument unpacking

kwargs: CreateDataSourceRequestRequestTypeDef = {  # (1)
    "dataSourceConfiguration": ...,
    "knowledgeBaseId": ...,
    "name": ...,
}

parent.create_data_source(**kwargs)
  1. See CreateDataSourceRequestRequestTypeDef

create_knowledge_base#

Creates a knowledge base that contains data sources from which information can be queried and used by LLMs.

Type annotations and code completion for boto3.client("bedrock-agent").create_knowledge_base method. boto3 documentation

# create_knowledge_base method definition

def create_knowledge_base(
    self,
    *,
    knowledgeBaseConfiguration: KnowledgeBaseConfigurationTypeDef,  # (1)
    name: str,
    roleArn: str,
    storageConfiguration: StorageConfigurationTypeDef,  # (2)
    clientToken: str = ...,
    description: str = ...,
    tags: Mapping[str, str] = ...,
) -> CreateKnowledgeBaseResponseTypeDef:  # (3)
    ...
  1. See KnowledgeBaseConfigurationTypeDef
  2. See StorageConfigurationTypeDef
  3. See CreateKnowledgeBaseResponseTypeDef
# create_knowledge_base method usage example with argument unpacking

kwargs: CreateKnowledgeBaseRequestRequestTypeDef = {  # (1)
    "knowledgeBaseConfiguration": ...,
    "name": ...,
    "roleArn": ...,
    "storageConfiguration": ...,
}

parent.create_knowledge_base(**kwargs)
  1. See CreateKnowledgeBaseRequestRequestTypeDef

delete_agent#

Deletes an agent.

Type annotations and code completion for boto3.client("bedrock-agent").delete_agent method. boto3 documentation

# delete_agent method definition

def delete_agent(
    self,
    *,
    agentId: str,
    skipResourceInUseCheck: bool = ...,
) -> DeleteAgentResponseTypeDef:  # (1)
    ...
  1. See DeleteAgentResponseTypeDef
# delete_agent method usage example with argument unpacking

kwargs: DeleteAgentRequestRequestTypeDef = {  # (1)
    "agentId": ...,
}

parent.delete_agent(**kwargs)
  1. See