Skip to content

Commit

Permalink
Merge branch 'main' into deprecate_credential-provider-cognito-identity
Browse files Browse the repository at this point in the history
  • Loading branch information
ypliu-AWS authored Nov 16, 2023
2 parents a97108a + 9f08f27 commit bdd54ee
Show file tree
Hide file tree
Showing 149 changed files with 2,904 additions and 260 deletions.
23 changes: 23 additions & 0 deletions .doc_gen/cross-content/cross_FMPlayground_Java_block.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "file://zonbook/docbookx.dtd" [
<!ENTITY % phrases-shared SYSTEM "file://AWSShared/common/phrases-shared.ent">
%phrases-shared;
]>
<block>
<para>
The Java Foundation Model (FM) Playground is a Spring Boot sample application that showcases how to use &BRlong; with Java. This example shows how Java developers can use &BR; to build generative AI-enabled applications. You can test and interact with &BR; foundation models by using the following three playgrounds:
</para>
<itemizedlist>
<listitem>
<para>A text playground.</para>
</listitem>
<listitem>
<para>A chat playground.</para>
</listitem>
<listitem>
<para>An image playground.</para>
</listitem>
</itemizedlist>
<para>The example also lists and displays the foundation models you have access to, along with their characteristics. For source code and deployment instructions, see the project in <ulink url="https://github.com/build-on-aws/java-fm-playground">GitHub</ulink>.
</para>
</block>
23 changes: 23 additions & 0 deletions .doc_gen/cross-content/cross_FMPlayground_Python_block.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "file://zonbook/docbookx.dtd" [
<!ENTITY % phrases-shared SYSTEM "file://AWSShared/common/phrases-shared.ent">
%phrases-shared;
]>
<block>
<para>
The Python Foundation Model (FM) Playground is a Python/FastAPI sample application that showcases how to use &BRlong; with Python. This example shows how Python developers can use &BR; to build generative AI-enabled applications. You can test and interact with &BR; foundation models by using the following three playgrounds:
</para>
<itemizedlist>
<listitem>
<para>A text playground.</para>
</listitem>
<listitem>
<para>A chat playground.</para>
</listitem>
<listitem>
<para>An image playground.</para>
</listitem>
</itemizedlist>
<para>The example also lists and displays the foundation models you have access to, along with their characteristics. For source code and deployment instructions, see the project in <ulink url="https://github.com/build-on-aws/python-fm-playground">GitHub</ulink>.
</para>
</block>
127 changes: 127 additions & 0 deletions .doc_gen/metadata/bedrock-runtime_metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,130 @@ bedrock-runtime_InvokeModel:
- bdr.abapv1.invokemodel_stable_diffusion
services:
bedrock-runtime: {InvokeModel}

bedrock-runtime_InvokeClaude:
title: Invoke the Anthropic Claude model on &BR; to run an inference
title_abbrev: Invoke Anthropic Claude 2 on &BR;
synopsis: invoke the anthropic claude model on &BR; to run inference.
category:
languages:
Java:
versions:
- sdk_version: 2
github: javav2/example_code/bedrock-runtime
excerpts:
- description: Invoke the Anthropic Claude 2 foundation model.
snippet_tags:
- bedrock-runtime.java2.invoke_claude.main
Python:
versions:
- sdk_version: 3
github: python/example_code/bedrock-runtime
excerpts:
- description: Invoke the Anthropic Claude 2 foundation model.
snippet_tags:
- python.example_code.bedrock-runtime.InvokeAnthropicClaude
services:
bedrock-runtime: {InvokeModel}

bedrock-runtime_InvokeJurassic2:
title: Invoke the AI21 Labs Jurassic-2 model on &BR; to run an inference
title_abbrev: Invoke AI21 Labs Jurassic-2 on &BR;
synopsis: invoke the ai21 labs jurassic-2 model on &BR; to run inference.
category:
languages:
Java:
versions:
- sdk_version: 2
github: javav2/example_code/bedrock-runtime
excerpts:
- description: Invoke the AI21 Labs Jurassic-2 foundation model.
snippet_tags:
- bedrock-runtime.java2.invoke_jurassic2.main
Python:
versions:
- sdk_version: 3
github: python/example_code/bedrockruntime
sdkguide:
excerpts:
- description: Invoke the AI 21 Labs Jurassic-2 foundation model.
snippet_tags:
- python.example_code.bedrock-runtime.InvokeAi21Jurassic2
services:
bedrock-runtime: {InvokeModel}

bedrock-runtime_InvokeLlama2:
title: Invoke the Meta Llama 2 Chat model on &BR; to run an inference
title_abbrev: Invoke Meta Llama 2 on &BR;
synopsis: invoke the Meta Llama 2 Chat model on &BR; to run inference.
category:
languages:
Java:
versions:
- sdk_version: 2
github: javav2/example_code/bedrock-runtime
excerpts:
- description: Invoke the Meta Llama 2 foundation model.
snippet_tags:
- bedrock-runtime.java2.invoke_llama2.main
Python:
versions:
- sdk_version: 3
github: python/example_code/bedrockruntime
sdkguide:
excerpts:
- description: Invoke the AI 21 Labs Jurassic-2 foundation model.
snippet_tags:
- python.example_code.bedrock-runtime.InvokeMetaLlama2
services:
bedrock-runtime: {InvokeModel}

bedrock-runtime_InvokeStableDiffusion:
title: Invoke the Stability.ai Stable Diffusion XL model on &BR; to run an inference
title_abbrev: Invoke Stability.ai Stable Diffusion XL on &BR;
synopsis: invoke the stability.ai stable diffusion xl on &BR; model to run inference.
category:
languages:
Java:
versions:
- sdk_version: 2
github: javav2/example_code/bedrock-runtime
excerpts:
- description: Invoke the Stability.ai Stable Diffusion XL foundation model.
snippet_tags:
- bedrock-runtime.java2.invoke_stable_diffusion.main
Python:
versions:
- sdk_version: 3
github: python/example_code/bedrock-runtime
excerpts:
- description: Invoke the Stability.ai Stable Diffusion foundation model.
snippet_tags:
- python.example_code.bedrock-runtime.InvokeStableDiffusion
services:
bedrock-runtime: {InvokeModel}

bedrock-runtime_InvokeModelWithResponseStream:
title: Invoke the specified model on &BR; to run an inference with a response stream
title_abbrev: Invoke a model on &BR; with a response stream
synopsis: invoke an model on &BR; to run an inference with a response stream.
category:
languages:
Java:
versions:
- sdk_version: 2
github: javav2/example_code/bedrock-runtime
excerpts:
- description: Invoke a model on &BR; and process the response stream.
snippet_tags:
- bedrock-runtime.java2.invoke_model_with_response_stream.main
Python:
versions:
- sdk_version: 3
github: python/example_code/bedrock-runtime
excerpts:
- description: Invoke a model on &BR; and process the response stream.
snippet_tags:
- python.example_code.bedrock-runtime.InvokeModelWithResponseStream
services:
bedrock-runtime: {InvokeModelWithResponseStream}
51 changes: 51 additions & 0 deletions .doc_gen/metadata/bedrock_metadata.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# zexi 0.4.0
bedrock_Hello:
title: Hello &BR;
title_abbrev: Hello &BR;
synopsis: get started using &BR;.
category: Hello
languages:
Go:
versions:
- sdk_version: 2
github: gov2/bedrock
excerpts:
- description:
snippet_tags:
- gov2.bedrock.Hello
services:
bedrock: {ListFoundationModels}

bedrock_ListFoundationModels:
title: List the available &BRlong; foundation models using an &AWS; SDK
title_abbrev: List available &BR; foundation models
synopsis: list available &BR; foundation models.
category:
languages:
Go:
versions:
- sdk_version: 2
github: gov2/bedrock
excerpts:
- description: List the available Bedrock foundation models.
snippet_tags:
- gov2.bedrock.FoundationModelWrapper.struct
- gov2.bedrock.ListFoundationModels
Java:
versions:
- sdk_version: 2
github: javav2/example_code/bedrock
excerpts:
- description: List the available &BRlong; foundation models.
snippet_tags:
- bedrock.java2.list_foundation_models.main
Python:
versions:
- sdk_version: 3
github: python/example_code/bedrock
excerpts:
- description: List the available &BRlong; foundation models.
snippet_tags:
- python.example_code.bedrock.ListFoundationModels
services:
bedrock: {ListFoundationModels}
8 changes: 8 additions & 0 deletions .doc_gen/metadata/cross_metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -704,6 +704,14 @@ cross_FMPlayground:
versions:
- sdk_version: 3
block_content: cross_FMPlayground_NetV3_block.xml
Java:
versions:
- sdk_version: 2
block_content: cross_FMPlayground_Java_block.xml
Python:
versions:
- sdk_version: 3
block_content: cross_FMPlayground_Python_block.xml
service_main: bedrock-runtime
services:
bedrock-runtime:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/super-linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,4 @@ jobs:
VALIDATE_RUBY: true
VALIDATE_KOTLIN: true
VALIDATE_EDITORCONFIG: true
VALIDATE_BASH: true
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
.DS_Store
._*
.idea
*.iml
.metadata
.phpunit.result.cache
.recommenders
Expand Down
4 changes: 4 additions & 0 deletions aws-cli/bash-linux/.shellcheckrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Look for 'source'd files relative to the checked script.
source-path=SCRIPTDIR
source-path=SCRIPTDIR/..
source-path=aws-cli/bash-linux/s3/bucket-lifecycle-operations
1 change: 1 addition & 0 deletions aws-cli/bash-linux/dynamodb/dynamodb_operations.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#
###############################################################################


source ./awsdocs_general.sh

# snippet-start:[aws-cli.bash-linux.dynamodb.CreateTable]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,7 @@ function echo_repeat() {
# 1 - If an error occurred.
###############################################################################
function dynamodb_getting_started_movies() {

source ./dynamodb_operations.sh

key_schema_json_file="dynamodb_key_schema.json"
Expand Down
26 changes: 14 additions & 12 deletions aws-cli/bash-linux/dynamodb/tests/test_dynamodb_examples.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ function main() {
local current_directory
current_directory=$(pwd)
cd ..

source ./dynamodb_operations.sh

source ./scenario_getting_started_movies.sh
# shellcheck disable=SC2164
cd "$current_directory"
Expand Down Expand Up @@ -127,7 +129,7 @@ function main() {
"dynamodb_describe_table -n $test_table_name " \
0

if [[ "$test_command_response" != "ACTIVE" ]]; then
if [[ "$test_command_response" != "ACTIVE" ]]; then
test_failed "Table is not active."
return 1
fi
Expand Down Expand Up @@ -216,8 +218,8 @@ function main() {

test_count=$((test_count + 1))
echo -n "Running test $test_count: Querying table without projection expression..."
local response
response=$(dynamodb_query -n "$test_table_name" -k "#n=:v" -a "$test_attribute_names_json_file" -v "$test_attributes_values_json_file")

dynamodb_query -n "$test_table_name" -k "#n=:v" -a "$test_attribute_names_json_file" -v "$test_attributes_values_json_file"
local error_code=${?}

if [[ $error_code -ne 0 ]]; then
Expand All @@ -229,9 +231,8 @@ function main() {

test_count=$((test_count + 1))
echo -n "Running test $test_count: Querying table with projection expression..."
local response
response=$(dynamodb_query -n "$test_table_name" -k "#n=:v" -a "$test_attribute_names_json_file" \
-v "$test_attributes_values_json_file" -p "title,info.plot")
dynamodb_query -n "$test_table_name" -k "#n=:v" -a "$test_attribute_names_json_file" \
-v "$test_attributes_values_json_file" -p "title,info.plot"
local error_code=${?}

if [[ $error_code -ne 0 ]]; then
Expand All @@ -251,8 +252,8 @@ function main() {

test_count=$((test_count + 1))
echo -n "Running test $test_count: Scanning table without projection expression..."
local response
response=$(dynamodb_scan -n "$test_table_name" -f "contains(#n,:v1)" -a "$test_attribute_names_json_file" -v "$test_attributes_values_json_file")

dynamodb_scan -n "$test_table_name" -f "contains(#n,:v1)" -a "$test_attribute_names_json_file" -v "$test_attributes_values_json_file"
local error_code=${?}

if [[ $error_code -ne 0 ]]; then
Expand All @@ -264,9 +265,9 @@ function main() {

test_count=$((test_count + 1))
echo -n "Running test $test_count: Scanning table with projection expression..."
local response
response=$(dynamodb_scan -n "$test_table_name" -f "contains(#n,:v1)" -a "$test_attribute_names_json_file" \
-v "$test_attributes_values_json_file" -p "title,info.plot")

dynamodb_scan -n "$test_table_name" -f "contains(#n,:v1)" -a "$test_attribute_names_json_file" \
-v "$test_attributes_values_json_file" -p "title,info.plot"
local error_code=${?}

if [[ $error_code -ne 0 ]]; then
Expand Down Expand Up @@ -300,7 +301,7 @@ function main() {
"dynamodb_batch_get_item -i $test_requested_values_json_file " \
0

skip_tests=false
export skip_tests=false
run_test " deleting table" \
"dynamodb_delete_table -n $test_table_name " \
0
Expand Down Expand Up @@ -364,6 +365,7 @@ function main() {
rm "$test_requested_values_json_file"

echo "$test_succeeded_count tests completed successfully."

echo "$test_failed_count tests failed."
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ function sts_assume_role() {
function iam_create_user_assume_role() {
{
if [ "$IAM_OPERATIONS_SOURCED" != "True" ]; then
# shellcheck disable=SC1091

source ./iam_operations.sh
fi
}
Expand Down
2 changes: 1 addition & 1 deletion aws-cli/bash-linux/iam/iam_operations.sh
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ function iam_user_exists() {
###############################################################################
function iam_list_users() {
local option OPTARG # Required to use getopts command in a function.
local all_users error_code
local error_code
# bashsupport disable=BP5008
function usage() {
echo "function iam_list_users"
Expand Down
2 changes: 2 additions & 0 deletions aws-cli/bash-linux/iam/tests/test_iam_examples.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ function main() {
local current_directory
current_directory=$(pwd)
cd ..

source ./iam_operations.sh

source ./iam_create_user_assume_role_scenario.sh
# shellcheck disable=SC2164
cd "$current_directory"
Expand Down
Loading

0 comments on commit bdd54ee

Please sign in to comment.