create_prompt_router
¶
create_prompt_router(
prompt_router_name: PromptRouterName,
models: PromptRouterTargetModels,
routing_criteria: RoutingCriteria,
fallback_model: PromptRouterTargetModel,
*,
config_overrides: Optional[BedrockClientConfig] = None,
client_request_token: Optional[IdempotencyToken] = None,
description: Optional[PromptRouterDescription] = None,
tags: Optional[TagList] = None,
) -> CreatePromptRouterResponse
Creates a prompt router that manages the routing of requests between multiple foundation models based on the routing criteria.
Parameters:
-
client_request_token(Optional[IdempotencyToken], default:None) –A unique, case-sensitive identifier that you provide to ensure idempotency of your requests. If not specified, the Amazon Web Services SDK automatically generates one for you.
-
prompt_router_name(PromptRouterName) –The name of the prompt router. The name must be unique within your Amazon Web Services account in the current region.
-
models(PromptRouterTargetModels) –A list of foundation models that the prompt router can route requests to. At least one model must be specified.
-
description(Optional[PromptRouterDescription], default:None) –An optional description of the prompt router to help identify its purpose.
-
routing_criteria(RoutingCriteria) –The criteria, which is the response quality difference, used to determine how incoming requests are routed to different models.
-
fallback_model(PromptRouterTargetModel) –The default model to use when the routing criteria is not met.
-
tags(Optional[TagList], default:None) –An array of key-value pairs to apply to this resource as tags. You can use tags to categorize and manage your Amazon Web Services resources.
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.
-
TooManyTagsException–The request contains more tags than can be associated with a resource (50 tags per resource). The maximum number of tags includes both existing tags and those included in your current request.
-
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
7762 7763 7764 7765 7766 7767 7768 7769 7770 7771 7772 7773 7774 7775 7776 7777 7778 7779 7780 7781 7782 7783 7784 7785 7786 7787 7788 7789 7790 7791 7792 7793 7794 7795 7796 7797 7798 7799 7800 7801 7802 7803 7804 7805 7806 7807 7808 7809 7810 7811 7812 7813 7814 7815 7816 7817 7818 7819 7820 7821 7822 7823 7824 7825 7826 7827 7828 7829 7830 7831 7832 7833 7834 7835 7836 7837 7838 7839 7840 7841 7842 7843 7844 7845 7846 7847 7848 | |