Skip to content

Commit

Permalink
Add metadata and generate docs
Browse files Browse the repository at this point in the history
  • Loading branch information
DennisTraub authored and ford-at-aws committed Feb 21, 2024
1 parent ad8dcff commit 3dd8268
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 11 deletions.
8 changes: 8 additions & 0 deletions .doc_gen/metadata/bedrock_metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,14 @@ bedrock_GetFoundationModel:
- description: Get details about a foundation model.
snippet_files:
- javascriptv3/example_code/bedrock/actions/get-foundation-model.js
Python:
versions:
- sdk_version: 3
github: python/example_code/bedrock
excerpts:
- description: Get details about a foundation model.
snippet_tags:
- python.example_code.bedrock.GetFoundationModel
services:
bedrock: {GetFoundationModel}

Expand Down
3 changes: 2 additions & 1 deletion python/example_code/bedrock/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ python -m pip install -r requirements.txt

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

- [List available Amazon Bedrock foundation models](bedrock_wrapper.py#L33) (`ListFoundationModels`)
- [Get details about an Amazon Bedrock foundation model](bedrock_wrapper.py#L33) (`GetFoundationModel`)
- [List available Amazon Bedrock foundation models](bedrock_wrapper.py#L51) (`ListFoundationModels`)


<!--custom.examples.start-->
Expand Down
19 changes: 9 additions & 10 deletions python/example_code/bedrock/bedrock_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ def list_foundation_models(self):
# snippet-end:[python.example_code.bedrock.ListFoundationModels]



# snippet-end:[python.example_code.bedrock.BedrockWrapper.class]


Expand Down Expand Up @@ -110,16 +109,16 @@ def usage_demo():

def print_model_details(model):
print("\n" + "=" * 42)
print(f" Model: {model["modelId"]}")
print(f' Model: {model["modelId"]}')
print("-" * 42)
print(f" Name: {model["modelName"]}")
print(f" Provider: {model["providerName"]}")
print(f" Model ARN: {model["modelArn"]}")
print(f" Lifecycle status: {model["modelLifecycle"]["status"]}")
print(f" Input modalities: {model["inputModalities"]}")
print(f" Output modalities: {model["outputModalities"]}")
print(f" Supported customizations: {model["customizationsSupported"]}")
print(f" Supported inference types: {model["inferenceTypesSupported"]}")
print(f' Name: {model["modelName"]}')
print(f' Provider: {model["providerName"]}')
print(f' Model ARN: {model["modelArn"]}')
print(f' Lifecycle status: {model["modelLifecycle"]["status"]}')
print(f' Input modalities: {model["inputModalities"]}')
print(f' Output modalities: {model["outputModalities"]}')
print(f' Supported customizations: {model["customizationsSupported"]}')
print(f' Supported inference types: {model["inferenceTypesSupported"]}')
if "responseStreamingSupported" in model:
print(f' Response streaming supported: {model["responseStreamingSupported"]}')

Expand Down

0 comments on commit 3dd8268

Please sign in to comment.