Skip to content

Commit e073651

Browse files
Dennis TraubDennisTraub
authored andcommitted
Unify comments
1 parent 81afcb9 commit e073651

File tree

12 files changed

+69
-80
lines changed

12 files changed

+69
-80
lines changed

php/example_code/bedrock-runtime/BedrockRuntimeService.php

Lines changed: 27 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
<?php
2+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3+
// SPDX-License-Identifier: Apache-2.0
24

3-
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
4-
# SPDX-License-Identifier: Apache-2.0
5-
6-
#snippet-start:[php.example_code.bedrock-runtime.service]
7-
5+
// snippet-start:[php.example_code.bedrock-runtime.service]
86
namespace BedrockRuntime;
97

108
use Aws\BedrockRuntime\BedrockRuntimeClient;
@@ -21,17 +19,17 @@ public function __construct()
2119
]);
2220
}
2321

24-
#snippet-start:[php.example_code.bedrock-runtime.service.invokeClaude]
22+
// snippet-start:[php.example_code.bedrock-runtime.service.invokeClaude]
2523
public function invokeClaude($prompt)
2624
{
27-
# The different model providers have individual request and response formats.
28-
# For the format, ranges, and default values for Anthropic Claude, refer to:
29-
# https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters-claude.html
25+
// The different model providers have individual request and response formats.
26+
// For the format, ranges, and default values for Anthropic Claude, refer to:
27+
// https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters-claude.html
3028

3129
$completion = "";
3230
try {
3331
$modelId = 'anthropic.claude-v2';
34-
# Claude requires you to enclose the prompt as follows:
32+
// Claude requires you to enclose the prompt as follows:
3533
$prompt = "\n\nHuman: {$prompt}\n\nAssistant:";
3634
$body = [
3735
'prompt' => $prompt,
@@ -52,9 +50,9 @@ public function invokeClaude($prompt)
5250

5351
return $completion;
5452
}
55-
#snippet-end:[php.example_code.bedrock-runtime.service.invokeClaude]
53+
// snippet-end:[php.example_code.bedrock-runtime.service.invokeClaude]
5654

57-
#snippet-start:[php.example_code.bedrock-runtime.service.invokeJurassic2]
55+
// snippet-start:[php.example_code.bedrock-runtime.service.invokeJurassic2]
5856
public function invokeJurassic2($prompt)
5957
{
6058
# The different model providers have individual request and response formats.
@@ -82,14 +80,14 @@ public function invokeJurassic2($prompt)
8280

8381
return $completion;
8482
}
85-
#snippet-end:[php.example_code.bedrock-runtime.service.invokeJurassic2]
83+
// snippet-end:[php.example_code.bedrock-runtime.service.invokeJurassic2]
8684

87-
#snippet-start:[php.example_code.bedrock-runtime.service.invokeLlama2]
85+
// snippet-start:[php.example_code.bedrock-runtime.service.invokeLlama2]
8886
public function invokeLlama2($prompt)
8987
{
90-
# The different model providers have individual request and response formats.
91-
# For the format, ranges, and default values for Meta Llama 2 Chat, refer to:
92-
# https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters-meta.html
88+
// The different model providers have individual request and response formats.
89+
// For the format, ranges, and default values for Meta Llama 2 Chat, refer to:
90+
// https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters-meta.html
9391

9492
$completion = "";
9593
try {
@@ -112,14 +110,14 @@ public function invokeLlama2($prompt)
112110

113111
return $completion;
114112
}
115-
#snippet-end:[php.example_code.bedrock-runtime.service.invokeLlama2]
113+
// snippet-end:[php.example_code.bedrock-runtime.service.invokeLlama2]
116114

117-
#snippet-start:[php.example_code.bedrock-runtime.service.invokeStableDiffusion]
115+
// snippet-start:[php.example_code.bedrock-runtime.service.invokeStableDiffusion]
118116
public function invokeStableDiffusion(string $prompt, int $seed, string $style_preset)
119117
{
120-
# The different model providers have individual request and response formats.
121-
# For the format, ranges, and available style_presets of Stable Diffusion models refer to:
122-
# https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters-stability-diffusion.html
118+
// The different model providers have individual request and response formats.
119+
// For the format, ranges, and available style_presets of Stable Diffusion models refer to:
120+
// https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters-stability-diffusion.html
123121

124122
$base64_image_data = "";
125123
try {
@@ -149,14 +147,14 @@ public function invokeStableDiffusion(string $prompt, int $seed, string $style_p
149147

150148
return $base64_image_data;
151149
}
152-
#snippet-end:[php.example_code.bedrock-runtime.service.invokeStableDiffusion]
150+
// snippet-end:[php.example_code.bedrock-runtime.service.invokeStableDiffusion]
153151

154-
#snippet-start:[php.example_code.bedrock-runtime.service.invokeTitanImage]
152+
// snippet-start:[php.example_code.bedrock-runtime.service.invokeTitanImage]
155153
public function invokeTitanImage(string $prompt, int $seed)
156154
{
157-
# The different model providers have individual request and response formats.
158-
# For the format, ranges, and default values for Titan Image models refer to:
159-
# https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters-titan-image.html
155+
// The different model providers have individual request and response formats.
156+
// For the format, ranges, and default values for Titan Image models refer to:
157+
// https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters-titan-image.html
160158

161159
$base64_image_data = "";
162160
try {
@@ -188,7 +186,6 @@ public function invokeTitanImage(string $prompt, int $seed)
188186

189187
return $base64_image_data;
190188
}
191-
#snippet-end:[php.example_code.bedrock-runtime.service.invokeTitanImage]
189+
// snippet-end:[php.example_code.bedrock-runtime.service.invokeTitanImage]
192190
}
193-
194-
#snippet-end:[php.example_code.bedrock-runtime.service]
191+
// snippet-end:[php.example_code.bedrock-runtime.service]

php/example_code/bedrock-runtime/GettingStartedWithBedrockRuntime.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
<?php
2-
3-
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
4-
# SPDX-License-Identifier: Apache-2.0
2+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3+
// SPDX-License-Identifier: Apache-2.0
54

65
/**
76
* Purpose
87
* Shows how to use the AWS SDK for PHP with the Amazon Bedrock Runtime to:
98
* - ...
109
**/
1110

12-
# snippet-start:[php.example_code.bedrock-runtime.basics.scenario]
11+
// snippet-start:[php.example_code.bedrock-runtime.basics.scenario]
1312
namespace BedrockRuntime;
1413

1514
class GettingStartedWithBedrockRuntime
@@ -66,5 +65,4 @@ private function saveImage($base64_image_data, $model_id): string
6665
return $file_path;
6766
}
6867
}
69-
70-
# snippet-end:[php.example_code.bedrock-runtime.basics.scenario]
68+
// snippet-end:[php.example_code.bedrock-runtime.basics.scenario]

php/example_code/bedrock-runtime/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,23 +44,23 @@ functions within the same service.
4444

4545
### AI21 Labs Jurassic-2
4646

47-
- [InvokeModel](BedrockRuntimeService.php#L57)
47+
- [InvokeModel](BedrockRuntimeService.php#L55)
4848

4949
### Amazon Titan Image Generator
5050

51-
- [InvokeModel](BedrockRuntimeService.php#L154)
51+
- [InvokeModel](BedrockRuntimeService.php#L152)
5252

5353
### Anthropic Claude
5454

55-
- [InvokeModel](BedrockRuntimeService.php#L24)
55+
- [InvokeModel](BedrockRuntimeService.php#L22)
5656

5757
### Meta Llama
5858

59-
- [InvokeModel: Llama 2](BedrockRuntimeService.php#L87)
59+
- [InvokeModel: Llama 2](BedrockRuntimeService.php#L85)
6060

6161
### Stable Diffusion
6262

63-
- [InvokeModel](BedrockRuntimeService.php#L117)
63+
- [InvokeModel](BedrockRuntimeService.php#L115)
6464

6565

6666
<!--custom.examples.start-->

php/example_code/bedrock-runtime/Runner.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
<?php
2-
32
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
43
// SPDX-License-Identifier: Apache-2.0
54

php/example_code/bedrock-runtime/composer.lock

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

php/example_code/bedrock-runtime/tests/BedrockRuntimeTests.php

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
<?php
2+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3+
// SPDX-License-Identifier: Apache-2.0
24

3-
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
4-
# SPDX-License-Identifier: Apache-2.0
5-
6-
#
7-
# Integration tests for the Amazon Bedrock Runtime service.
8-
#
5+
/**
6+
* Integration tests for the Amazon Bedrock Runtime service.
7+
*/
98

109
namespace bedrockruntime\tests;
1110

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
11
<?php
2+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3+
// SPDX-License-Identifier: Apache-2.0
24

3-
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
4-
# SPDX-License-Identifier: Apache-2.0
5-
6-
#snippet-start:[php.example_code.bedrock.service]
5+
// snippet-start:[php.example_code.bedrock.service]
76
namespace Bedrock;
87

98
use Aws\Bedrock\BedrockClient;
109
use AwsUtilities\AWSServiceClass;
1110

1211
class BedrockService extends AWSServiceClass
1312
{
14-
#snippet-start:[php.example_code.bedrock.service.listFoundationModels]
13+
// snippet-start:[php.example_code.bedrock.service.listFoundationModels]
1514
public function listFoundationModels()
1615
{
1716
$bedrockClient = new BedrockClient([
@@ -21,6 +20,6 @@ public function listFoundationModels()
2120
$response = $bedrockClient->listFoundationModels();
2221
return $response['modelSummaries'];
2322
}
24-
#snippet-end:[php.example_code.bedrock.service.listFoundationModels]
23+
// snippet-end:[php.example_code.bedrock.service.listFoundationModels]
2524
}
26-
#snippet-end:[php.example_code.bedrock.service]
25+
// snippet-end:[php.example_code.bedrock.service]

php/example_code/bedrock/GettingStartedWithBedrock.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
<?php
2-
3-
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
4-
# SPDX-License-Identifier: Apache-2.0
2+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3+
// SPDX-License-Identifier: Apache-2.0
54

65
/**
76
* Purpose
87
* Shows how to use the AWS SDK for PHP with Amazon Bedrock to:
98
* List information about the available foundation models.
109
**/
1110

12-
# snippet-start:[php.example_code.bedrock.basics.scenario]
11+
// snippet-start:[php.example_code.bedrock.basics.scenario]
1312
namespace Bedrock;
1413

1514
class GettingStartedWithBedrock
@@ -38,4 +37,4 @@ public function runExample()
3837
}
3938
}
4039
}
41-
# snippet-end:[php.example_code.bedrock.basics.scenario]
40+
// snippet-end:[php.example_code.bedrock.basics.scenario]

php/example_code/bedrock/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ For prerequisites, see the [README](../../README.md#Prerequisites) in the `php`
4040

4141
Code excerpts that show you how to call individual service functions.
4242

43-
- [ListFoundationModels](BedrockService.php#L14)
43+
- [ListFoundationModels](BedrockService.php#L13)
4444

4545

4646
<!--custom.examples.start-->

php/example_code/bedrock/Runner.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
<?php
2-
32
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
43
// SPDX-License-Identifier: Apache-2.0
54

0 commit comments

Comments
 (0)