From e073651a43946b2ec3471170fbb134301fcce67b Mon Sep 17 00:00:00 2001 From: Dennis Traub Date: Thu, 12 Sep 2024 12:27:28 +0200 Subject: [PATCH] Unify comments --- .../bedrock-runtime/BedrockRuntimeService.php | 57 +++++++++---------- .../GettingStartedWithBedrockRuntime.php | 10 ++-- php/example_code/bedrock-runtime/README.md | 10 ++-- php/example_code/bedrock-runtime/Runner.php | 1 - .../bedrock-runtime/composer.lock | 12 ++-- .../tests/BedrockRuntimeTests.php | 11 ++-- php/example_code/bedrock/BedrockService.php | 13 ++--- .../bedrock/GettingStartedWithBedrock.php | 9 ++- php/example_code/bedrock/README.md | 2 +- php/example_code/bedrock/Runner.php | 1 - php/example_code/bedrock/composer.lock | 12 ++-- .../bedrock/tests/BedrockBasicsTests.php | 11 ++-- 12 files changed, 69 insertions(+), 80 deletions(-) diff --git a/php/example_code/bedrock-runtime/BedrockRuntimeService.php b/php/example_code/bedrock-runtime/BedrockRuntimeService.php index f24c4e6c369..dc093b03c4d 100644 --- a/php/example_code/bedrock-runtime/BedrockRuntimeService.php +++ b/php/example_code/bedrock-runtime/BedrockRuntimeService.php @@ -1,10 +1,8 @@ $prompt, @@ -52,9 +50,9 @@ public function invokeClaude($prompt) return $completion; } - #snippet-end:[php.example_code.bedrock-runtime.service.invokeClaude] + // snippet-end:[php.example_code.bedrock-runtime.service.invokeClaude] - #snippet-start:[php.example_code.bedrock-runtime.service.invokeJurassic2] + // snippet-start:[php.example_code.bedrock-runtime.service.invokeJurassic2] public function invokeJurassic2($prompt) { # The different model providers have individual request and response formats. @@ -82,14 +80,14 @@ public function invokeJurassic2($prompt) return $completion; } - #snippet-end:[php.example_code.bedrock-runtime.service.invokeJurassic2] + // snippet-end:[php.example_code.bedrock-runtime.service.invokeJurassic2] - #snippet-start:[php.example_code.bedrock-runtime.service.invokeLlama2] + // snippet-start:[php.example_code.bedrock-runtime.service.invokeLlama2] public function invokeLlama2($prompt) { - # The different model providers have individual request and response formats. - # For the format, ranges, and default values for Meta Llama 2 Chat, refer to: - # https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters-meta.html + // The different model providers have individual request and response formats. + // For the format, ranges, and default values for Meta Llama 2 Chat, refer to: + // https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters-meta.html $completion = ""; try { @@ -112,14 +110,14 @@ public function invokeLlama2($prompt) return $completion; } - #snippet-end:[php.example_code.bedrock-runtime.service.invokeLlama2] + // snippet-end:[php.example_code.bedrock-runtime.service.invokeLlama2] - #snippet-start:[php.example_code.bedrock-runtime.service.invokeStableDiffusion] + // snippet-start:[php.example_code.bedrock-runtime.service.invokeStableDiffusion] public function invokeStableDiffusion(string $prompt, int $seed, string $style_preset) { - # The different model providers have individual request and response formats. - # For the format, ranges, and available style_presets of Stable Diffusion models refer to: - # https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters-stability-diffusion.html + // The different model providers have individual request and response formats. + // For the format, ranges, and available style_presets of Stable Diffusion models refer to: + // https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters-stability-diffusion.html $base64_image_data = ""; try { @@ -149,14 +147,14 @@ public function invokeStableDiffusion(string $prompt, int $seed, string $style_p return $base64_image_data; } - #snippet-end:[php.example_code.bedrock-runtime.service.invokeStableDiffusion] + // snippet-end:[php.example_code.bedrock-runtime.service.invokeStableDiffusion] - #snippet-start:[php.example_code.bedrock-runtime.service.invokeTitanImage] + // snippet-start:[php.example_code.bedrock-runtime.service.invokeTitanImage] public function invokeTitanImage(string $prompt, int $seed) { - # The different model providers have individual request and response formats. - # For the format, ranges, and default values for Titan Image models refer to: - # https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters-titan-image.html + // The different model providers have individual request and response formats. + // For the format, ranges, and default values for Titan Image models refer to: + // https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters-titan-image.html $base64_image_data = ""; try { @@ -188,7 +186,6 @@ public function invokeTitanImage(string $prompt, int $seed) return $base64_image_data; } - #snippet-end:[php.example_code.bedrock-runtime.service.invokeTitanImage] + // snippet-end:[php.example_code.bedrock-runtime.service.invokeTitanImage] } - -#snippet-end:[php.example_code.bedrock-runtime.service] +// snippet-end:[php.example_code.bedrock-runtime.service] diff --git a/php/example_code/bedrock-runtime/GettingStartedWithBedrockRuntime.php b/php/example_code/bedrock-runtime/GettingStartedWithBedrockRuntime.php index 2ae6c4a668b..fb27160ce76 100644 --- a/php/example_code/bedrock-runtime/GettingStartedWithBedrockRuntime.php +++ b/php/example_code/bedrock-runtime/GettingStartedWithBedrockRuntime.php @@ -1,7 +1,6 @@ diff --git a/php/example_code/bedrock-runtime/Runner.php b/php/example_code/bedrock-runtime/Runner.php index 101f66c43ad..eb1ecaee049 100644 --- a/php/example_code/bedrock-runtime/Runner.php +++ b/php/example_code/bedrock-runtime/Runner.php @@ -1,5 +1,4 @@ listFoundationModels(); return $response['modelSummaries']; } - #snippet-end:[php.example_code.bedrock.service.listFoundationModels] + // snippet-end:[php.example_code.bedrock.service.listFoundationModels] } -#snippet-end:[php.example_code.bedrock.service] +// snippet-end:[php.example_code.bedrock.service] diff --git a/php/example_code/bedrock/GettingStartedWithBedrock.php b/php/example_code/bedrock/GettingStartedWithBedrock.php index 0995edb5429..8d78bfdb563 100644 --- a/php/example_code/bedrock/GettingStartedWithBedrock.php +++ b/php/example_code/bedrock/GettingStartedWithBedrock.php @@ -1,7 +1,6 @@ diff --git a/php/example_code/bedrock/Runner.php b/php/example_code/bedrock/Runner.php index cf6c71b491e..1d3e21b97ac 100644 --- a/php/example_code/bedrock/Runner.php +++ b/php/example_code/bedrock/Runner.php @@ -1,5 +1,4 @@