create_model_invocation_job
¶
create_model_invocation_job(
job_name: ModelInvocationJobName,
role_arn: RoleArn,
model_id: ModelId,
input_data_config: ModelInvocationJobInputDataConfig,
output_data_config: ModelInvocationJobOutputDataConfig,
*,
config_overrides: Optional[BedrockClientConfig] = 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/bedrock.py
6351 6352 6353 6354 6355 6356 6357 6358 6359 6360 6361 6362 6363 6364 6365 6366 6367 6368 6369 6370 6371 6372 6373 6374 6375 6376 6377 6378 6379 6380 6381 6382 6383 6384 6385 6386 6387 6388 6389 6390 6391 6392 6393 6394 6395 6396 6397 6398 6399 6400 6401 6402 6403 6404 6405 6406 6407 6408 6409 6410 6411 6412 6413 6414 6415 6416 6417 6418 6419 6420 6421 6422 6423 6424 6425 6426 6427 6428 6429 6430 6431 6432 6433 6434 6435 6436 6437 6438 6439 | |