create_model_invocation_job
async
¶
create_model_invocation_job(
job_name: ModelInvocationJobName,
role_arn: RoleArn,
model_id: ModelId,
input_data_config: ModelInvocationJobInputDataConfig,
output_data_config: ModelInvocationJobOutputDataConfig,
*,
config_overrides: Optional[AsyncBedrockClientConfig] = None,
client_request_token: Optional[ModelInvocationIdempotencyToken] = None,
vpc_config: Optional[VpcConfig] = None,
timeout_duration_in_hours: Optional[
ModelInvocationJobTimeoutDurationInHours
] = None,
tags: Optional[TagList] = None,
model_invocation_type: Optional[ModelInvocationType] = None,
) -> CreateModelInvocationJobResponse
Creates a batch inference job to invoke a model on multiple prompts. Format your data according to Format your inference data and upload it to an Amazon S3 bucket. For more information, see Process multiple prompts with batch inference.
The response returns a jobArn that you can use to stop or get details about the job.
Parameters:
-
job_name(ModelInvocationJobName) –A name to give the batch inference job.
-
role_arn(RoleArn) –The Amazon Resource Name (ARN) of the service role with permissions to carry out and manage batch inference. You can use the console to create a default service role or follow the steps at Create a service role for batch inference.
-
client_request_token(Optional[ModelInvocationIdempotencyToken], default:None) –A unique, case-sensitive identifier to ensure that the API request completes no more than one time. If this token matches a previous request, Amazon Bedrock ignores the request, but does not return an error. For more information, see Ensuring idempotency.
-
model_id(ModelId) –The unique identifier of the foundation model to use for the batch inference job.
-
input_data_config(ModelInvocationJobInputDataConfig) –Details about the location of the input to the batch inference job.
-
output_data_config(ModelInvocationJobOutputDataConfig) –Details about the location of the output of the batch inference job.
-
vpc_config(Optional[VpcConfig], default:None) –The configuration of the Virtual Private Cloud (VPC) for the data in the batch inference job. For more information, see Protect batch inference jobs using a VPC.
-
timeout_duration_in_hours(Optional[ModelInvocationJobTimeoutDurationInHours], default:None) –The number of hours after which to force the batch inference job to time out.
-
tags(Optional[TagList], default:None) –Any tags to associate with the batch inference job. For more information, see Tagging Amazon Bedrock resources.
-
model_invocation_type(Optional[ModelInvocationType], default:None) –The invocation endpoint for ModelInvocationJob
Raises:
-
AccessDeniedException–The request is denied because of missing access permissions.
-
ConflictException–Error occurred because of a conflict while performing an operation.
-
InternalServerException–An internal server error occurred. Retry your request.
-
ResourceNotFoundException–The specified resource Amazon Resource Name (ARN) was not found. Check the Amazon Resource Name (ARN) and try your request again.
-
ServiceQuotaExceededException–The number of requests exceeds the service quota. Resubmit your request later.
-
ThrottlingException–The number of requests exceeds the limit. Resubmit your request later.
-
ValidationException–Input validation failed. Check your request parameters and retry the request.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_bedrock/_services/async_bedrock.py
7016 7017 7018 7019 7020 7021 7022 7023 7024 7025 7026 7027 7028 7029 7030 7031 7032 7033 7034 7035 7036 7037 7038 7039 7040 7041 7042 7043 7044 7045 7046 7047 7048 7049 7050 7051 7052 7053 7054 7055 7056 7057 7058 7059 7060 7061 7062 7063 7064 7065 7066 7067 7068 7069 7070 7071 7072 7073 7074 7075 7076 7077 7078 7079 7080 7081 7082 7083 7084 7085 7086 7087 7088 7089 7090 7091 7092 7093 7094 7095 7096 7097 7098 7099 7100 7101 7102 7103 7104 7105 | |