create_prompt_router¶
Operation¶
create_prompt_router
¶
create_prompt_router(request: CreatePromptRouterInput | CreatePromptRouterInputDict | None = None, /, *, plugins: list[Plugin] | None = None, **kwargs: Unpack[CreatePromptRouterInputDict]) -> 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 |
|---|---|---|---|
request
|
CreatePromptRouterInput | CreatePromptRouterInputDict | None
|
The input as a model or dictionary. Pass this or keyword arguments, not both. |
None
|
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
|
**kwargs
|
Unpack[CreatePromptRouterInputDict]
|
The input fields as keyword arguments. |
{}
|
Returns:
| Type | Description |
|---|---|
CreatePromptRouterOutput
|
An instance of |
create_prompt_router
async
¶
create_prompt_router(request: CreatePromptRouterInput | CreatePromptRouterInputDict | None = None, /, *, plugins: list[Plugin] | None = None, **kwargs: Unpack[CreatePromptRouterInputDict]) -> 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 |
|---|---|---|---|
request
|
CreatePromptRouterInput | CreatePromptRouterInputDict | None
|
The input as a model or dictionary. Pass this or keyword arguments, not both. |
None
|
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
|
**kwargs
|
Unpack[CreatePromptRouterInputDict]
|
The input fields as keyword arguments. |
{}
|
Returns:
| Type | Description |
|---|---|
CreatePromptRouterOutput
|
An instance of |
Input¶
Pass the input as keyword arguments, a positional dictionary, or a positional model object. Pass plugins separately as a keyword argument.
CreatePromptRouterInputDict
¶
Bases: TypedDict
Dictionary form of CreatePromptRouterInput.
Attributes¶
client_request_token
instance-attribute
¶
client_request_token: str | 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.
This field is autopopulated if not provided.
description
instance-attribute
¶
description: str | None
An optional description of the prompt router to help identify its purpose.
fallback_model
instance-attribute
¶
fallback_model: Required[PromptRouterTargetModel | PromptRouterTargetModelDict]
The default model to use when the routing criteria is not met.
models
instance-attribute
¶
A list of foundation models that the prompt router can route requests to. At least one model must be specified.
prompt_router_name
instance-attribute
¶
The name of the prompt router. The name must be unique within your Amazon Web Services account in the current region.
routing_criteria
instance-attribute
¶
routing_criteria: Required[RoutingCriteria | RoutingCriteriaDict]
The criteria, which is the response quality difference, used to determine how incoming requests are routed to different models.
CreatePromptRouterInput
dataclass
¶
Bases: _SerdeShape
Dataclass for CreatePromptRouterInput structure.
Attributes¶
client_request_token
class-attribute
instance-attribute
¶
client_request_token: str | 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.
This field is autopopulated if not provided.
description
class-attribute
instance-attribute
¶
description: str | None = ...
An optional description of the prompt router to help identify its purpose.
fallback_model
class-attribute
instance-attribute
¶
fallback_model: PromptRouterTargetModel | None = ...
The default model to use when the routing criteria is not met.
models
class-attribute
instance-attribute
¶
models: list[PromptRouterTargetModel] | 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 = ...
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 = ...
The criteria, which is the response quality difference, used to determine how incoming requests are routed to different models.
Output¶
CreatePromptRouterOutput
dataclass
¶
Bases: _SerdeShape
Dataclass for CreatePromptRouterOutput structure.
Attributes¶
prompt_router_arn
class-attribute
instance-attribute
¶
prompt_router_arn: str | None = ...
The Amazon Resource Name (ARN) that uniquely identifies the prompt router.
response_metadata
class-attribute
instance-attribute
¶
Metadata about the response that produced this output. Use this to recover the request identifiers a service's support team needs in order to investigate a call. Members of the metadata are individually optional.