BedrockRuntimeClient#
Index > BedrockRuntime > BedrockRuntimeClient
Auto-generated documentation for BedrockRuntime type annotations stubs module types-aiobotocore-bedrock-runtime.
BedrockRuntimeClient#
Type annotations and code completion for session.client("bedrock-runtime")
boto3 documentation
# BedrockRuntimeClient usage example
from aioboto3.session import Session
from types_aiobotocore_bedrock_runtime.client import BedrockRuntimeClient
session = Session()
async with session.client("bedrock-runtime") as client:
client: BedrockRuntimeClient
Exceptions#
aioboto3
client exceptions are generated in runtime.
This class provides code completion for session.client("bedrock-runtime").exceptions
structure.
# BedrockRuntimeClient.exceptions usage example
async with session.client("bedrock-runtime") as client:
try:
do_something(client)
except (
client.exceptions.AccessDeniedException,
client.exceptions.ClientError,
client.exceptions.InternalServerException,
client.exceptions.ModelErrorException,
client.exceptions.ModelNotReadyException,
client.exceptions.ModelStreamErrorException,
client.exceptions.ModelTimeoutException,
client.exceptions.ResourceNotFoundException,
client.exceptions.ServiceQuotaExceededException,
client.exceptions.ThrottlingException,
client.exceptions.ValidationException,
) as e:
print(e)
# BedrockRuntimeClient.exceptions type checking example
from types_aiobotocore_bedrock_runtime.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 session.client("bedrock-runtime").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 session.client("bedrock-runtime").close
method.
boto3 documentation
# close method definition
await def close(
self,
) -> None:
...
generate_presigned_url#
Generate a presigned url given a client, its method, and arguments.
Type annotations and code completion for session.client("bedrock-runtime").generate_presigned_url
method.
boto3 documentation
# generate_presigned_url method definition
await def generate_presigned_url(
self,
ClientMethod: str,
Params: Mapping[str, Any] = ...,
ExpiresIn: int = 3600,
HttpMethod: str = ...,
) -> str:
...
invoke_model#
Invokes the specified Bedrock model to run inference using the input provided in the request body.
Type annotations and code completion for session.client("bedrock-runtime").invoke_model
method.
boto3 documentation
# invoke_model method definition
await def invoke_model(
self,
*,
body: Union[str, bytes, IO[Any], StreamingBody],
modelId: str,
contentType: str = ...,
accept: str = ...,
) -> InvokeModelResponseTypeDef: # (1)
...
# invoke_model method usage example with argument unpacking
kwargs: InvokeModelRequestRequestTypeDef = { # (1)
"body": ...,
"modelId": ...,
}
parent.invoke_model(**kwargs)
invoke_model_with_response_stream#
Invoke the specified Bedrock model to run inference using the input provided.
Type annotations and code completion for session.client("bedrock-runtime").invoke_model_with_response_stream
method.
boto3 documentation
# invoke_model_with_response_stream method definition
await def invoke_model_with_response_stream(
self,
*,
body: Union[str, bytes, IO[Any], StreamingBody],
modelId: str,
contentType: str = ...,
accept: str = ...,
) -> InvokeModelWithResponseStreamResponseTypeDef: # (1)
...
# invoke_model_with_response_stream method usage example with argument unpacking
kwargs: InvokeModelWithResponseStreamRequestRequestTypeDef = { # (1)
"body": ...,
"modelId": ...,
}
parent.invoke_model_with_response_stream(**kwargs)
__aenter__#
Type annotations and code completion for session.client("bedrock-runtime").__aenter__
method.
boto3 documentation
# __aenter__ method definition
await def __aenter__(
self,
) -> BedrockRuntimeClient:
...
__aexit__#
Type annotations and code completion for session.client("bedrock-runtime").__aexit__
method.
boto3 documentation
# __aexit__ method definition
await def __aexit__(
self,
exc_type: Any,
exc_val: Any,
exc_tb: Any,
) -> Any:
...