Skip to content

BedrockClient#

Index > Bedrock > BedrockClient

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

BedrockClient#

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

# BedrockClient usage example

from boto3.session import Session
from mypy_boto3_bedrock.client import BedrockClient

def get_bedrock_client() -> BedrockClient:
    return Session().client("bedrock")

Exceptions#

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

# Exceptions.exceptions usage example

client = boto3.client("bedrock")

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.TooManyTagsException,
    client.exceptions.ValidationException,
) as e:
    print(e)
# Exceptions.exceptions type checking example

from mypy_boto3_bedrock.client import Exceptions

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

Methods#

can_paginate#

Check if an operation can be paginated.

Type annotations and code completion for boto3.client("bedrock").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").close method. boto3 documentation

# close method definition

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

create_evaluation_job#

API operation for creating and managing Amazon Bedrock automatic model evaluation jobs and model evaluation jobs that use human workers.

Type annotations and code completion for boto3.client("bedrock").create_evaluation_job method. boto3 documentation

# create_evaluation_job method definition

def create_evaluation_job(
    self,
    *,
    jobName: str,
    roleArn: str,
    evaluationConfig: Union[EvaluationConfigTypeDef, EvaluationConfigOutputTypeDef],  # (1)
    inferenceConfig: Union[EvaluationInferenceConfigTypeDef, EvaluationInferenceConfigOutputTypeDef],  # (2)
    outputDataConfig: EvaluationOutputDataConfigTypeDef,  # (3)
    jobDescription: str = ...,
    clientRequestToken: str = ...,
    customerEncryptionKeyId: str = ...,
    jobTags: Sequence[TagTypeDef] = ...,  # (4)
) -> CreateEvaluationJobResponseTypeDef:  # (5)
    ...
  1. See EvaluationConfigTypeDef EvaluationConfigOutputTypeDef
  2. See EvaluationInferenceConfigTypeDef EvaluationInferenceConfigOutputTypeDef
  3. See EvaluationOutputDataConfigTypeDef
  4. See TagTypeDef
  5. See CreateEvaluationJobResponseTypeDef
# create_evaluation_job method usage example with argument unpacking

kwargs: CreateEvaluationJobRequestRequestTypeDef = {  # (1)
    "jobName": ...,
    "roleArn": ...,
    "evaluationConfig": ...,
    "inferenceConfig": ...,
    "outputDataConfig": ...,
}

parent.create_evaluation_job(**kwargs)
  1. See CreateEvaluationJobRequestRequestTypeDef

create_guardrail#

Creates a guardrail to block topics and to filter out harmful content.

Type annotations and code completion for boto3.client("bedrock").create_guardrail method. boto3 documentation

# create_guardrail method definition

def create_guardrail(
    self,
    *,
    name: str,
    blockedInputMessaging: str,
    blockedOutputsMessaging: str,
    description: str = ...,
    topicPolicyConfig: GuardrailTopicPolicyConfigTypeDef = ...,  # (1)
    contentPolicyConfig: GuardrailContentPolicyConfigTypeDef = ...,  # (2)
    wordPolicyConfig: GuardrailWordPolicyConfigTypeDef = ...,  # (3)
    sensitiveInformationPolicyConfig: GuardrailSensitiveInformationPolicyConfigTypeDef = ...,  # (4)
    kmsKeyId: str = ...,
    tags: Sequence[TagTypeDef] = ...,  # (5)
    clientRequestToken: str = ...,
) -> CreateGuardrailResponseTypeDef:  # (6)
    ...
  1. See GuardrailTopicPolicyConfigTypeDef
  2. See GuardrailContentPolicyConfigTypeDef
  3. See GuardrailWordPolicyConfigTypeDef
  4. See GuardrailSensitiveInformationPolicyConfigTypeDef
  5. See TagTypeDef
  6. See CreateGuardrailResponseTypeDef
# create_guardrail method usage example with argument unpacking

kwargs: CreateGuardrailRequestRequestTypeDef = {  # (1)
    "name": ...,
    "blockedInputMessaging": ...,
    "blockedOutputsMessaging": ...,
}

parent.create_guardrail(**kwargs)
  1. See CreateGuardrailRequestRequestTypeDef

create_guardrail_version#

Creates a version of the guardrail.

Type annotations and code completion for boto3.client("bedrock").create_guardrail_version method. boto3 documentation

# create_guardrail_version method definition

def create_guardrail_version(
    self,
    *,
    guardrailIdentifier: str,
    description: str = ...,
    clientRequestToken: str = ...,
) -> CreateGuardrailVersionResponseTypeDef:  # (1)
    ...
  1. See CreateGuardrailVersionResponseTypeDef
# create_guardrail_version method usage example with argument unpacking

kwargs: CreateGuardrailVersionRequestRequestTypeDef = {  # (1)
    "guardrailIdentifier": ...,
}

parent.create_guardrail_version(**kwargs)
  1. See CreateGuardrailVersionRequestRequestTypeDef

create_model_customization_job#

Creates a fine-tuning job to customize a base model.

Type annotations and code completion for boto3.client("bedrock").create_model_customization_job method. boto3 documentation

# create_model_customization_job method definition

def create_model_customization_job(
    self,
    *,
    jobName: str,
    customModelName: str,
    roleArn: str,
    baseModelIdentifier: str,
    trainingDataConfig: TrainingDataConfigTypeDef,  # (1)
    outputDataConfig: OutputDataConfigTypeDef,  # (2)
    hyperParameters: Mapping[str, str],
    clientRequestToken: str = ...,
    customizationType: CustomizationTypeType = ...,  # (3)
    customModelKmsKeyId: str = ...,
    jobTags: Sequence[TagTypeDef] = ...,  # (4)
    customModelTags: Sequence[TagTypeDef] = ...,  # (4)
    validationDataConfig: Union[ValidationDataConfigTypeDef, ValidationDataConfigOutputTypeDef] = ...,  # (6)
    vpcConfig: Union[VpcConfigTypeDef, VpcConfigOutputTypeDef] = ...,  # (7)
) -> CreateModelCustomizationJobResponseTypeDef:  # (8)
    ...
  1. See TrainingDataConfigTypeDef
  2. See OutputDataConfigTypeDef
  3. See CustomizationTypeType
  4. See TagTypeDef
  5. See TagTypeDef
  6. See ValidationDataConfigTypeDef ValidationDataConfigOutputTypeDef
  7. See VpcConfigTypeDef VpcConfigOutputTypeDef
  8. See CreateModelCustomizationJobResponseTypeDef
# create_model_customization_job method usage example with argument unpacking

kwargs: CreateModelCustomizationJobRequestRequestTypeDef = {  # (1)
    "jobName": ...,
    "customModelName": ...,
    "roleArn": ...,
    "baseModelIdentifier": ...,
    "trainingDataConfig": ...,
    "outputDataConfig": ...,
    "hyperParameters": ...,
}

parent.create_model_customization_job(**kwargs)
  1. See CreateModelCustomizationJobRequestRequestTypeDef

create_provisioned_model_throughput#

Creates dedicated throughput for a base or custom model with the model units and for the duration that you specify.

Type annotations and code completion for boto3.client("bedrock").create_provisioned_model_throughput method. boto3 documentation

# create_provisioned_model_throughput method definition

def create_provisioned_model_throughput(
    self,
    *,
    modelUnits: int,
    provisionedModelName: str,
    modelId: str,
    clientRequestToken: str = ...,
    commitmentDuration: CommitmentDurationType = ...,  # (1)
    tags: Sequence[TagTypeDef] = ...,  # (2)
) -> CreateProvisionedModelThroughputResponseTypeDef:  # (3)
    ...
  1. See CommitmentDurationType
  2. See TagTypeDef
  3. See CreateProvisionedModelThroughputResponseTypeDef
# create_provisioned_model_throughput method usage example with argument unpacking

kwargs: CreateProvisionedModelThroughputRequestRequestTypeDef = {  # (1)
    "modelUnits": ...,
    "provisionedModelName": ...,
    "modelId": ...,
}

parent.create_provisioned_model_throughput(**kwargs)
  1. See CreateProvisionedModelThroughputRequestRequestTypeDef

delete_custom_model#

Deletes a custom model that you created earlier.

Type annotations and code completion for boto3.client("bedrock").delete_custom_model method. boto3 documentation

# delete_custom_model method definition

def delete_custom_model(
    self,
    *,
    modelIdentifier: str,
) -> Dict[str, Any]:
    ...
# delete_custom_model method usage example with argument unpacking

kwargs: DeleteCustomModelRequestRequestTypeDef = {  # (1)
    "modelIdentifier": ...,
}

parent.delete_custom_model(**kwargs)
  1. See DeleteCustomModelRequestRequestTypeDef

delete_guardrail#

Deletes a guardrail.

Type annotations and code completion for boto3.client("bedrock").delete_guardrail method. boto3 documentation

# delete_guardrail method definition

def delete_guardrail(
    self,
    *,
    guardrailIdentifier: str,
    guardrailVersion: str = ...,
) -> Dict[str, Any]:
    ...
# delete_guardrail method usage example with argument unpacking

kwargs: DeleteGuardrailRequestRequestTypeDef = {  # (1)
    "guardrailIdentifier": ...,
}

parent.delete_guardrail(**kwargs)
  1. See DeleteGuardrailRequestRequestTypeDef

delete_model_invocation_logging_configuration#

Delete the invocation logging.

Type annotations and code completion for boto3.client("bedrock").delete_model_invocation_logging_configuration method.