Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Go v2 Add Bedrock Runtime Titan Text example #6189

Merged
merged 13 commits into from Apr 24, 2024
8 changes: 8 additions & 0 deletions .doc_gen/metadata/bedrock-runtime_metadata.yaml
Expand Up @@ -92,6 +92,14 @@ bedrock-runtime_InvokeAmazonTitanImageGeneratorForTextGeneration:
- description: Asynchronously invoke the Amazon Titan Text G1 foundation model to generate text.
snippet_tags:
- BedrockRuntime.dotnetv3.BedrockRuntimeActions.InvokeModelAsync.TitanTextG1
Go:
versions:
- sdk_version: 2
github: gov2/bedrock-runtime
excerpts:
- description: Invoke the Amazon Titan Text G1 foundation model to generate text.
snippet_tags:
- gov2.bedrock-runtime.InvokeTitanText
services:
bedrock-runtime: {InvokeModel}

Expand Down
9 changes: 5 additions & 4 deletions gov2/bedrock-runtime/README.md
Expand Up @@ -27,7 +27,6 @@ For prerequisites, see the [README](../README.md#Prerequisites) in the `gov2` fo


<!--custom.prerequisites.start-->
> ⚠ You must request access to a model before you can use it. If you try to use the model (with the API or console) before you have requested access to it, you will receive an error message. For more information, see [Model access](https://docs.aws.amazon.com/bedrock/latest/userguide/model-access.html).
Laren-AWS marked this conversation as resolved.
Show resolved Hide resolved
<!--custom.prerequisites.end-->

### Get started
Expand All @@ -39,11 +38,12 @@ For prerequisites, see the [README](../README.md#Prerequisites) in the `gov2` fo

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

- [Image generation with Amazon Titan Image Generator G1](actions/invoke_model.go#L178) (`InvokeModel`)
- [Text generation with AI21 Labs Jurassic-2](actions/invoke_model.go#L78) (`InvokeModel`)
- [Image generation with Amazon Titan Image Generator G1](actions/invoke_model.go#L191) (`InvokeModel`)
ford-at-aws marked this conversation as resolved.
Show resolved Hide resolved
- [Text generation with AI21 Labs Jurassic-2](actions/invoke_model.go#L83) (`InvokeModel`)
- [Text generation with Amazon Titan Text G1](actions/invoke_model.go#L261) (`InvokeModel`)
- [Text generation with Anthropic Claude 2](actions/invoke_model.go#L27) (`InvokeModel`)
- [Text generation with Anthropic Claude 2 with a response stream](actions/invoke_model_with_response_stream.go#L30) (`InvokeModelWithResponseStream`)
- [Text generation with Meta Llama 2 Chat](actions/invoke_model.go#L130) (`InvokeModel`)
- [Text generation with Meta Llama 2 Chat](actions/invoke_model.go#L140) (`InvokeModel`)

### Scenarios

Expand All @@ -54,6 +54,7 @@ functions within the same service.


<!--custom.examples.start-->
> ⚠ You must request access to a model before you can use it. If you try to use the model (with the API or console) before you have requested access to it, you will receive an error message. For more information, see [Model access](https://docs.aws.amazon.com/bedrock/latest/userguide/model-access.html).
<!--custom.examples.end-->

## Run the examples
Expand Down