From 637dab733299cc8ac2a08fda2f1cf40afcf569f7 Mon Sep 17 00:00:00 2001 From: Jon Friesen Date: Tue, 17 Oct 2023 15:53:39 +0000 Subject: [PATCH 1/9] updated format for newer abapgit --- .../cloudwatch/zcl_aws1_cwt_actions.clas.xml | 6 ------ .../cloudwatch/zcl_aws1_cwt_scenario.clas.xml | 1 - .../services/dyn/zcl_aws1_dyn_actions.clas.xml | 10 ---------- .../dyn/zcl_aws1_dyn_scenario.clas.xml | 1 - .../services/ec2/zcl_aws1_ec2_actions.clas.xml | 18 ------------------ .../kinesis/zcl_aws1_kns_actions.clas.xml | 7 ------- .../kinesis/zcl_aws1_kns_scenario.clas.xml | 1 - .../lambda/zcl_aws1_lmd_actions.clas.xml | 7 ------- .../lambda/zcl_aws1_lmd_scenario.clas.xml | 1 - .../services/s3/zcl_aws1_s3_actions.clas.xml | 8 -------- .../services/s3/zcl_aws1_s3_scenario.clas.xml | 1 - .../sagemaker/zcl_aws1_sgm_actions.clas.xml | 11 ----------- .../sagemaker/zcl_aws1_sgm_scenario.clas.xml | 1 - .../services/sns/zcl_aws1_sns_actions.clas.xml | 9 --------- .../sns/zcl_aws1_sns_scenario.clas.xml | 1 - .../services/sqs/zcl_aws1_sqs_actions.clas.xml | 8 -------- .../textract/zcl_aws1_tex_actions.clas.xml | 5 ----- .../textract/zcl_aws1_tex_scenario.clas.xml | 1 - .../translate/zcl_aws1_xl8_actions.clas.xml | 5 ----- .../translate/zcl_aws1_xl8_scenario.clas.xml | 1 - 20 files changed, 103 deletions(-) diff --git a/sap-abap/services/cloudwatch/zcl_aws1_cwt_actions.clas.xml b/sap-abap/services/cloudwatch/zcl_aws1_cwt_actions.clas.xml index e63411f9b2d..9e889288872 100644 --- a/sap-abap/services/cloudwatch/zcl_aws1_cwt_actions.clas.xml +++ b/sap-abap/services/cloudwatch/zcl_aws1_cwt_actions.clas.xml @@ -14,37 +14,31 @@ - ZCL_AWS1_CWT_ACTIONS DELETE_ALARMS E Delete CloudWatch alarm - ZCL_AWS1_CWT_ACTIONS DESCRIBE_ALARMS E Describe CloudWatch alarm - ZCL_AWS1_CWT_ACTIONS DISABLE_ALARM_ACTIONS E Disable CloudWatch alarm - ZCL_AWS1_CWT_ACTIONS ENABLE_ALARM_ACTIONS E Enable CloudWatch Alarm - ZCL_AWS1_CWT_ACTIONS LIST_METRICS E List CloudWatch metrics - ZCL_AWS1_CWT_ACTIONS PUT_METRIC_ALARM E Create a CloudWatch alarm diff --git a/sap-abap/services/cloudwatch/zcl_aws1_cwt_scenario.clas.xml b/sap-abap/services/cloudwatch/zcl_aws1_cwt_scenario.clas.xml index cff4ef669c4..0964bfdcf4c 100644 --- a/sap-abap/services/cloudwatch/zcl_aws1_cwt_scenario.clas.xml +++ b/sap-abap/services/cloudwatch/zcl_aws1_cwt_scenario.clas.xml @@ -14,7 +14,6 @@ - ZCL_AWS1_CWT_SCENARIO GETTING_STARTED_WITH_CWT E Getting started with Amazon CloudWatch diff --git a/sap-abap/services/dyn/zcl_aws1_dyn_actions.clas.xml b/sap-abap/services/dyn/zcl_aws1_dyn_actions.clas.xml index 366ccc5b968..aa348588a83 100644 --- a/sap-abap/services/dyn/zcl_aws1_dyn_actions.clas.xml +++ b/sap-abap/services/dyn/zcl_aws1_dyn_actions.clas.xml @@ -14,61 +14,51 @@ - ZCL_AWS1_DYN_ACTIONS CREATE_TABLE E Create Dynamo DB Table - ZCL_AWS1_DYN_ACTIONS DELETE_ITEM E Delete item from example-table - ZCL_AWS1_DYN_ACTIONS DELETE_TABLE E Delete table - ZCL_AWS1_DYN_ACTIONS DESCRIBE_TABLE E Describe table - ZCL_AWS1_DYN_ACTIONS GET_ITEM E Get item from example-table - ZCL_AWS1_DYN_ACTIONS LIST_TABLES E List tables - ZCL_AWS1_DYN_ACTIONS PUT_ITEM E Put item into example-table - ZCL_AWS1_DYN_ACTIONS QUERY_TABLE E Query items from example-table - ZCL_AWS1_DYN_ACTIONS SCAN_ITEMS E Scan example-table - ZCL_AWS1_DYN_ACTIONS UPDATE_ITEM E Update item in example-table diff --git a/sap-abap/services/dyn/zcl_aws1_dyn_scenario.clas.xml b/sap-abap/services/dyn/zcl_aws1_dyn_scenario.clas.xml index fd80fd10035..4eecee4a30c 100644 --- a/sap-abap/services/dyn/zcl_aws1_dyn_scenario.clas.xml +++ b/sap-abap/services/dyn/zcl_aws1_dyn_scenario.clas.xml @@ -14,7 +14,6 @@ - ZCL_AWS1_DYN_SCENARIO GETTING_STARTED_WITH_TABLES E Amazon Dynamo DB Scenario. Getting started with tables diff --git a/sap-abap/services/ec2/zcl_aws1_ec2_actions.clas.xml b/sap-abap/services/ec2/zcl_aws1_ec2_actions.clas.xml index a4966db5d7f..70e3020e5ff 100644 --- a/sap-abap/services/ec2/zcl_aws1_ec2_actions.clas.xml +++ b/sap-abap/services/ec2/zcl_aws1_ec2_actions.clas.xml @@ -14,109 +14,91 @@ - ZCL_AWS1_EC2_ACTIONS ALLOCATE_ADDRESS E Allocate an Elastic IP address - ZCL_AWS1_EC2_ACTIONS ASSOCIATE_ADDRESS E Associate an Elastic IP address to an EC2 instance - ZCL_AWS1_EC2_ACTIONS CREATE_INSTANCE E Create an EC2 instance - ZCL_AWS1_EC2_ACTIONS CREATE_KEY_PAIR E Create an Amazon EC2 security key pair - ZCL_AWS1_EC2_ACTIONS CREATE_SECURITY_GROUP E Create an Amazon EC2 security group - ZCL_AWS1_EC2_ACTIONS DELETE_KEY_PAIR E Delete an Amazon EC2 security key pair - ZCL_AWS1_EC2_ACTIONS DELETE_SECURITY_GROUP E Delete an Amazon EC2 security group - ZCL_AWS1_EC2_ACTIONS DESCRIBE_ADDRESSES E Retrieve information about Elastic IP addresses - ZCL_AWS1_EC2_ACTIONS DESCRIBE_AVAILABILITY_ZONES E Retrieve information about Availability Zones - ZCL_AWS1_EC2_ACTIONS DESCRIBE_INSTANCES E Retrieve information about EC2 instances - ZCL_AWS1_EC2_ACTIONS DESCRIBE_KEY_PAIRS E Retrieve information about Amazon EC2 security key pairs - ZCL_AWS1_EC2_ACTIONS DESCRIBE_REGIONS E Retrieve information about Regions - ZCL_AWS1_EC2_ACTIONS DESCRIBE_SECURITY_GROUPS E Retrieve information about an Amazon EC2 security group - ZCL_AWS1_EC2_ACTIONS MONITOR_INSTANCE E Enable detailed monitoring for a running EC2 instance - ZCL_AWS1_EC2_ACTIONS REBOOT_INSTANCE E Reboot an EC2 instance - ZCL_AWS1_EC2_ACTIONS RELEASE_ADDRESS E Release an Elastic IP address - ZCL_AWS1_EC2_ACTIONS START_INSTANCE E Start an EC2 instance - ZCL_AWS1_EC2_ACTIONS STOP_INSTANCE E Stop an EC2 instance diff --git a/sap-abap/services/kinesis/zcl_aws1_kns_actions.clas.xml b/sap-abap/services/kinesis/zcl_aws1_kns_actions.clas.xml index cd98660171a..b0ba7bb3681 100644 --- a/sap-abap/services/kinesis/zcl_aws1_kns_actions.clas.xml +++ b/sap-abap/services/kinesis/zcl_aws1_kns_actions.clas.xml @@ -14,43 +14,36 @@ - ZCL_AWS1_KNS_ACTIONS CREATE_STREAM E Create a Kinesis stream. - ZCL_AWS1_KNS_ACTIONS DELETE_STREAM E Delete a Kinesis stream. - ZCL_AWS1_KNS_ACTIONS DESCRIBE_STREAM E Describe a Kinesis stream. - ZCL_AWS1_KNS_ACTIONS GET_RECORDS E Get data records from a Kinesis data stream's shard. - ZCL_AWS1_KNS_ACTIONS LIST_STREAMS E List Kinesis streams. - ZCL_AWS1_KNS_ACTIONS PUT_RECORD E Write data record into a Kinesis data stream. - ZCL_AWS1_KNS_ACTIONS REGISTER_STREAM_CONSUMER E Register a consumer with a Kinesis data stream. diff --git a/sap-abap/services/kinesis/zcl_aws1_kns_scenario.clas.xml b/sap-abap/services/kinesis/zcl_aws1_kns_scenario.clas.xml index e259d5dd5b1..482ae6c592b 100644 --- a/sap-abap/services/kinesis/zcl_aws1_kns_scenario.clas.xml +++ b/sap-abap/services/kinesis/zcl_aws1_kns_scenario.clas.xml @@ -14,7 +14,6 @@ - ZCL_AWS1_KNS_SCENARIO GETTING_STARTED_WITH_KNS E Getting started with Kinesis diff --git a/sap-abap/services/lambda/zcl_aws1_lmd_actions.clas.xml b/sap-abap/services/lambda/zcl_aws1_lmd_actions.clas.xml index 709ee7483c2..a6972d01fcd 100644 --- a/sap-abap/services/lambda/zcl_aws1_lmd_actions.clas.xml +++ b/sap-abap/services/lambda/zcl_aws1_lmd_actions.clas.xml @@ -14,43 +14,36 @@ - ZCL_AWS1_LMD_ACTIONS CREATE_FUNCTION E Create a Lambda function. - ZCL_AWS1_LMD_ACTIONS DELETE_FUNCTION E Delete a Lambda function. - ZCL_AWS1_LMD_ACTIONS GET_FUNCTION E Get a Lambda function. - ZCL_AWS1_LMD_ACTIONS INVOKE_FUNCTION E Invoke a Lambda function. - ZCL_AWS1_LMD_ACTIONS LIST_FUNCTIONS E List lambda functions. - ZCL_AWS1_LMD_ACTIONS UPDATE_FUNCTION_CODE E Update Lambda function code. - ZCL_AWS1_LMD_ACTIONS UPDATE_FUNCTION_CONFIGURATION E Update Lambda function configuration. diff --git a/sap-abap/services/lambda/zcl_aws1_lmd_scenario.clas.xml b/sap-abap/services/lambda/zcl_aws1_lmd_scenario.clas.xml index 0bbe42e8221..660634f8dc6 100644 --- a/sap-abap/services/lambda/zcl_aws1_lmd_scenario.clas.xml +++ b/sap-abap/services/lambda/zcl_aws1_lmd_scenario.clas.xml @@ -14,7 +14,6 @@ - ZCL_AWS1_LMD_SCENARIO GETTING_STARTED_WITH_FUNCTIONS E Get started with creating and invoking Lambda functions. diff --git a/sap-abap/services/s3/zcl_aws1_s3_actions.clas.xml b/sap-abap/services/s3/zcl_aws1_s3_actions.clas.xml index 283db486853..b47d1d40545 100644 --- a/sap-abap/services/s3/zcl_aws1_s3_actions.clas.xml +++ b/sap-abap/services/s3/zcl_aws1_s3_actions.clas.xml @@ -14,49 +14,41 @@ - ZCL_AWS1_S3_ACTIONS COPY_OBJECT E Copy an object from one bucket to another. - ZCL_AWS1_S3_ACTIONS CREATE_BUCKET E Create an S3 bucket. - ZCL_AWS1_S3_ACTIONS DELETE_BUCKET E Delete the bucket. - ZCL_AWS1_S3_ACTIONS DELETE_OBJECT E Delete an object from a bucket. - ZCL_AWS1_S3_ACTIONS GET_OBJECT E Get an object from a bucket. - ZCL_AWS1_S3_ACTIONS LIST_OBJECTS E List objects in the bucket. - ZCL_AWS1_S3_ACTIONS LIST_OBJECTS_V2 E List objects in the bucket with V2 method. - ZCL_AWS1_S3_ACTIONS PUT_OBJECT E Upload an object to a S3 bucket. diff --git a/sap-abap/services/s3/zcl_aws1_s3_scenario.clas.xml b/sap-abap/services/s3/zcl_aws1_s3_scenario.clas.xml index 6c42648b002..97af3930292 100644 --- a/sap-abap/services/s3/zcl_aws1_s3_scenario.clas.xml +++ b/sap-abap/services/s3/zcl_aws1_s3_scenario.clas.xml @@ -14,7 +14,6 @@ - ZCL_AWS1_S3_SCENARIO GETTING_STARTED_WITH_S3 E Getting started with Amazon S3 buckets and objects. diff --git a/sap-abap/services/sagemaker/zcl_aws1_sgm_actions.clas.xml b/sap-abap/services/sagemaker/zcl_aws1_sgm_actions.clas.xml index fea58ac1d78..5c556213500 100644 --- a/sap-abap/services/sagemaker/zcl_aws1_sgm_actions.clas.xml +++ b/sap-abap/services/sagemaker/zcl_aws1_sgm_actions.clas.xml @@ -14,67 +14,56 @@ - ZCL_AWS1_SGM_ACTIONS CREATE_ENDPOINT E Create an endpoint in SageMaker. - ZCL_AWS1_SGM_ACTIONS CREATE_MODEL E Create a model in SageMaker. - ZCL_AWS1_SGM_ACTIONS CREATE_TRAINING_JOB E Create a training job in SageMaker. - ZCL_AWS1_SGM_ACTIONS CREATE_TRANSFORM_JOB E Create a tranform job in SageMaker. - ZCL_AWS1_SGM_ACTIONS DELETE_ENDPOINT E Create a model in SageMaker. - ZCL_AWS1_SGM_ACTIONS DELETE_MODEL E List training jobs in SageMaker. - ZCL_AWS1_SGM_ACTIONS DESCRIBE_TRAINING_JOB E Describe training job in SageMaker. - ZCL_AWS1_SGM_ACTIONS LIST_ALGORITHMS E List algorithms in SageMaker. - ZCL_AWS1_SGM_ACTIONS LIST_MODELS E List training jobs in SageMaker. - ZCL_AWS1_SGM_ACTIONS LIST_NOTEBOOK_INSTANCES E List notebook instances in SageMaker. - ZCL_AWS1_SGM_ACTIONS LIST_TRAINING_JOBS E List training jobs in SageMaker. diff --git a/sap-abap/services/sagemaker/zcl_aws1_sgm_scenario.clas.xml b/sap-abap/services/sagemaker/zcl_aws1_sgm_scenario.clas.xml index f1b6cec76e5..5cb8ef3f709 100644 --- a/sap-abap/services/sagemaker/zcl_aws1_sgm_scenario.clas.xml +++ b/sap-abap/services/sagemaker/zcl_aws1_sgm_scenario.clas.xml @@ -14,7 +14,6 @@ - ZCL_AWS1_SGM_SCENARIO GETTING_STARTED_WITH_SGM E Create a training job in SageMaker. diff --git a/sap-abap/services/sns/zcl_aws1_sns_actions.clas.xml b/sap-abap/services/sns/zcl_aws1_sns_actions.clas.xml index 48d9e90846b..c4b3fd17488 100644 --- a/sap-abap/services/sns/zcl_aws1_sns_actions.clas.xml +++ b/sap-abap/services/sns/zcl_aws1_sns_actions.clas.xml @@ -14,55 +14,46 @@ - ZCL_AWS1_SNS_ACTIONS CREATE_TOPIC E Create a topic. - ZCL_AWS1_SNS_ACTIONS DELETE_TOPIC E Delete a topic. - ZCL_AWS1_SNS_ACTIONS GET_TOPIC_ATTRIBUTES E Get the properties of a topic. - ZCL_AWS1_SNS_ACTIONS LIST_SUBSCRIPTIONS E List the subscribers. - ZCL_AWS1_SNS_ACTIONS LIST_TOPICS E List SNS topics. - ZCL_AWS1_SNS_ACTIONS PUBLISH_TO_TOPIC E Publish to a topic. - ZCL_AWS1_SNS_ACTIONS SET_TOPIC_ATTRIBUTES E Set topic attributes. - ZCL_AWS1_SNS_ACTIONS SUBSCRIBE_EMAIL E Subscribe an email address to a topic. - ZCL_AWS1_SNS_ACTIONS UNSUBSCRIBE E Delete a subscription. diff --git a/sap-abap/services/sns/zcl_aws1_sns_scenario.clas.xml b/sap-abap/services/sns/zcl_aws1_sns_scenario.clas.xml index 09de1a5a210..6e2c479edfc 100644 --- a/sap-abap/services/sns/zcl_aws1_sns_scenario.clas.xml +++ b/sap-abap/services/sns/zcl_aws1_sns_scenario.clas.xml @@ -14,7 +14,6 @@ - ZCL_AWS1_SNS_SCENARIO PUBLISH_MESSAGE_TO_FIFO_TOPIC E Create and publish to a FIFO topic. diff --git a/sap-abap/services/sqs/zcl_aws1_sqs_actions.clas.xml b/sap-abap/services/sqs/zcl_aws1_sqs_actions.clas.xml index 5068f97c4f0..4299f3f1aa3 100644 --- a/sap-abap/services/sqs/zcl_aws1_sqs_actions.clas.xml +++ b/sap-abap/services/sqs/zcl_aws1_sqs_actions.clas.xml @@ -14,49 +14,41 @@ - ZCL_AWS1_SQS_ACTIONS CREATE_QUEUE E Create a queue. - ZCL_AWS1_SQS_ACTIONS DELETE_QUEUE E Delete a queue. - ZCL_AWS1_SQS_ACTIONS GET_QUEUE_URL E Retrieve the URL of a queue. - ZCL_AWS1_SQS_ACTIONS LIST_QUEUES E Retrieve a list of queues. - ZCL_AWS1_SQS_ACTIONS LONG_POLLING_ON_CREATE_QUEUE E Create an SQS queue with long polling enabled. - ZCL_AWS1_SQS_ACTIONS LONG_POLLING_ON_MSG_RECEIPT E Enable long polling on a message receipt. - ZCL_AWS1_SQS_ACTIONS RECEIVE_MESSAGE E Receive message from a queue. - ZCL_AWS1_SQS_ACTIONS SEND_MESSAGE E Sending message to a queue. diff --git a/sap-abap/services/textract/zcl_aws1_tex_actions.clas.xml b/sap-abap/services/textract/zcl_aws1_tex_actions.clas.xml index b282a33e561..554ce253ea1 100644 --- a/sap-abap/services/textract/zcl_aws1_tex_actions.clas.xml +++ b/sap-abap/services/textract/zcl_aws1_tex_actions.clas.xml @@ -14,31 +14,26 @@ - ZCL_AWS1_TEX_ACTIONS ANALYZE_DOCUMENT E Analyzes an input document for relationships between detects - ZCL_AWS1_TEX_ACTIONS DETECT_DOCUMENT_TEXT E Detects text in the input document. - ZCL_AWS1_TEX_ACTIONS GET_DOCUMENT_ANALYSIS E Gets the results for an document operation. - ZCL_AWS1_TEX_ACTIONS START_DOCUMENT_ANALYSIS E Starts the asynchronous analysis of an input document. - ZCL_AWS1_TEX_ACTIONS START_DOCUMENT_TEXT_DETECTION E Starts the asynchronous detection of text in a document. diff --git a/sap-abap/services/textract/zcl_aws1_tex_scenario.clas.xml b/sap-abap/services/textract/zcl_aws1_tex_scenario.clas.xml index e3b1953d966..1313bae3522 100644 --- a/sap-abap/services/textract/zcl_aws1_tex_scenario.clas.xml +++ b/sap-abap/services/textract/zcl_aws1_tex_scenario.clas.xml @@ -14,7 +14,6 @@ - ZCL_AWS1_TEX_SCENARIO GETTING_STARTED_WITH_TEX E SGM code example scenario. diff --git a/sap-abap/services/translate/zcl_aws1_xl8_actions.clas.xml b/sap-abap/services/translate/zcl_aws1_xl8_actions.clas.xml index 8bcd8b38386..df8a6f4add3 100644 --- a/sap-abap/services/translate/zcl_aws1_xl8_actions.clas.xml +++ b/sap-abap/services/translate/zcl_aws1_xl8_actions.clas.xml @@ -14,31 +14,26 @@ - ZCL_AWS1_XL8_ACTIONS DESCRIBE_TEXT_TRANSLATION_JOB E Gets the properties associated with an asynchronous job. - ZCL_AWS1_XL8_ACTIONS LIST_TEXT_TRANSLATION_JOBS E Gets a list of the batch translation jobs. - ZCL_AWS1_XL8_ACTIONS START_TEXT_TRANSLATION_JOB E Starts an asynchronous batch translation job. - ZCL_AWS1_XL8_ACTIONS STOP_TEXT_TRANSLATION_JOB E Stops an asynchronous batch translation job that is in progr - ZCL_AWS1_XL8_ACTIONS TRANSLATE_TEXT E Translates input text from the source language to the target diff --git a/sap-abap/services/translate/zcl_aws1_xl8_scenario.clas.xml b/sap-abap/services/translate/zcl_aws1_xl8_scenario.clas.xml index f40dba8eab4..c8500d29a31 100644 --- a/sap-abap/services/translate/zcl_aws1_xl8_scenario.clas.xml +++ b/sap-abap/services/translate/zcl_aws1_xl8_scenario.clas.xml @@ -14,7 +14,6 @@ - ZCL_AWS1_XL8_SCENARIO GETTING_STARTED_WITH_XL8 E Getting started with Amazon Translate. From f62c704520facce1f3251fc0b4ca123f5469f745 Mon Sep 17 00:00:00 2001 From: Jon Friesen Date: Fri, 20 Oct 2023 16:31:46 +0000 Subject: [PATCH 2/9] Initial Bedrock Runtime examples for ABAP --- sap-abap/services/bdr/package.devc.xml | 10 + .../bdr/zcl_aws1_bdr_actions.clas.abap | 192 ++++++++++++++++++ ...zcl_aws1_bdr_actions.clas.testclasses.abap | 46 +++++ .../bdr/zcl_aws1_bdr_actions.clas.xml | 91 +++++++++ 4 files changed, 339 insertions(+) create mode 100644 sap-abap/services/bdr/package.devc.xml create mode 100644 sap-abap/services/bdr/zcl_aws1_bdr_actions.clas.abap create mode 100644 sap-abap/services/bdr/zcl_aws1_bdr_actions.clas.testclasses.abap create mode 100644 sap-abap/services/bdr/zcl_aws1_bdr_actions.clas.xml diff --git a/sap-abap/services/bdr/package.devc.xml b/sap-abap/services/bdr/package.devc.xml new file mode 100644 index 00000000000..d3699c350cb --- /dev/null +++ b/sap-abap/services/bdr/package.devc.xml @@ -0,0 +1,10 @@ + + + + + + Package for Bedrock Runtime + + + + diff --git a/sap-abap/services/bdr/zcl_aws1_bdr_actions.clas.abap b/sap-abap/services/bdr/zcl_aws1_bdr_actions.clas.abap new file mode 100644 index 00000000000..2fec461bfb4 --- /dev/null +++ b/sap-abap/services/bdr/zcl_aws1_bdr_actions.clas.abap @@ -0,0 +1,192 @@ +class ZCL_AWS1_BDR_ACTIONS definition + public + final + create public . + +public section. +protected section. +private section. + + methods PROMPT_CLAUDE_V2 + importing + !IV_PROMPT type STRING + returning + value(OV_ANSWER) type STRING + raising + /AWS1/CX_BDRSERVEREXC + /AWS1/CX_BDRCLIENTEXC + /AWS1/CX_RT_TECHNICAL_GENERIC + /AWS1/CX_RT_SERVICE_GENERIC + /AWS1/CX_RT_NO_AUTH_GENERIC . + methods PROMPT_STABLE_DIFFUSION + importing + !IV_PROMPT type STRING + returning + value(OV_IMAGE) type XSTRING + raising + /AWS1/CX_BDRSERVEREXC + /AWS1/CX_BDRCLIENTEXC + /AWS1/CX_RT_TECHNICAL_GENERIC + /AWS1/CX_RT_SERVICE_GENERIC + /AWS1/CX_RT_NO_AUTH_GENERIC . +ENDCLASS. + + + +CLASS ZCL_AWS1_BDR_ACTIONS IMPLEMENTATION. + + + METHOD prompt_claude_v2. + CONSTANTS: cv_pfl TYPE /aws1/rt_profile_id VALUE 'ZCODE_DEMO'. + + DATA(lo_session) = /aws1/cl_rt_session_aws=>create( cv_pfl ). + DATA(lo_bdr) = /aws1/cl_bdr_factory=>create( lo_session ). + "snippet-start:[bdr.abapv1.prompt_claude_v2] + " Claude V2 Input Parameters should be in a format like this: +* { +* "prompt":"\n\nHuman:\\nTell me a joke\n\nAssistant:\n", +* "max_tokens_to_sample":2048, +* "temperature":0.5, +* "top_k":250, +* "top_p":1.0, +* "stop_sequences":[]} +* } + + DATA: BEGIN OF ls_input, + prompt TYPE string, + max_tokens_to_sample TYPE /aws1/rt_shape_integer, + temperature TYPE /aws1/rt_shape_float, + top_k TYPE /aws1/rt_shape_integer, + top_p TYPE /aws1/rt_shape_float, + stop_sequences TYPE /aws1/rt_stringtab, + END OF ls_input. + + " leave ls_input-stop_sequences empty + ls_input-prompt = |\n\nHuman:\\n{ iv_prompt }\n\nAssistant:\n|. + ls_input-max_tokens_to_sample = 2048. + ls_input-temperature = '0.5'. + ls_input-top_k = 250. + ls_input-top_p = 1. + + " serialize into JSON with /ui2/cl_json -- this assumes SAP_UI is installed + DATA(lv_json) = /ui2/cl_json=>serialize( + EXPORTING data = ls_input + pretty_name = /ui2/cl_json=>pretty_mode-low_case ). + + TRY. + DATA(lo_response) = lo_bdr->invokemodel( + iv_body = /aws1/cl_rt_util=>string_to_xstring( lv_json ) + iv_modelid = 'anthropic.claude-v2' + iv_accept = 'application/json' + iv_contenttype = 'application/json' + ). + + " Claude V2 Response format will be +* { +* "completion": "Knock Knock...", +* "stop_reason": "stop_sequence" +* } + DATA: BEGIN OF ls_response, + completion TYPE string, + stop_reason TYPE string, + END OF ls_response. + + /ui2/cl_json=>deserialize( + EXPORTING jsonx = lo_response->get_body( ) + pretty_name = /ui2/cl_json=>pretty_mode-camel_case + CHANGING data = ls_response ). + + DATA(lv_answer) = ls_response-completion. + CATCH /aws1/cx_bdraccessdeniedex INTO DATA(lo_ex). + WRITE: / lo_ex->get_text( ). + WRITE: / |Don't forget to enable model access at https://us-west-2.console.aws.amazon.com/bedrock/home?#/modelaccess|. + " catch other exceptions as desired... + ENDTRY. + "snippet-end:[bdr.abapv1.prompt_claude_v2] + ov_answer = lv_answer. + ENDMETHOD. + + + METHOD prompt_stable_diffusion. + CONSTANTS: cv_pfl TYPE /aws1/rt_profile_id VALUE 'ZCODE_DEMO'. + + DATA(lo_session) = /aws1/cl_rt_session_aws=>create( cv_pfl ). + DATA(lo_bdr) = /aws1/cl_bdr_factory=>create( lo_session ). + "snippet-start:[bdr.abapv1.prompt_stable_diffusion] + " Stable Diffusion Input Parameters should be in a format like this: +* { +* "text_prompts": [ +* {"text":"Draw a dolphin with a mustache"}, +* {"text":"Make it photorealistic"} +* ], +* "cfg_scale":10, +* "seed":0, +* "steps":50 +* } + TYPES: BEGIN OF prompt_ts, + text TYPE /aws1/rt_shape_string, + END OF prompt_ts. + + DATA: BEGIN OF ls_input, + text_prompts TYPE STANDARD TABLE OF prompt_ts, + cfg_scale TYPE /aws1/rt_shape_integer, + seed TYPE /aws1/rt_shape_integer, + steps TYPE /aws1/rt_shape_integer, + END OF ls_input. + + APPEND VALUE prompt_ts( text = iv_prompt ) TO ls_input-text_prompts. + ls_input-cfg_scale = 10. + ls_input-seed = 0. "or better, choose a random integer + ls_input-steps = 50. + + DATA(lv_json) = /ui2/cl_json=>serialize( + EXPORTING data = ls_input + pretty_name = /ui2/cl_json=>pretty_mode-low_case ). + + TRY. + DATA(lo_response) = lo_bdr->invokemodel( + iv_body = /aws1/cl_rt_util=>string_to_xstring( lv_json ) + iv_modelid = 'stability.stable-diffusion-xl-v0' + iv_accept = 'application/json' + iv_contenttype = 'application/json' + ). + + " Stable Diffusion Result Format +* { +* "result": "success", +* "artifacts": [ +* { +* "seed": 0, +* "base64": "iVBORw0KGgoAAAANSUhEUgAAAgAAA.... +* "finishReason": "SUCCESS" +* } +* ] +* } + TYPES: BEGIN OF artifact_ts, + seed TYPE /aws1/rt_shape_integer, + base64 TYPE /aws1/rt_shape_string, + finishreason TYPE /aws1/rt_shape_string, + END OF artifact_ts. + + DATA: BEGIN OF ls_response, + result TYPE /aws1/rt_shape_string, + artifacts TYPE STANDARD TABLE OF artifact_ts, + END OF ls_response. + + /ui2/cl_json=>deserialize( + EXPORTING jsonx = lo_response->get_body( ) + pretty_name = /ui2/cl_json=>pretty_mode-camel_case + CHANGING data = ls_response ). + IF ls_response-artifacts IS NOT INITIAL. + DATA(lv_image) = cl_http_utility=>if_http_utility~decode_x_base64( ls_response-artifacts[ 1 ]-base64 ). + ENDIF. + CATCH /aws1/cx_bdraccessdeniedex INTO DATA(lo_ex). + WRITE: / lo_ex->get_text( ). + WRITE: / |Don't forget to enable model access at https://us-west-2.console.aws.amazon.com/bedrock/home?#/modelaccess|. + " catch other exceptions as desired... + ENDTRY. + + "snippet-end:[bdr.abapv1.prompt_stable_diffusion] + ov_image = lv_image. + ENDMETHOD. +ENDCLASS. diff --git a/sap-abap/services/bdr/zcl_aws1_bdr_actions.clas.testclasses.abap b/sap-abap/services/bdr/zcl_aws1_bdr_actions.clas.testclasses.abap new file mode 100644 index 00000000000..3c9c80f9759 --- /dev/null +++ b/sap-abap/services/bdr/zcl_aws1_bdr_actions.clas.testclasses.abap @@ -0,0 +1,46 @@ +" """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" " Copyright 2022 Amazon.com, Inc. or its affiliates. All Rights +" " Reserved. +" " SPDX-License-Identifier: MIT-0 +" """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +CLASS ltc_zcl_aws1_bdr_actions DEFINITION DEFERRED. +CLASS zcl_aws1_bdr_actions DEFINITION LOCAL FRIENDS ltc_zcl_aws1_bdr_actions. + +CLASS ltc_zcl_aws1_bdr_actions DEFINITION FOR TESTING DURATION LONG RISK LEVEL HARMLESS. + + PRIVATE SECTION. + CONSTANTS: cv_pfl TYPE /aws1/rt_profile_id VALUE 'ZCODE_DEMO'. + + DATA ao_bdr TYPE REF TO /aws1/if_bdr. + DATA ao_session TYPE REF TO /aws1/cl_rt_session_base. + DATA ao_bdr_actions TYPE REF TO zcl_aws1_bdr_actions. + + METHODS: test_claude_v2 FOR TESTING RAISING /aws1/cx_rt_generic. + METHODS: test_stable_diffusion FOR TESTING RAISING /aws1/cx_rt_generic. + + METHODS: setup RAISING /aws1/cx_rt_generic. + +ENDCLASS. +CLASS ltc_zcl_aws1_bdr_actions IMPLEMENTATION. + + METHOD setup. + ao_session = /aws1/cl_rt_session_aws=>create( iv_profile_id = cv_pfl ). + ao_bdr = /aws1/cl_bdr_factory=>create( ao_session ). + ao_bdr_actions = NEW zcl_aws1_bdr_actions( ). + ENDMETHOD. + METHOD test_claude_v2. + DATA(lv_joke) = ao_bdr_actions->prompt_claude_v2( + 'Tell me a joke about ABAP programmers and Java programmers walking into a bar' + ). + cl_abap_unit_assert=>assert_not_initial( act = lv_joke ). + ENDMETHOD. + + METHOD test_stable_diffusion. + DATA(lv_joke) = ao_bdr_actions->prompt_stable_diffusion( + 'Show me a picture of a kitten coding in ABAP on an SAP system' + ). + cl_abap_unit_assert=>assert_not_initial( act = lv_joke ). + ENDMETHOD. + +ENDCLASS. diff --git a/sap-abap/services/bdr/zcl_aws1_bdr_actions.clas.xml b/sap-abap/services/bdr/zcl_aws1_bdr_actions.clas.xml new file mode 100644 index 00000000000..18780b8eee2 --- /dev/null +++ b/sap-abap/services/bdr/zcl_aws1_bdr_actions.clas.xml @@ -0,0 +1,91 @@ + + + + + + ZCL_AWS1_BDR_ACTIONS + E + Bedrock Runtime Code Example Actions + 1 + X + X + X + X + + + + PROMPT_CLAUDE_V2 + E + Prompt Claude V2 + + + PROMPT_STABLE_DIFFUSION + E + Prompt Claude V2 + + + + + PROMPT_CLAUDE_V2 + /AWS1/CX_BDRCLIENTEXC + E + Exception /AWS1/CX_BDRCLIENTEXC + + + PROMPT_CLAUDE_V2 + /AWS1/CX_BDRSERVEREXC + E + Exception /AWS1/CX_BDRSERVEREXC + + + PROMPT_CLAUDE_V2 + /AWS1/CX_RT_NO_AUTH_GENERIC + E + Generic lack of authorization + + + PROMPT_CLAUDE_V2 + /AWS1/CX_RT_SERVICE_GENERIC + E + Generic Service call error + + + PROMPT_CLAUDE_V2 + /AWS1/CX_RT_TECHNICAL_GENERIC + E + Technical errors + + + PROMPT_STABLE_DIFFUSION + /AWS1/CX_BDRCLIENTEXC + E + Exception /AWS1/CX_BDRCLIENTEXC + + + PROMPT_STABLE_DIFFUSION + /AWS1/CX_BDRSERVEREXC + E + Exception /AWS1/CX_BDRSERVEREXC + + + PROMPT_STABLE_DIFFUSION + /AWS1/CX_RT_NO_AUTH_GENERIC + E + Generic lack of authorization + + + PROMPT_STABLE_DIFFUSION + /AWS1/CX_RT_SERVICE_GENERIC + E + Generic Service call error + + + PROMPT_STABLE_DIFFUSION + /AWS1/CX_RT_TECHNICAL_GENERIC + E + Technical errors + + + + + From a70890b9f4df9ddb17417095cbe2d3c37697d481 Mon Sep 17 00:00:00 2001 From: Jon Friesen Date: Fri, 20 Oct 2023 16:49:27 +0000 Subject: [PATCH 3/9] Improve formatting of comments --- sap-abap/services/bdr/zcl_aws1_bdr_actions.clas.abap | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sap-abap/services/bdr/zcl_aws1_bdr_actions.clas.abap b/sap-abap/services/bdr/zcl_aws1_bdr_actions.clas.abap index 2fec461bfb4..2f7ed8ffb7f 100644 --- a/sap-abap/services/bdr/zcl_aws1_bdr_actions.clas.abap +++ b/sap-abap/services/bdr/zcl_aws1_bdr_actions.clas.abap @@ -61,14 +61,14 @@ CLASS ZCL_AWS1_BDR_ACTIONS IMPLEMENTATION. stop_sequences TYPE /aws1/rt_stringtab, END OF ls_input. - " leave ls_input-stop_sequences empty + " leave ls_input-stop_sequences empty. ls_input-prompt = |\n\nHuman:\\n{ iv_prompt }\n\nAssistant:\n|. ls_input-max_tokens_to_sample = 2048. ls_input-temperature = '0.5'. ls_input-top_k = 250. ls_input-top_p = 1. - " serialize into JSON with /ui2/cl_json -- this assumes SAP_UI is installed + " serialize into JSON with /ui2/cl_json -- this assumes SAP_UI is installed. DATA(lv_json) = /ui2/cl_json=>serialize( EXPORTING data = ls_input pretty_name = /ui2/cl_json=>pretty_mode-low_case ). @@ -81,7 +81,7 @@ CLASS ZCL_AWS1_BDR_ACTIONS IMPLEMENTATION. iv_contenttype = 'application/json' ). - " Claude V2 Response format will be + " Claude V2 Response format will be: * { * "completion": "Knock Knock...", * "stop_reason": "stop_sequence" @@ -136,7 +136,7 @@ CLASS ZCL_AWS1_BDR_ACTIONS IMPLEMENTATION. APPEND VALUE prompt_ts( text = iv_prompt ) TO ls_input-text_prompts. ls_input-cfg_scale = 10. - ls_input-seed = 0. "or better, choose a random integer + ls_input-seed = 0. "or better, choose a random integer. ls_input-steps = 50. DATA(lv_json) = /ui2/cl_json=>serialize( @@ -151,7 +151,7 @@ CLASS ZCL_AWS1_BDR_ACTIONS IMPLEMENTATION. iv_contenttype = 'application/json' ). - " Stable Diffusion Result Format + " Stable Diffusion Result Format: * { * "result": "success", * "artifacts": [ From b1d77073a0bf085b123bc3d3dc78192ec23c8dbb Mon Sep 17 00:00:00 2001 From: Jon Friesen Date: Fri, 20 Oct 2023 20:12:20 +0000 Subject: [PATCH 4/9] improve snippet tags --- sap-abap/services/bdr/zcl_aws1_bdr_actions.clas.abap | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sap-abap/services/bdr/zcl_aws1_bdr_actions.clas.abap b/sap-abap/services/bdr/zcl_aws1_bdr_actions.clas.abap index 2f7ed8ffb7f..95b33cc92f0 100644 --- a/sap-abap/services/bdr/zcl_aws1_bdr_actions.clas.abap +++ b/sap-abap/services/bdr/zcl_aws1_bdr_actions.clas.abap @@ -41,7 +41,7 @@ CLASS ZCL_AWS1_BDR_ACTIONS IMPLEMENTATION. DATA(lo_session) = /aws1/cl_rt_session_aws=>create( cv_pfl ). DATA(lo_bdr) = /aws1/cl_bdr_factory=>create( lo_session ). - "snippet-start:[bdr.abapv1.prompt_claude_v2] + "snippet-start:[bdr.abapv1.invokemodel_claude_v2] " Claude V2 Input Parameters should be in a format like this: * { * "prompt":"\n\nHuman:\\nTell me a joke\n\nAssistant:\n", @@ -102,7 +102,7 @@ CLASS ZCL_AWS1_BDR_ACTIONS IMPLEMENTATION. WRITE: / |Don't forget to enable model access at https://us-west-2.console.aws.amazon.com/bedrock/home?#/modelaccess|. " catch other exceptions as desired... ENDTRY. - "snippet-end:[bdr.abapv1.prompt_claude_v2] + "snippet-end:[bdr.abapv1.invokemodel_claude_v2] ov_answer = lv_answer. ENDMETHOD. @@ -112,7 +112,7 @@ CLASS ZCL_AWS1_BDR_ACTIONS IMPLEMENTATION. DATA(lo_session) = /aws1/cl_rt_session_aws=>create( cv_pfl ). DATA(lo_bdr) = /aws1/cl_bdr_factory=>create( lo_session ). - "snippet-start:[bdr.abapv1.prompt_stable_diffusion] + "snippet-start:[bdr.abapv1.invokemodel_stable_diffusion] " Stable Diffusion Input Parameters should be in a format like this: * { * "text_prompts": [ @@ -186,7 +186,7 @@ CLASS ZCL_AWS1_BDR_ACTIONS IMPLEMENTATION. " catch other exceptions as desired... ENDTRY. - "snippet-end:[bdr.abapv1.prompt_stable_diffusion] + "snippet-end:[bdr.abapv1.invokemodel_stable_diffusion] ov_image = lv_image. ENDMETHOD. ENDCLASS. From bd5f6b8379fa4523d235d3ee1d84c146058e4608 Mon Sep 17 00:00:00 2001 From: Jon Friesen Date: Fri, 20 Oct 2023 16:14:20 -0400 Subject: [PATCH 5/9] Adding metadata for Bedrock Runtime with ABAP examples --- .../cross-content/phrases-code-examples.ent | 6 +++++- .../metadata/bedrock-runtime_metadata.yaml | 20 +++++++++++++++++++ .doc_gen/metadata/services.yaml | 15 ++++++++++++++ 3 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 .doc_gen/metadata/bedrock-runtime_metadata.yaml diff --git a/.doc_gen/cross-content/phrases-code-examples.ent b/.doc_gen/cross-content/phrases-code-examples.ent index 309ad7e0e2e..087d3baea48 100644 --- a/.doc_gen/cross-content/phrases-code-examples.ent +++ b/.doc_gen/cross-content/phrases-code-examples.ent @@ -70,4 +70,8 @@ - \ No newline at end of file + + + + + \ No newline at end of file diff --git a/.doc_gen/metadata/bedrock-runtime_metadata.yaml b/.doc_gen/metadata/bedrock-runtime_metadata.yaml new file mode 100644 index 00000000000..0932d3c154d --- /dev/null +++ b/.doc_gen/metadata/bedrock-runtime_metadata.yaml @@ -0,0 +1,20 @@ +# zexi 0.4.0 +bedrock-runtime_InvokeModel: + title: Invoke the specified &BR; model to run inference + title_abbrev: Invoke a model + synopsis: invoke a &BR model. + category: + languages: + SAP ABAP: + versions: + - sdk_version: 1 + github: sap-abap/services/bdr + excerpts: + - description: Invoke a Claude V2 foundation model. This example uses features of /US2/CL_JSON which may not be available on some NetWeaver version. + snippet_tags: + - bdr.abapv1.invokemodel_claude_v2 + - description: Invoke a Stable Diffusion foundation model + snippet_tags: + - bdr.abapv1.invokemodel_stable_diffusion + services: + bedrock-runtime: {InvokeModel} \ No newline at end of file diff --git a/.doc_gen/metadata/services.yaml b/.doc_gen/metadata/services.yaml index 5795d93a50d..22b3c123b3d 100644 --- a/.doc_gen/metadata/services.yaml +++ b/.doc_gen/metadata/services.yaml @@ -120,6 +120,21 @@ batch: tags: product_categories: {'Compute'} version: batch-2016-08-10 +bedrock-runtime: + long: '&BRlong; Runtime' + short: '&BR; Runtime' + sort: Bedrock Runtime + expanded: + long: Amazon Bedrock Runtime + short: Bedrock Runtime + blurb: enables you to run inference on models + guide: + subtitle: User Guide + url: bedrock/latest/userguide/what-is-bedrock.html + api_ref: bedrock/latest/APIReference/welcome.html + tags: + product_categories: {'Machine Learning & AI'} + version: bedrock-runtime-2023-09-30 cloudformation: long: '&CFNlong;' short: '&CFN;' From 92f12acd41cd9e02c248553732d7b7c56123995a Mon Sep 17 00:00:00 2001 From: Deepika Raje Date: Mon, 23 Oct 2023 16:19:01 -0700 Subject: [PATCH 6/9] indent comments --- .../bdr/zcl_aws1_bdr_actions.clas.abap | 78 +++++++++---------- 1 file changed, 39 insertions(+), 39 deletions(-) diff --git a/sap-abap/services/bdr/zcl_aws1_bdr_actions.clas.abap b/sap-abap/services/bdr/zcl_aws1_bdr_actions.clas.abap index 95b33cc92f0..fe76a76ce01 100644 --- a/sap-abap/services/bdr/zcl_aws1_bdr_actions.clas.abap +++ b/sap-abap/services/bdr/zcl_aws1_bdr_actions.clas.abap @@ -42,15 +42,15 @@ CLASS ZCL_AWS1_BDR_ACTIONS IMPLEMENTATION. DATA(lo_session) = /aws1/cl_rt_session_aws=>create( cv_pfl ). DATA(lo_bdr) = /aws1/cl_bdr_factory=>create( lo_session ). "snippet-start:[bdr.abapv1.invokemodel_claude_v2] - " Claude V2 Input Parameters should be in a format like this: -* { -* "prompt":"\n\nHuman:\\nTell me a joke\n\nAssistant:\n", -* "max_tokens_to_sample":2048, -* "temperature":0.5, -* "top_k":250, -* "top_p":1.0, -* "stop_sequences":[]} -* } + "Claude V2 Input Parameters should be in a format like this: +* { +* "prompt":"\n\nHuman:\\nTell me a joke\n\nAssistant:\n", +* "max_tokens_to_sample":2048, +* "temperature":0.5, +* "top_k":250, +* "top_p":1.0, +* "stop_sequences":[] +* } DATA: BEGIN OF ls_input, prompt TYPE string, @@ -61,14 +61,14 @@ CLASS ZCL_AWS1_BDR_ACTIONS IMPLEMENTATION. stop_sequences TYPE /aws1/rt_stringtab, END OF ls_input. - " leave ls_input-stop_sequences empty. + "Leave ls_input-stop_sequences empty. ls_input-prompt = |\n\nHuman:\\n{ iv_prompt }\n\nAssistant:\n|. ls_input-max_tokens_to_sample = 2048. ls_input-temperature = '0.5'. ls_input-top_k = 250. ls_input-top_p = 1. - " serialize into JSON with /ui2/cl_json -- this assumes SAP_UI is installed. + "Serialize into JSON with /ui2/cl_json -- this assumes SAP_UI is installed. DATA(lv_json) = /ui2/cl_json=>serialize( EXPORTING data = ls_input pretty_name = /ui2/cl_json=>pretty_mode-low_case ). @@ -81,11 +81,11 @@ CLASS ZCL_AWS1_BDR_ACTIONS IMPLEMENTATION. iv_contenttype = 'application/json' ). - " Claude V2 Response format will be: -* { -* "completion": "Knock Knock...", -* "stop_reason": "stop_sequence" -* } + "Claude V2 Response format will be: +* { +* "completion": "Knock Knock...", +* "stop_reason": "stop_sequence" +* } DATA: BEGIN OF ls_response, completion TYPE string, stop_reason TYPE string, @@ -100,7 +100,7 @@ CLASS ZCL_AWS1_BDR_ACTIONS IMPLEMENTATION. CATCH /aws1/cx_bdraccessdeniedex INTO DATA(lo_ex). WRITE: / lo_ex->get_text( ). WRITE: / |Don't forget to enable model access at https://us-west-2.console.aws.amazon.com/bedrock/home?#/modelaccess|. - " catch other exceptions as desired... + "Catch other exceptions as desired... ENDTRY. "snippet-end:[bdr.abapv1.invokemodel_claude_v2] ov_answer = lv_answer. @@ -113,16 +113,16 @@ CLASS ZCL_AWS1_BDR_ACTIONS IMPLEMENTATION. DATA(lo_session) = /aws1/cl_rt_session_aws=>create( cv_pfl ). DATA(lo_bdr) = /aws1/cl_bdr_factory=>create( lo_session ). "snippet-start:[bdr.abapv1.invokemodel_stable_diffusion] - " Stable Diffusion Input Parameters should be in a format like this: -* { -* "text_prompts": [ -* {"text":"Draw a dolphin with a mustache"}, -* {"text":"Make it photorealistic"} -* ], -* "cfg_scale":10, -* "seed":0, -* "steps":50 -* } + "Stable Diffusion Input Parameters should be in a format like this: +* { +* "text_prompts": [ +* {"text":"Draw a dolphin with a mustache"}, +* {"text":"Make it photorealistic"} +* ], +* "cfg_scale":10, +* "seed":0, +* "steps":50 +* } TYPES: BEGIN OF prompt_ts, text TYPE /aws1/rt_shape_string, END OF prompt_ts. @@ -151,17 +151,17 @@ CLASS ZCL_AWS1_BDR_ACTIONS IMPLEMENTATION. iv_contenttype = 'application/json' ). - " Stable Diffusion Result Format: -* { -* "result": "success", -* "artifacts": [ -* { -* "seed": 0, -* "base64": "iVBORw0KGgoAAAANSUhEUgAAAgAAA.... -* "finishReason": "SUCCESS" -* } -* ] -* } + "Stable Diffusion Result Format: +* { +* "result": "success", +* "artifacts": [ +* { +* "seed": 0, +* "base64": "iVBORw0KGgoAAAANSUhEUgAAAgAAA.... +* "finishReason": "SUCCESS" +* } +* ] +* } TYPES: BEGIN OF artifact_ts, seed TYPE /aws1/rt_shape_integer, base64 TYPE /aws1/rt_shape_string, @@ -183,7 +183,7 @@ CLASS ZCL_AWS1_BDR_ACTIONS IMPLEMENTATION. CATCH /aws1/cx_bdraccessdeniedex INTO DATA(lo_ex). WRITE: / lo_ex->get_text( ). WRITE: / |Don't forget to enable model access at https://us-west-2.console.aws.amazon.com/bedrock/home?#/modelaccess|. - " catch other exceptions as desired... + "Catch other exceptions as desired... ENDTRY. "snippet-end:[bdr.abapv1.invokemodel_stable_diffusion] From dd816333291ab4054a0d28535a19b58d51e5af2c Mon Sep 17 00:00:00 2001 From: Laren-AWS <57545972+Laren-AWS@users.noreply.github.com> Date: Wed, 25 Oct 2023 14:20:49 -0700 Subject: [PATCH 7/9] Apply suggestions from code review --- .doc_gen/cross-content/phrases-code-examples.ent | 2 +- .doc_gen/metadata/bedrock-runtime_metadata.yaml | 6 +++--- .doc_gen/metadata/services.yaml | 4 ++-- sap-abap/services/bdr/package.devc.xml | 2 +- sap-abap/services/bdr/zcl_aws1_bdr_actions.clas.xml | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.doc_gen/cross-content/phrases-code-examples.ent b/.doc_gen/cross-content/phrases-code-examples.ent index 087d3baea48..f3ddc1b5997 100644 --- a/.doc_gen/cross-content/phrases-code-examples.ent +++ b/.doc_gen/cross-content/phrases-code-examples.ent @@ -74,4 +74,4 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/.doc_gen/metadata/bedrock-runtime_metadata.yaml b/.doc_gen/metadata/bedrock-runtime_metadata.yaml index 0932d3c154d..cab4c444dae 100644 --- a/.doc_gen/metadata/bedrock-runtime_metadata.yaml +++ b/.doc_gen/metadata/bedrock-runtime_metadata.yaml @@ -2,7 +2,7 @@ bedrock-runtime_InvokeModel: title: Invoke the specified &BR; model to run inference title_abbrev: Invoke a model - synopsis: invoke a &BR model. + synopsis: invoke an &BR; model to run inference. category: languages: SAP ABAP: @@ -10,10 +10,10 @@ bedrock-runtime_InvokeModel: - sdk_version: 1 github: sap-abap/services/bdr excerpts: - - description: Invoke a Claude V2 foundation model. This example uses features of /US2/CL_JSON which may not be available on some NetWeaver version. + - description: Invoke a Claude V2 foundation model. This example uses features of /US2/CL_JSON which might not be available on some NetWeaver versions. snippet_tags: - bdr.abapv1.invokemodel_claude_v2 - - description: Invoke a Stable Diffusion foundation model + - description: Invoke a Stable Diffusion foundation model. snippet_tags: - bdr.abapv1.invokemodel_stable_diffusion services: diff --git a/.doc_gen/metadata/services.yaml b/.doc_gen/metadata/services.yaml index 22b3c123b3d..7f19fe9f485 100644 --- a/.doc_gen/metadata/services.yaml +++ b/.doc_gen/metadata/services.yaml @@ -126,8 +126,8 @@ bedrock-runtime: sort: Bedrock Runtime expanded: long: Amazon Bedrock Runtime - short: Bedrock Runtime - blurb: enables you to run inference on models + short: Amazon Bedrock Runtime + blurb: is a fully managed service that makes it easy to use foundation models from third-party providers and Amazon. guide: subtitle: User Guide url: bedrock/latest/userguide/what-is-bedrock.html diff --git a/sap-abap/services/bdr/package.devc.xml b/sap-abap/services/bdr/package.devc.xml index d3699c350cb..e9b19bd8c4e 100644 --- a/sap-abap/services/bdr/package.devc.xml +++ b/sap-abap/services/bdr/package.devc.xml @@ -3,7 +3,7 @@ - Package for Bedrock Runtime + Package for Amazon Bedrock Runtime diff --git a/sap-abap/services/bdr/zcl_aws1_bdr_actions.clas.xml b/sap-abap/services/bdr/zcl_aws1_bdr_actions.clas.xml index 18780b8eee2..4d499f32d88 100644 --- a/sap-abap/services/bdr/zcl_aws1_bdr_actions.clas.xml +++ b/sap-abap/services/bdr/zcl_aws1_bdr_actions.clas.xml @@ -5,7 +5,7 @@ ZCL_AWS1_BDR_ACTIONS E - Bedrock Runtime Code Example Actions + Amazon Bedrock Runtime Code Example Actions 1 X X From 354ba6e0a700a3c27c041238a2809a39099ed966 Mon Sep 17 00:00:00 2001 From: Laren-AWS <57545972+Laren-AWS@users.noreply.github.com> Date: Wed, 25 Oct 2023 14:23:51 -0700 Subject: [PATCH 8/9] Update .doc_gen/metadata/bedrock-runtime_metadata.yaml --- .doc_gen/metadata/bedrock-runtime_metadata.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.doc_gen/metadata/bedrock-runtime_metadata.yaml b/.doc_gen/metadata/bedrock-runtime_metadata.yaml index cab4c444dae..96041b64390 100644 --- a/.doc_gen/metadata/bedrock-runtime_metadata.yaml +++ b/.doc_gen/metadata/bedrock-runtime_metadata.yaml @@ -17,4 +17,4 @@ bedrock-runtime_InvokeModel: snippet_tags: - bdr.abapv1.invokemodel_stable_diffusion services: - bedrock-runtime: {InvokeModel} \ No newline at end of file + bedrock-runtime: {InvokeModel} From d8dadea77a2a406ec80aeb6ccbc6cc80bd26b216 Mon Sep 17 00:00:00 2001 From: Laren-AWS <57545972+Laren-AWS@users.noreply.github.com> Date: Wed, 25 Oct 2023 14:29:01 -0700 Subject: [PATCH 9/9] Apply suggestions from code review --- .doc_gen/cross-content/phrases-code-examples.ent | 8 ++++++-- .doc_gen/metadata/services.yaml | 4 ++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.doc_gen/cross-content/phrases-code-examples.ent b/.doc_gen/cross-content/phrases-code-examples.ent index f3ddc1b5997..327eb0b3e66 100644 --- a/.doc_gen/cross-content/phrases-code-examples.ent +++ b/.doc_gen/cross-content/phrases-code-examples.ent @@ -72,6 +72,10 @@ - + - \ No newline at end of file + + + + + diff --git a/.doc_gen/metadata/services.yaml b/.doc_gen/metadata/services.yaml index 7f19fe9f485..808e7520fcc 100644 --- a/.doc_gen/metadata/services.yaml +++ b/.doc_gen/metadata/services.yaml @@ -121,8 +121,8 @@ batch: product_categories: {'Compute'} version: batch-2016-08-10 bedrock-runtime: - long: '&BRlong; Runtime' - short: '&BR; Runtime' + long: '&BRRUNlong;' + short: '&BRRUN;' sort: Bedrock Runtime expanded: long: Amazon Bedrock Runtime