Skip to content

Bedrock  >  Operations  >  create_prompt_router

create_prompt_router

Operation

create_prompt_router async

create_prompt_router(input: CreatePromptRouterInput, plugins: list[Plugin] | None = None) -> CreatePromptRouterOutput

Creates a prompt router that manages the routing of requests between multiple foundation models based on the routing criteria.

Parameters:

Name Type Description Default
input CreatePromptRouterInput

An instance of CreatePromptRouterInput.

required
plugins list[Plugin] | None

A list of callables that modify the configuration dynamically. Changes made by these plugins only apply for the duration of the operation execution and will not affect any other operation invocations.

None

Returns:

Type Description
CreatePromptRouterOutput

An instance of CreatePromptRouterOutput.

Input

CreatePromptRouterInput dataclass

Dataclass for CreatePromptRouterInput structure.

Attributes

client_request_token class-attribute instance-attribute
client_request_token: str | None = 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.

description class-attribute instance-attribute
description: str | None = field(repr=False, default=None)

An optional description of the prompt router to help identify its purpose.

fallback_model class-attribute instance-attribute
fallback_model: PromptRouterTargetModel | None = None

The default model to use when the routing criteria is not met.

models class-attribute instance-attribute
models: list[PromptRouterTargetModel] | None = None

A list of foundation models that the prompt router can route requests to. At least one model must be specified.

prompt_router_name class-attribute instance-attribute
prompt_router_name: str | None = None

The name of the prompt router. The name must be unique within your Amazon Web Services account in the current region.

routing_criteria class-attribute instance-attribute
routing_criteria: RoutingCriteria | None = None

The criteria, which is the response quality difference, used to determine how incoming requests are routed to different models.

tags class-attribute instance-attribute
tags: list[Tag] | None = 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.

Output

CreatePromptRouterOutput dataclass

Dataclass for CreatePromptRouterOutput structure.

Attributes

prompt_router_arn class-attribute instance-attribute
prompt_router_arn: str | None = None

The Amazon Resource Name (ARN) that uniquely identifies the prompt router.