bedrock_client#
AWS Bedrock ModelClient integration.
Functions
|
When we only need the content of the first message. |
Classes
|
A component wrapper for the Bedrock API client. |
Constants
- bedrock_runtime_exceptions = <botocore.errorfactory.BedrockRuntimeExceptions object>#
- class BedrockAPIClient(aws_profile_name=None, aws_region_name=None, aws_access_key_id=None, aws_secret_access_key=None, aws_session_token=None, aws_connection_timeout=None, aws_read_timeout=None, chat_completion_parser: Callable = None)[source]#
Bases:
ModelClient
A component wrapper for the Bedrock API client. Visit https://docs.aws.amazon.com/bedrock/latest/APIReference/welcome.html for more api details.
- init_sync_client()[source]#
There is no need to pass both profile and secret key and access key. Path one of them. if the compute power assume a role that have access to bedrock, no need to pass anything.
- convert_inputs_to_api_kwargs(input: Any | None = None, model_kwargs: Dict = {}, model_type: ModelType = ModelType.UNDEFINED)[source]#
check the converse api doc here: https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/bedrock-runtime/client/converse.html