/AWS1/IF_BDK=>CREATEPROMPTROUTER()¶
About CreatePromptRouter¶
Creates a prompt router that manages the routing of requests between multiple foundation models based on the routing criteria.
Method Signature¶
METHODS /AWS1/IF_BDK~CREATEPROMPTROUTER
IMPORTING
!IV_CLIENTREQUESTTOKEN TYPE /AWS1/BDKIDEMPOTENCYTOKEN OPTIONAL
!IV_PROMPTROUTERNAME TYPE /AWS1/BDKPROMPTROUTERNAME OPTIONAL
!IT_MODELS TYPE /AWS1/CL_BDKPROMPTROUTERTGTM00=>TT_PROMPTROUTERTARGETMODELS OPTIONAL
!IV_DESCRIPTION TYPE /AWS1/BDKPROMPTROUTERDESC OPTIONAL
!IO_ROUTINGCRITERIA TYPE REF TO /AWS1/CL_BDKROUTINGCRITERIA OPTIONAL
!IO_FALLBACKMODEL TYPE REF TO /AWS1/CL_BDKPROMPTROUTERTGTM00 OPTIONAL
!IT_TAGS TYPE /AWS1/CL_BDKTAG=>TT_TAGLIST OPTIONAL
RETURNING
VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_bdkcrepromptrouterrsp
RAISING
/AWS1/CX_BDKACCESSDENIEDEX
/AWS1/CX_BDKCONFLICTEXCEPTION
/AWS1/CX_BDKINTERNALSERVEREX
/AWS1/CX_BDKRESOURCENOTFOUNDEX
/AWS1/CX_BDKSERVICEQUOTAEXCDEX
/AWS1/CX_BDKTHROTTLINGEX
/AWS1/CX_BDKTOOMANYTAGSEX
/AWS1/CX_BDKVALIDATIONEX
/AWS1/CX_BDKCLIENTEXC
/AWS1/CX_BDKSERVEREXC
/AWS1/CX_RT_TECHNICAL_GENERIC
/AWS1/CX_RT_SERVICE_GENERIC.
IMPORTING¶
Required arguments:¶
iv_promptroutername TYPE /AWS1/BDKPROMPTROUTERNAME /AWS1/BDKPROMPTROUTERNAME¶
The name of the prompt router. The name must be unique within your Amazon Web Services account in the current region.
it_models TYPE /AWS1/CL_BDKPROMPTROUTERTGTM00=>TT_PROMPTROUTERTARGETMODELS TT_PROMPTROUTERTARGETMODELS¶
A list of foundation models that the prompt router can route requests to. At least one model must be specified.
io_routingcriteria TYPE REF TO /AWS1/CL_BDKROUTINGCRITERIA /AWS1/CL_BDKROUTINGCRITERIA¶
The criteria, which is the response quality difference, used to determine how incoming requests are routed to different models.
io_fallbackmodel TYPE REF TO /AWS1/CL_BDKPROMPTROUTERTGTM00 /AWS1/CL_BDKPROMPTROUTERTGTM00¶
The default model to use when the routing criteria is not met.
Optional arguments:¶
iv_clientrequesttoken TYPE /AWS1/BDKIDEMPOTENCYTOKEN /AWS1/BDKIDEMPOTENCYTOKEN¶
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.
iv_description TYPE /AWS1/BDKPROMPTROUTERDESC /AWS1/BDKPROMPTROUTERDESC¶
An optional description of the prompt router to help identify its purpose.
it_tags TYPE /AWS1/CL_BDKTAG=>TT_TAGLIST TT_TAGLIST¶
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.
RETURNING¶
oo_output TYPE REF TO /aws1/cl_bdkcrepromptrouterrsp /AWS1/CL_BDKCREPROMPTROUTERRSP¶
Domain /AWS1/RT_ACCOUNT_ID Primitive Type NUMC
Examples¶
Syntax Example¶
This is an example of the syntax for calling the method. It includes every possible argument and initializes every possible value. The data provided is not necessarily semantically accurate (for example the value "string" may be provided for something that is intended to be an instance ID, or in some cases two arguments may be mutually exclusive). The syntax shows the ABAP syntax for creating the various data structures.
DATA(lo_result) = lo_client->createpromptrouter(
io_fallbackmodel = new /aws1/cl_bdkpromptroutertgtm00( |string| )
io_routingcriteria = new /aws1/cl_bdkroutingcriteria( '0.1' )
it_models = VALUE /aws1/cl_bdkpromptroutertgtm00=>tt_promptroutertargetmodels(
( new /aws1/cl_bdkpromptroutertgtm00( |string| ) )
)
it_tags = VALUE /aws1/cl_bdktag=>tt_taglist(
(
new /aws1/cl_bdktag(
iv_key = |string|
iv_value = |string|
)
)
)
iv_clientrequesttoken = |string|
iv_description = |string|
iv_promptroutername = |string|
).
This is an example of reading all possible response values
lo_result = lo_result.
IF lo_result IS NOT INITIAL.
lv_promptrouterarn = lo_result->get_promptrouterarn( ).
ENDIF.