/AWS1/IF_BDZ=>INVOKEINLINEAGENT()¶
About InvokeInlineAgent¶
Invokes an inline Amazon Bedrock agent using the configurations you provide with the request.
-
Specify the following fields for security purposes.
-
(Optional)
customerEncryptionKeyArn– The Amazon Resource Name (ARN) of a KMS key to encrypt the creation of the agent. -
(Optional)
idleSessionTTLinSeconds– Specify the number of seconds for which the agent should maintain session information. After this time expires, the subsequentInvokeInlineAgentrequest begins a new session.
-
-
To override the default prompt behavior for agent orchestration and to use advanced prompts, include a
promptOverrideConfigurationobject. For more information, see Advanced prompts. -
The agent instructions will not be honored if your agent has only one knowledge base, uses default prompts, has no action group, and user input is disabled.
Method Signature¶
METHODS /AWS1/IF_BDZ~INVOKEINLINEAGENT
IMPORTING
!IV_CUSTOMERENCRYPTIONKEYARN TYPE /AWS1/BDZKMSKEYARN OPTIONAL
!IV_FOUNDATIONMODEL TYPE /AWS1/BDZMODELIDENTIFIER OPTIONAL
!IV_INSTRUCTION TYPE /AWS1/BDZINSTRUCTION OPTIONAL
!IV_IDLESESSIONTTLINSECONDS TYPE /AWS1/BDZSESSIONTTL OPTIONAL
!IT_ACTIONGROUPS TYPE /AWS1/CL_BDZAGENTACTIONGROUP=>TT_AGENTACTIONGROUPS OPTIONAL
!IT_KNOWLEDGEBASES TYPE /AWS1/CL_BDZKNOWLEDGEBASE=>TT_KNOWLEDGEBASES OPTIONAL
!IO_GUARDRAILCONFIGURATION TYPE REF TO /AWS1/CL_BDZGUARDRAILCONFWARN OPTIONAL
!IO_PROMPTOVERRIDECONF TYPE REF TO /AWS1/CL_BDZPROMPTOVERRIDECONF OPTIONAL
!IV_AGENTCOLLABORATION TYPE /AWS1/BDZAGENTCOLLABORATION OPTIONAL
!IT_COLLABORATORCONFS TYPE /AWS1/CL_BDZCOLLABORATORCONF=>TT_COLLABORATORCONFIGURATIONS OPTIONAL
!IV_AGENTNAME TYPE /AWS1/BDZNAME OPTIONAL
!IV_SESSIONID TYPE /AWS1/BDZSESSIONID OPTIONAL
!IV_ENDSESSION TYPE /AWS1/BDZBOOLEAN OPTIONAL
!IV_ENABLETRACE TYPE /AWS1/BDZBOOLEAN OPTIONAL
!IV_INPUTTEXT TYPE /AWS1/BDZINPUTTEXT OPTIONAL
!IO_STREAMINGCONFIGURATIONS TYPE REF TO /AWS1/CL_BDZSTREAMINGCONFS OPTIONAL
!IO_PROMPTCREATIONCONFS TYPE REF TO /AWS1/CL_BDZPRMPTCREATIONCONFS OPTIONAL
!IO_INLINESESSIONSTATE TYPE REF TO /AWS1/CL_BDZINLINESESSIONSTATE OPTIONAL
!IT_COLLABORATORS TYPE /AWS1/CL_BDZCOLLABORATOR=>TT_COLLABORATORS OPTIONAL
!IO_BEDROCKMODELCONFS TYPE REF TO /AWS1/CL_BDZINLINEBEDROCKMDE00 OPTIONAL
!IV_ORCHESTRATIONTYPE TYPE /AWS1/BDZORCHESTRATIONTYPE OPTIONAL
!IO_CUSTOMORCHESTRATION TYPE REF TO /AWS1/CL_BDZCUSTORCHESTRATION OPTIONAL
RETURNING
VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_bdzinvkinlineagentrsp
RAISING
/AWS1/CX_BDZACCESSDENIEDEX
/AWS1/CX_BDZBADGATEWAYEX
/AWS1/CX_BDZCONFLICTEXCEPTION
/AWS1/CX_BDZDEPENDENCYFAILEDEX
/AWS1/CX_BDZINTERNALSERVEREX
/AWS1/CX_BDZRESOURCENOTFOUNDEX
/AWS1/CX_BDZSERVICEQUOTAEXCDEX
/AWS1/CX_BDZTHROTTLINGEX
/AWS1/CX_BDZVALIDATIONEX
/AWS1/CX_BDZCLIENTEXC
/AWS1/CX_BDZSERVEREXC
/AWS1/CX_RT_TECHNICAL_GENERIC
/AWS1/CX_RT_SERVICE_GENERIC.
IMPORTING¶
Required arguments:¶
iv_foundationmodel TYPE /AWS1/BDZMODELIDENTIFIER /AWS1/BDZMODELIDENTIFIER¶
The model identifier (ID) of the model to use for orchestration by the inline agent. For example,
meta.llama3-1-70b-instruct-v1:0.
iv_instruction TYPE /AWS1/BDZINSTRUCTION /AWS1/BDZINSTRUCTION¶
The instructions that tell the inline agent what it should do and how it should interact with users.
iv_sessionid TYPE /AWS1/BDZSESSIONID /AWS1/BDZSESSIONID¶
The unique identifier of the session. Use the same value across requests to continue the same conversation.
Optional arguments:¶
iv_customerencryptionkeyarn TYPE /AWS1/BDZKMSKEYARN /AWS1/BDZKMSKEYARN¶
The Amazon Resource Name (ARN) of the Amazon Web Services KMS key to use to encrypt your inline agent.
iv_idlesessionttlinseconds TYPE /AWS1/BDZSESSIONTTL /AWS1/BDZSESSIONTTL¶
The number of seconds for which the inline agent should maintain session information. After this time expires, the subsequent
InvokeInlineAgentrequest begins a new session.A user interaction remains active for the amount of time specified. If no conversation occurs during this time, the session expires and the data provided before the timeout is deleted.
it_actiongroups TYPE /AWS1/CL_BDZAGENTACTIONGROUP=>TT_AGENTACTIONGROUPS TT_AGENTACTIONGROUPS¶
A list of action groups with each action group defining the action the inline agent needs to carry out.
it_knowledgebases TYPE /AWS1/CL_BDZKNOWLEDGEBASE=>TT_KNOWLEDGEBASES TT_KNOWLEDGEBASES¶
Contains information of the knowledge bases to associate with.
io_guardrailconfiguration TYPE REF TO /AWS1/CL_BDZGUARDRAILCONFWARN /AWS1/CL_BDZGUARDRAILCONFWARN¶
The guardrails to assign to the inline agent.
io_promptoverrideconf TYPE REF TO /AWS1/CL_BDZPROMPTOVERRIDECONF /AWS1/CL_BDZPROMPTOVERRIDECONF¶
Configurations for advanced prompts used to override the default prompts to enhance the accuracy of the inline agent.
iv_agentcollaboration TYPE /AWS1/BDZAGENTCOLLABORATION /AWS1/BDZAGENTCOLLABORATION¶
Defines how the inline collaborator agent handles information across multiple collaborator agents to coordinate a final response. The inline collaborator agent can also be the supervisor.
it_collaboratorconfs TYPE /AWS1/CL_BDZCOLLABORATORCONF=>TT_COLLABORATORCONFIGURATIONS TT_COLLABORATORCONFIGURATIONS¶
Settings for an inline agent collaborator called with InvokeInlineAgent.
iv_agentname TYPE /AWS1/BDZNAME /AWS1/BDZNAME¶
The name for the agent.
iv_endsession TYPE /AWS1/BDZBOOLEAN /AWS1/BDZBOOLEAN¶
Specifies whether to end the session with the inline agent or not.
iv_enabletrace TYPE /AWS1/BDZBOOLEAN /AWS1/BDZBOOLEAN¶
Specifies whether to turn on the trace or not to track the agent's reasoning process. For more information, see Using trace.
iv_inputtext TYPE /AWS1/BDZINPUTTEXT /AWS1/BDZINPUTTEXT¶
The prompt text to send to the agent.
If you include
returnControlInvocationResultsin thesessionStatefield, theinputTextfield will be ignored.
io_streamingconfigurations TYPE REF TO /AWS1/CL_BDZSTREAMINGCONFS /AWS1/CL_BDZSTREAMINGCONFS¶
Specifies the configurations for streaming.
To use agent streaming, you need permissions to perform the
bedrock:InvokeModelWithResponseStreamaction.
io_promptcreationconfs TYPE REF TO /AWS1/CL_BDZPRMPTCREATIONCONFS /AWS1/CL_BDZPRMPTCREATIONCONFS¶
Specifies parameters that control how the service populates the agent prompt for an
InvokeInlineAgentrequest. You can control which aspects of previous invocations in the same agent session the service uses to populate the agent prompt. This gives you more granular control over the contextual history that is used to process the current request.
io_inlinesessionstate TYPE REF TO /AWS1/CL_BDZINLINESESSIONSTATE /AWS1/CL_BDZINLINESESSIONSTATE¶
Parameters that specify the various attributes of a sessions. You can include attributes for the session or prompt or, if you configured an action group to return control, results from invocation of the action group. For more information, see Control session context.
If you include
returnControlInvocationResultsin thesessionStatefield, theinputTextfield will be ignored.
it_collaborators TYPE /AWS1/CL_BDZCOLLABORATOR=>TT_COLLABORATORS TT_COLLABORATORS¶
List of collaborator inline agents.
io_bedrockmodelconfs TYPE REF TO /AWS1/CL_BDZINLINEBEDROCKMDE00 /AWS1/CL_BDZINLINEBEDROCKMDE00¶
Model settings for the request.
iv_orchestrationtype TYPE /AWS1/BDZORCHESTRATIONTYPE /AWS1/BDZORCHESTRATIONTYPE¶
Specifies the type of orchestration strategy for the agent. This is set to DEFAULT orchestration type, by default.
io_customorchestration TYPE REF TO /AWS1/CL_BDZCUSTORCHESTRATION /AWS1/CL_BDZCUSTORCHESTRATION¶
Contains details of the custom orchestration configured for the agent.
RETURNING¶
oo_output TYPE REF TO /aws1/cl_bdzinvkinlineagentrsp /AWS1/CL_BDZINVKINLINEAGENTRSP¶
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->invokeinlineagent(
io_bedrockmodelconfs = new /aws1/cl_bdzinlinebedrockmde00( new /aws1/cl_bdzperformanceconf( |string| ) )
io_customorchestration = new /aws1/cl_bdzcustorchestration( new /aws1/cl_bdzorchestrationexe00( |string| ) )
io_guardrailconfiguration = new /aws1/cl_bdzguardrailconfwarn(
iv_guardrailidentifier = |string|
iv_guardrailversion = |string|
)
io_inlinesessionstate = new /aws1/cl_bdzinlinesessionstate(
io_conversationhistory = new /aws1/cl_bdzconversationhist00(
it_messages = VALUE /aws1/cl_bdzmessage=>tt_messages(
(
new /aws1/cl_bdzmessage(
it_content = VALUE /aws1/cl_bdzcontentblock=>tt_contentblocks(
( new /aws1/cl_bdzcontentblock( |string| ) )
)
iv_role = |string|
)
)
)
)
it_files = VALUE /aws1/cl_bdzinputfile=>tt_inputfiles(
(
new /aws1/cl_bdzinputfile(
io_source = new /aws1/cl_bdzfilesource(
io_bytecontent = new /aws1/cl_bdzbytecontentfile(
iv_data = '5347567362473873563239796247513D'
iv_mediatype = |string|
)
io_s3location = new /aws1/cl_bdzs3objectfile( |string| )
iv_sourcetype = |string|
)
iv_name = |string|
iv_usecase = |string|
)
)
)
it_promptsessionattributes = VALUE /aws1/cl_bdzpromptsessattrsm00=>tt_promptsessionattributesmap(
(
VALUE /aws1/cl_bdzpromptsessattrsm00=>ts_promptsessattrsmap_maprow(
key = |string|
value = new /aws1/cl_bdzpromptsessattrsm00( |string| )
)
)
)
it_returncontrolinvcresults = VALUE /aws1/cl_bdzinvcresultmember=>tt_returncontrolinvcresults(
(
new /aws1/cl_bdzinvcresultmember(
io_apiresult = new /aws1/cl_bdzapiresult(
it_responsebody = VALUE /aws1/cl_bdzcontentbody=>tt_responsebody(
(
VALUE /aws1/cl_bdzcontentbody=>ts_responsebody_maprow(
key = |string|
value = new /aws1/cl_bdzcontentbody(
it_images = VALUE /aws1/cl_bdzimageinput=>tt_imageinputs(
(
new /aws1/cl_bdzimageinput(
io_source = new /aws1/cl_bdzimageinputsource( '5347567362473873563239796247513D' )
iv_format = |string|
)
)
)
iv_body = |string|
)
)
)
)
iv_actiongroup = |string|
iv_agentid = |string|
iv_apipath = |string|
iv_confirmationstate = |string|
iv_httpmethod = |string|
iv_httpstatuscode = 123
iv_responsestate = |string|
)
io_functionresult = new /aws1/cl_bdzfunctionresult(
it_responsebody = VALUE /aws1/cl_bdzcontentbody=>tt_responsebody(
(
VALUE /aws1/cl_bdzcontentbody=>ts_responsebody_maprow(
key = |string|
value = new /aws1/cl_bdzcontentbody(
it_images = VALUE /aws1/cl_bdzimageinput=>tt_imageinputs(
(
new /aws1/cl_bdzimageinput(
io_source = new /aws1/cl_bdzimageinputsource( '5347567362473873563239796247513D' )
iv_format = |string|
)
)
)
iv_body = |string|
)
)
)
)
iv_actiongroup = |string|
iv_agentid = |string|
iv_confirmationstate = |string|
iv_function = |string|
iv_responsestate = |string|
)
)
)
)
it_sessionattributes = VALUE /aws1/cl_bdzsessionattrsmap_w=>tt_sessionattributesmap(
(
VALUE /aws1/cl_bdzsessionattrsmap_w=>ts_sessionattributesmap_maprow(
value = new /aws1/cl_bdzsessionattrsmap_w( |string| )
key = |string|
)
)
)
iv_invocationid = |string|
)
io_promptcreationconfs = new /aws1/cl_bdzprmptcreationconfs(
iv_excludepreviousthinking00 = ABAP_TRUE
iv_previousconversationtur00 = 123
)
io_promptoverrideconf = new /aws1/cl_bdzpromptoverrideconf(
it_promptconfigurations = VALUE /aws1/cl_bdzpromptconf=>tt_promptconfigurations(
(
new /aws1/cl_bdzpromptconf(
io_addlmodelrequestfields = /AWS1/CL_RT_DOCUMENT=>FROM_JSON_STR( |\{"foo":"this is a JSON object..."\}| )
io_inferenceconfiguration = new /aws1/cl_bdzinferenceconf(
it_stopsequences = VALUE /aws1/cl_bdzstopsequences_w=>tt_stopsequences(
( new /aws1/cl_bdzstopsequences_w( |string| ) )
)
iv_maximumlength = 123
iv_temperature = '0.1'
iv_topk = 123
iv_topp = '0.1'
)
iv_baseprompttemplate = |string|
iv_foundationmodel = |string|
iv_parsermode = |string|
iv_promptcreationmode = |string|
iv_promptstate = |string|
iv_prompttype = |string|
)
)
)
iv_overridelambda = |string|
)
io_streamingconfigurations = new /aws1/cl_bdzstreamingconfs(
iv_applyguardrailinterval = 123
iv_streamfinalresponse = ABAP_TRUE
)
it_actiongroups = VALUE /aws1/cl_bdzagentactiongroup=>tt_agentactiongroups(
(
new /aws1/cl_bdzagentactiongroup(
io_actiongroupexecutor = new /aws1/cl_bdzactgroupexecutor(
iv_customcontrol = |string|
iv_lambda = |string|
)
io_apischema = new /aws1/cl_bdzapischema(
io_s3 = new /aws1/cl_bdzs3identifier(
iv_s3bucketname = |string|
iv_s3objectkey = |string|
)
iv_payload = |string|
)
io_functionschema = new /aws1/cl_bdzfunctionschema(
it_functions = VALUE /aws1/cl_bdzfunctiondefinition=>tt_functions(
(
new /aws1/cl_bdzfunctiondefinition(
it_parameters = VALUE /aws1/cl_bdzparameterdetail=>tt_parametermap(
(
VALUE /aws1/cl_bdzparameterdetail=>ts_parametermap_maprow(
key = |string|
value = new /aws1/cl_bdzparameterdetail(
iv_description = |string|
iv_required = ABAP_TRUE
iv_type = |string|
)
)
)
)
iv_description = |string|
iv_name = |string|
iv_requireconfirmation = |string|
)
)
)
)
it_parentactgroupsigparams = VALUE /aws1/cl_bdzactgrpsigparams_w=>tt_actiongroupsignatureparams(
(
VALUE /aws1/cl_bdzactgrpsigparams_w=>ts_actiongroupsigparams_maprow(
value = new /aws1/cl_bdzactgrpsigparams_w( |string| )
key = |string|
)
)
)
iv_actiongroupname = |string|
iv_description = |string|
iv_parentactiongroupsig = |string|
)
)
)
it_collaboratorconfs = VALUE /aws1/cl_bdzcollaboratorconf=>tt_collaboratorconfigurations(
(
new /aws1/cl_bdzcollaboratorconf(
iv_agentaliasarn = |string|
iv_collaboratorinstruction = |string|
iv_collaboratorname = |string|
iv_relayconversationhistory = |string|
)
)
)
it_collaborators = VALUE /aws1/cl_bdzcollaborator=>tt_collaborators(
(
new /aws1/cl_bdzcollaborator(
io_guardrailconfiguration = new /aws1/cl_bdzguardrailconfwarn(
iv_guardrailidentifier = |string|
iv_guardrailversion = |string|
)
io_promptoverrideconf = new /aws1/cl_bdzpromptoverrideconf(
it_promptconfigurations = VALUE /aws1/cl_bdzpromptconf=>tt_promptconfigurations(
(
new /aws1/cl_bdzpromptconf(
io_addlmodelrequestfields = /AWS1/CL_RT_DOCUMENT=>FROM_JSON_STR( |\{"foo":"this is a JSON object..."\}| )
io_inferenceconfiguration = new /aws1/cl_bdzinferenceconf(
it_stopsequences = VALUE /aws1/cl_bdzstopsequences_w=>tt_stopsequences(
( new /aws1/cl_bdzstopsequences_w( |string| ) )
)
iv_maximumlength = 123
iv_temperature = '0.1'
iv_topk = 123
iv_topp = '0.1'
)
iv_baseprompttemplate = |string|
iv_foundationmodel = |string|
iv_parsermode = |string|
iv_promptcreationmode = |string|
iv_promptstate = |string|
iv_prompttype = |string|
)
)
)
iv_overridelambda = |string|
)
it_actiongroups = VALUE /aws1/cl_bdzagentactiongroup=>tt_agentactiongroups(
(
new /aws1/cl_bdzagentactiongroup(
io_actiongroupexecutor = new /aws1/cl_bdzactgroupexecutor(
iv_customcontrol = |string|
iv_lambda = |string|
)
io_apischema = new /aws1/cl_bdzapischema(
io_s3 = new /aws1/cl_bdzs3identifier(
iv_s3bucketname = |string|
iv_s3objectkey = |string|
)
iv_payload = |string|
)
io_functionschema = new /aws1/cl_bdzfunctionschema(
it_functions = VALUE /aws1/cl_bdzfunctiondefinition=>tt_functions(
(
new /aws1/cl_bdzfunctiondefinition(
it_parameters = VALUE /aws1/cl_bdzparameterdetail=>tt_parametermap(
(
VALUE /aws1/cl_bdzparameterdetail=>ts_parametermap_maprow(
key = |string|
value = new /aws1/cl_bdzparameterdetail(
iv_description = |string|
iv_required = ABAP_TRUE
iv_type = |string|
)
)
)
)
iv_description = |string|
iv_name = |string|
iv_requireconfirmation = |string|
)
)
)
)
it_parentactgroupsigparams = VALUE /aws1/cl_bdzactgrpsigparams_w=>tt_actiongroupsignatureparams(
(
VALUE /aws1/cl_bdzactgrpsigparams_w=>ts_actiongroupsigparams_maprow(
value = new /aws1/cl_bdzactgrpsigparams_w( |string| )
key = |string|
)
)
)
iv_actiongroupname = |string|
iv_description = |string|
iv_parentactiongroupsig = |string|
)
)
)
it_collaboratorconfs = VALUE /aws1/cl_bdzcollaboratorconf=>tt_collaboratorconfigurations(
(
new /aws1/cl_bdzcollaboratorconf(
iv_agentaliasarn = |string|
iv_collaboratorinstruction = |string|
iv_collaboratorname = |string|
iv_relayconversationhistory = |string|
)
)
)
it_knowledgebases = VALUE /aws1/cl_bdzknowledgebase=>tt_knowledgebases(
(
new /aws1/cl_bdzknowledgebase(
io_retrievalconfiguration = new /aws1/cl_bdzknowledgebaseret01(
io_vectorsearchconfiguration = new /aws1/cl_bdzknowledgebasevec00(
io_filter = new /aws1/cl_bdzretrievalfilter(
io_equals = new /aws1/cl_bdzfilterattribute(
io_value = /AWS1/CL_RT_DOCUMENT=>FROM_JSON_STR( |\{"foo":"this is a JSON object..."\}| )
iv_key = |string|
)
io_greaterthan = new /aws1/cl_bdzfilterattribute(
io_value = /AWS1/CL_RT_DOCUMENT=>FROM_JSON_STR( |\{"foo":"this is a JSON object..."\}| )
iv_key = |string|
)
io_greaterthanorequals = new /aws1/cl_bdzfilterattribute(
io_value = /AWS1/CL_RT_DOCUMENT=>FROM_JSON_STR( |\{"foo":"this is a JSON object..."\}| )
iv_key = |string|
)
io_in = new /aws1/cl_bdzfilterattribute(
io_value = /AWS1/CL_RT_DOCUMENT=>FROM_JSON_STR( |\{"foo":"this is a JSON object..."\}| )
iv_key = |string|
)
io_lessthan = new /aws1/cl_bdzfilterattribute(
io_value = /AWS1/CL_RT_DOCUMENT=>FROM_JSON_STR( |\{"foo":"this is a JSON object..."\}| )
iv_key = |string|
)
io_lessthanorequals = new /aws1/cl_bdzfilterattribute(
io_value = /AWS1/CL_RT_DOCUMENT=>FROM_JSON_STR( |\{"foo":"this is a JSON object..."\}| )
iv_key = |string|
)
io_listcontains = new /aws1/cl_bdzfilterattribute(
io_value = /AWS1/CL_RT_DOCUMENT=>FROM_JSON_STR( |\{"foo":"this is a JSON object..."\}| )
iv_key = |string|
)
io_notequals = new /aws1/cl_bdzfilterattribute(
io_value = /AWS1/CL_RT_DOCUMENT=>FROM_JSON_STR( |\{"foo":"this is a JSON object..."\}| )
iv_key = |string|
)
io_notin = new /aws1/cl_bdzfilterattribute(
io_value = /AWS1/CL_RT_DOCUMENT=>FROM_JSON_STR( |\{"foo":"this is a JSON object..."\}| )
iv_key = |string|
)
io_startswith = new /aws1/cl_bdzfilterattribute(
io_value = /AWS1/CL_RT_DOCUMENT=>FROM_JSON_STR( |\{"foo":"this is a JSON object..."\}| )
iv_key = |string|
)
io_stringcontains = new /aws1/cl_bdzfilterattribute(
io_value = /AWS1/CL_RT_DOCUMENT=>FROM_JSON_STR( |\{"foo":"this is a JSON object..."\}| )
iv_key = |string|
)
it_andall = VALUE /aws1/cl_bdzretrievalfilter=>tt_retrievalfilterlist(
(
new /aws1/cl_bdzretrievalfilter(
io_equals = new /aws1/cl_bdzfilterattribute(
io_value = /AWS1/CL_RT_DOCUMENT=>FROM_JSON_STR( |\{"foo":"this is a JSON object..."\}| )
iv_key = |string|
)
io_greaterthan = new /aws1/cl_bdzfilterattribute(
io_value = /AWS1/CL_RT_DOCUMENT=>FROM_JSON_STR( |\{"foo":"this is a JSON object..."\}| )
iv_key = |string|
)
io_greaterthanorequals = new /aws1/cl_bdzfilterattribute(
io_value = /AWS1/CL_RT_DOCUMENT=>FROM_JSON_STR( |\{"foo":"this is a JSON object..."\}| )
iv_key = |string|
)
io_in = new /aws1/cl_bdzfilterattribute(
io_value = /AWS1/CL_RT_DOCUMENT=>FROM_JSON_STR( |\{"foo":"this is a JSON object..."\}| )
iv_key = |string|
)
io_lessthan = new /aws1/cl_bdzfilterattribute(
io_value = /AWS1/CL_RT_DOCUMENT=>FROM_JSON_STR( |\{"foo":"this is a JSON object..."\}| )
iv_key = |string|
)
io_lessthanorequals = new /aws1/cl_bdzfilterattribute(
io_value = /AWS1/CL_RT_DOCUMENT=>FROM_JSON_STR( |\{"foo":"this is a JSON object..."\}| )
iv_key = |string|
)
io_listcontains = new /aws1/cl_bdzfilterattribute(
io_value = /AWS1/CL_RT_DOCUMENT=>FROM_JSON_STR( |\{"foo":"this is a JSON object..."\}| )
iv_key = |string|
)
io_notequals = new /aws1/cl_bdzfilterattribute(
io_value = /AWS1/CL_RT_DOCUMENT=>FROM_JSON_STR( |\{"foo":"this is a JSON object..."\}| )
iv_key = |string|
)
io_notin = new /aws1/cl_bdzfilterattribute(
io_value = /AWS1/CL_RT_DOCUMENT=>FROM_JSON_STR( |\{"foo":"this is a JSON object..."\}| )
iv_key = |string|
)
io_startswith = new /aws1/cl_bdzfilterattribute(
io_value = /AWS1/CL_RT_DOCUMENT=>FROM_JSON_STR( |\{"foo":"this is a JSON object..."\}| )
iv_key = |string|
)
io_stringcontains = new /aws1/cl_bdzfilterattribute(
io_value = /AWS1/CL_RT_DOCUMENT=>FROM_JSON_STR( |\{"foo":"this is a JSON object..."\}| )
iv_key = |string|
)
it_orall = VALUE /aws1/cl_bdzretrievalfilter=>tt_retrievalfilterlist(
)
)
)
)
it_orall = VALUE /aws1/cl_bdzretrievalfilter=>tt_retrievalfilterlist(
(
new /aws1/cl_bdzretrievalfilter(
io_equals = new /aws1/cl_bdzfilterattribute(
io_value = /AWS1/CL_RT_DOCUMENT=>FROM_JSON_STR( |\{"foo":"this is a JSON object..."\}| )
iv_key = |string|
)
io_greaterthan = new /aws1/cl_bdzfilterattribute(
io_value = /AWS1/CL_RT_DOCUMENT=>FROM_JSON_STR( |\{"foo":"this is a JSON object..."\}| )
iv_key = |string|
)
io_greaterthanorequals = new /aws1/cl_bdzfilterattribute(
io_value = /AWS1/CL_RT_DOCUMENT=>FROM_JSON_STR( |\{"foo":"this is a JSON object..."\}| )
iv_key = |string|
)
io_in = new /aws1/cl_bdzfilterattribute(
io_value = /AWS1/CL_RT_DOCUMENT=>FROM_JSON_STR( |\{"foo":"this is a JSON object..."\}| )
iv_key = |string|
)
io_lessthan = new /aws1/cl_bdzfilterattribute(
io_value = /AWS1/CL_RT_DOCUMENT=>FROM_JSON_STR( |\{"foo":"this is a JSON object..."\}| )
iv_key = |string|
)
io_lessthanorequals = new /aws1/cl_bdzfilterattribute(
io_value = /AWS1/CL_RT_DOCUMENT=>FROM_JSON_STR( |\{"foo":"this is a JSON object..."\}| )
iv_key = |string|
)
io_listcontains = new /aws1/cl_bdzfilterattribute(
io_value = /AWS1/CL_RT_DOCUMENT=>FROM_JSON_STR( |\{"foo":"this is a JSON object..."\}| )
iv_key = |string|
)
io_notequals = new /aws1/cl_bdzfilterattribute(
io_value = /AWS1/CL_RT_DOCUMENT=>FROM_JSON_STR( |\{"foo":"this is a JSON object..."\}| )
iv_key = |string|
)
io_notin = new /aws1/cl_bdzfilterattribute(
io_value = /AWS1/CL_RT_DOCUMENT=>FROM_JSON_STR( |\{"foo":"this is a JSON object..."\}| )
iv_key = |string|
)
io_startswith = new /aws1/cl_bdzfilterattribute(
io_value = /AWS1/CL_RT_DOCUMENT=>FROM_JSON_STR( |\{"foo":"this is a JSON object..."\}| )
iv_key = |string|
)
io_stringcontains = new /aws1/cl_bdzfilterattribute(
io_value = /AWS1/CL_RT_DOCUMENT=>FROM_JSON_STR( |\{"foo":"this is a JSON object..."\}| )
iv_key = |string|
)
it_andall = VALUE /aws1/cl_bdzretrievalfilter=>tt_retrievalfilterlist(
)
)
)
)
)
io_implicitfilterconf = new /aws1/cl_bdzimplicitfilterconf(
it_metadataattributes = VALUE /aws1/cl_bdzmetadataattrschema=>tt_metadataattributeschemalist(
(
new /aws1/cl_bdzmetadataattrschema(
iv_description = |string|
iv_key = |string|
iv_type = |string|
)
)
)
iv_modelarn = |string|
)
io_rerankingconfiguration = new /aws1/cl_bdzvectorsrchrerank00(
io_bedrockrerankingconf = new /aws1/cl_bdzvectorsrchbedroc00(
io_metadataconfiguration = new /aws1/cl_bdzmetconfforrerank00(
io_selectivemodeconf = new /aws1/cl_bdzrerankingmetseli00(
it_fieldstoexclude = VALUE /aws1/cl_bdzfieldforreranking=>tt_fieldsforreranking(
( new /aws1/cl_bdzfieldforreranking( |string| ) )
)
it_fieldstoinclude = VALUE /aws1/cl_bdzfieldforreranking=>tt_fieldsforreranking(
( new /aws1/cl_bdzfieldforreranking( |string| ) )
)
)
iv_selectionmode = |string|
)
io_modelconfiguration = new /aws1/cl_bdzvectorsrchbedroc01(
it_addlmodelrequestfields = VALUE /aws1/cl_rt_document=>tt_map(
(
VALUE /aws1/cl_rt_document=>ts_document_maprow(
key = |string|
value = /AWS1/CL_RT_DOCUMENT=>FROM_JSON_STR( |\{"foo":"this is a JSON object..."\}| )
)
)
)
iv_modelarn = |string|
)
iv_numberofrerankedresults = 123
)
iv_type = |string|
)
iv_numberofresults = 123
iv_overridesearchtype = |string|
)
)
iv_description = |string|
iv_knowledgebaseid = |string|
)
)
)
iv_agentcollaboration = |string|
iv_agentname = |string|
iv_customerencryptionkeyarn = |string|
iv_foundationmodel = |string|
iv_idlesessionttlinseconds = 123
iv_instruction = |string|
)
)
)
it_knowledgebases = VALUE /aws1/cl_bdzknowledgebase=>tt_knowledgebases(
(
new /aws1/cl_bdzknowledgebase(
io_retrievalconfiguration = new /aws1/cl_bdzknowledgebaseret01(
io_vectorsearchconfiguration = new /aws1/cl_bdzknowledgebasevec00(
io_filter = new /aws1/cl_bdzretrievalfilter(
io_equals = new /aws1/cl_bdzfilterattribute(
io_value = /AWS1/CL_RT_DOCUMENT=>FROM_JSON_STR( |\{"foo":"this is a JSON object..."\}| )
iv_key = |string|
)
io_greaterthan = new /aws1/cl_bdzfilterattribute(
io_value = /AWS1/CL_RT_DOCUMENT=>FROM_JSON_STR( |\{"foo":"this is a JSON object..."\}| )
iv_key = |string|
)
io_greaterthanorequals = new /aws1/cl_bdzfilterattribute(
io_value = /AWS1/CL_RT_DOCUMENT=>FROM_JSON_STR( |\{"foo":"this is a JSON object..."\}| )
iv_key = |string|
)
io_in = new /aws1/cl_bdzfilterattribute(
io_value = /AWS1/CL_RT_DOCUMENT=>FROM_JSON_STR( |\{"foo":"this is a JSON object..."\}| )
iv_key = |string|
)
io_lessthan = new /aws1/cl_bdzfilterattribute(
io_value = /AWS1/CL_RT_DOCUMENT=>FROM_JSON_STR( |\{"foo":"this is a JSON object..."\}| )
iv_key = |string|
)
io_lessthanorequals = new /aws1/cl_bdzfilterattribute(
io_value = /AWS1/CL_RT_DOCUMENT=>FROM_JSON_STR( |\{"foo":"this is a JSON object..."\}| )
iv_key = |string|
)
io_listcontains = new /aws1/cl_bdzfilterattribute(
io_value = /AWS1/CL_RT_DOCUMENT=>FROM_JSON_STR( |\{"foo":"this is a JSON object..."\}| )
iv_key = |string|
)
io_notequals = new /aws1/cl_bdzfilterattribute(
io_value = /AWS1/CL_RT_DOCUMENT=>FROM_JSON_STR( |\{"foo":"this is a JSON object..."\}| )
iv_key = |string|
)
io_notin = new /aws1/cl_bdzfilterattribute(
io_value = /AWS1/CL_RT_DOCUMENT=>FROM_JSON_STR( |\{"foo":"this is a JSON object..."\}| )
iv_key = |string|
)
io_startswith = new /aws1/cl_bdzfilterattribute(
io_value = /AWS1/CL_RT_DOCUMENT=>FROM_JSON_STR( |\{"foo":"this is a JSON object..."\}| )
iv_key = |string|
)
io_stringcontains = new /aws1/cl_bdzfilterattribute(
io_value = /AWS1/CL_RT_DOCUMENT=>FROM_JSON_STR( |\{"foo":"this is a JSON object..."\}| )
iv_key = |string|
)
it_andall = VALUE /aws1/cl_bdzretrievalfilter=>tt_retrievalfilterlist(
(
new /aws1/cl_bdzretrievalfilter(
io_equals = new /aws1/cl_bdzfilterattribute(
io_value = /AWS1/CL_RT_DOCUMENT=>FROM_JSON_STR( |\{"foo":"this is a JSON object..."\}| )
iv_key = |string|
)
io_greaterthan = new /aws1/cl_bdzfilterattribute(
io_value = /AWS1/CL_RT_DOCUMENT=>FROM_JSON_STR( |\{"foo":"this is a JSON object..."\}| )
iv_key = |string|
)
io_greaterthanorequals = new /aws1/cl_bdzfilterattribute(
io_value = /AWS1/CL_RT_DOCUMENT=>FROM_JSON_STR( |\{"foo":"this is a JSON object..."\}| )
iv_key = |string|
)
io_in = new /aws1/cl_bdzfilterattribute(
io_value = /AWS1/CL_RT_DOCUMENT=>FROM_JSON_STR( |\{"foo":"this is a JSON object..."\}| )
iv_key = |string|
)
io_lessthan = new /aws1/cl_bdzfilterattribute(
io_value = /AWS1/CL_RT_DOCUMENT=>FROM_JSON_STR( |\{"foo":"this is a JSON object..."\}| )
iv_key = |string|
)
io_lessthanorequals = new /aws1/cl_bdzfilterattribute(
io_value = /AWS1/CL_RT_DOCUMENT=>FROM_JSON_STR( |\{"foo":"this is a JSON object..."\}| )
iv_key = |string|
)
io_listcontains = new /aws1/cl_bdzfilterattribute(
io_value = /AWS1/CL_RT_DOCUMENT=>FROM_JSON_STR( |\{"foo":"this is a JSON object..."\}| )
iv_key = |string|
)
io_notequals = new /aws1/cl_bdzfilterattribute(
io_value = /AWS1/CL_RT_DOCUMENT=>FROM_JSON_STR( |\{"foo":"this is a JSON object..."\}| )
iv_key = |string|
)
io_notin = new /aws1/cl_bdzfilterattribute(
io_value = /AWS1/CL_RT_DOCUMENT=>FROM_JSON_STR( |\{"foo":"this is a JSON object..."\}| )
iv_key = |string|
)
io_startswith = new /aws1/cl_bdzfilterattribute(
io_value = /AWS1/CL_RT_DOCUMENT=>FROM_JSON_STR( |\{"foo":"this is a JSON object..."\}| )
iv_key = |string|
)
io_stringcontains = new /aws1/cl_bdzfilterattribute(
io_value = /AWS1/CL_RT_DOCUMENT=>FROM_JSON_STR( |\{"foo":"this is a JSON object..."\}| )
iv_key = |string|
)
it_orall = VALUE /aws1/cl_bdzretrievalfilter=>tt_retrievalfilterlist(
)
)
)
)
it_orall = VALUE /aws1/cl_bdzretrievalfilter=>tt_retrievalfilterlist(
(
new /aws1/cl_bdzretrievalfilter(
io_equals = new /aws1/cl_bdzfilterattribute(
io_value = /AWS1/CL_RT_DOCUMENT=>FROM_JSON_STR( |\{"foo":"this is a JSON object..."\}| )
iv_key = |string|
)
io_greaterthan = new /aws1/cl_bdzfilterattribute(
io_value = /AWS1/CL_RT_DOCUMENT=>FROM_JSON_STR( |\{"foo":"this is a JSON object..."\}| )
iv_key = |string|
)
io_greaterthanorequals = new /aws1/cl_bdzfilterattribute(
io_value = /AWS1/CL_RT_DOCUMENT=>FROM_JSON_STR( |\{"foo":"this is a JSON object..."\}| )
iv_key = |string|
)
io_in = new /aws1/cl_bdzfilterattribute(
io_value = /AWS1/CL_RT_DOCUMENT=>FROM_JSON_STR( |\{"foo":"this is a JSON object..."\}| )
iv_key = |string|
)
io_lessthan = new /aws1/cl_bdzfilterattribute(
io_value = /AWS1/CL_RT_DOCUMENT=>FROM_JSON_STR( |\{"foo":"this is a JSON object..."\}| )
iv_key = |string|
)
io_lessthanorequals = new /aws1/cl_bdzfilterattribute(
io_value = /AWS1/CL_RT_DOCUMENT=>FROM_JSON_STR( |\{"foo":"this is a JSON object..."\}| )
iv_key = |string|
)
io_listcontains = new /aws1/cl_bdzfilterattribute(
io_value = /AWS1/CL_RT_DOCUMENT=>FROM_JSON_STR( |\{"foo":"this is a JSON object..."\}| )
iv_key = |string|
)
io_notequals = new /aws1/cl_bdzfilterattribute(
io_value = /AWS1/CL_RT_DOCUMENT=>FROM_JSON_STR( |\{"foo":"this is a JSON object..."\}| )
iv_key = |string|
)
io_notin = new /aws1/cl_bdzfilterattribute(
io_value = /AWS1/CL_RT_DOCUMENT=>FROM_JSON_STR( |\{"foo":"this is a JSON object..."\}| )
iv_key = |string|
)
io_startswith = new /aws1/cl_bdzfilterattribute(
io_value = /AWS1/CL_RT_DOCUMENT=>FROM_JSON_STR( |\{"foo":"this is a JSON object..."\}| )
iv_key = |string|
)
io_stringcontains = new /aws1/cl_bdzfilterattribute(
io_value = /AWS1/CL_RT_DOCUMENT=>FROM_JSON_STR( |\{"foo":"this is a JSON object..."\}| )
iv_key = |string|
)
it_andall = VALUE /aws1/cl_bdzretrievalfilter=>tt_retrievalfilterlist(
)
)
)
)
)
io_implicitfilterconf = new /aws1/cl_bdzimplicitfilterconf(
it_metadataattributes = VALUE /aws1/cl_bdzmetadataattrschema=>tt_metadataattributeschemalist(
(
new /aws1/cl_bdzmetadataattrschema(
iv_description = |string|
iv_key = |string|
iv_type = |string|
)
)
)
iv_modelarn = |string|
)
io_rerankingconfiguration = new /aws1/cl_bdzvectorsrchrerank00(
io_bedrockrerankingconf = new /aws1/cl_bdzvectorsrchbedroc00(
io_metadataconfiguration = new /aws1/cl_bdzmetconfforrerank00(
io_selectivemodeconf = new /aws1/cl_bdzrerankingmetseli00(
it_fieldstoexclude = VALUE /aws1/cl_bdzfieldforreranking=>tt_fieldsforreranking(
( new /aws1/cl_bdzfieldforreranking( |string| ) )
)
it_fieldstoinclude = VALUE /aws1/cl_bdzfieldforreranking=>tt_fieldsforreranking(
( new /aws1/cl_bdzfieldforreranking( |string| ) )
)
)
iv_selectionmode = |string|
)
io_modelconfiguration = new /aws1/cl_bdzvectorsrchbedroc01(
it_addlmodelrequestfields = VALUE /aws1/cl_rt_document=>tt_map(
(
VALUE /aws1/cl_rt_document=>ts_document_maprow(
key = |string|
value = /AWS1/CL_RT_DOCUMENT=>FROM_JSON_STR( |\{"foo":"this is a JSON object..."\}| )
)
)
)
iv_modelarn = |string|
)
iv_numberofrerankedresults = 123
)
iv_type = |string|
)
iv_numberofresults = 123
iv_overridesearchtype = |string|
)
)
iv_description = |string|
iv_knowledgebaseid = |string|
)
)
)
iv_agentcollaboration = |string|
iv_agentname = |string|
iv_customerencryptionkeyarn = |string|
iv_enabletrace = ABAP_TRUE
iv_endsession = ABAP_TRUE
iv_foundationmodel = |string|
iv_idlesessionttlinseconds = 123
iv_inputtext = |string|
iv_instruction = |string|
iv_orchestrationtype = |string|
iv_sessionid = |string|
).
This is an example of reading all possible response values
lo_result = lo_result.
IF lo_result IS NOT INITIAL.
TRY.
WHILE lo_result->get_completion( )->/aws1/if_rt_stream_reader~data_available( ) = ABAP_TRUE.
lo_event = lo_result->get_completion( )->READ( ).
IF lo_event->get_chunk( ) IS NOT INITIAL.
" process this kind of event
ELSEIF lo_event->get_trace( ) IS NOT INITIAL.
" process this kind of event
ELSEIF lo_event->get_returncontrol( ) IS NOT INITIAL.
" process this kind of event
ELSEIF lo_event->get_files( ) IS NOT INITIAL.
" process this kind of event
ENDIF.
ENDWHILE.
CATCH /aws1/cx_bdzaccessdeniedex.
" handle error in stream
CATCH /aws1/cx_bdzinternalserverex.
" handle error in stream
CATCH /aws1/cx_bdzvalidationex.
" handle error in stream
CATCH /aws1/cx_bdzthrottlingex.
" handle error in stream
CATCH /aws1/cx_bdzdependencyfailedex.
" handle error in stream
CATCH /aws1/cx_bdzbadgatewayex.
" handle error in stream
CATCH /aws1/cx_bdzresourcenotfoundex.
" handle error in stream
CATCH /aws1/cx_bdzservicequotaexcdex.
" handle error in stream
CATCH /aws1/cx_bdzconflictexception.
" handle error in stream
ENDTRY.
lv_mimetype = lo_result->get_contenttype( ).
lv_sessionid = lo_result->get_sessionid( ).
ENDIF.