Skip to content

Commit

Permalink
Go v2 Add Bedrock Runtime Titan Text example (#6189)
Browse files Browse the repository at this point in the history
  • Loading branch information
abhirockzz committed Apr 24, 2024
1 parent f0f7338 commit 50c96af
Show file tree
Hide file tree
Showing 5 changed files with 233 additions and 103 deletions.
8 changes: 8 additions & 0 deletions .doc_gen/metadata/bedrock-runtime_metadata.yaml
Expand Up @@ -100,6 +100,14 @@ bedrock-runtime_InvokeAmazonTitanForTextGeneration:
- 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).
<!--custom.prerequisites.end-->

### Get started
Expand All @@ -43,14 +42,16 @@ functions within the same service.

### Invoke model examples

- [AI21 Labs Jurassic-2: Text generation](actions/invoke_model.go#L78)
- [Amazon Titan: Image generation](actions/invoke_model.go#L178)
- [AI21 Labs Jurassic-2: Text generation](actions/invoke_model.go#L83)
- [Amazon Titan: Image generation](actions/invoke_model.go#L191)
- [Amazon Titan: Text generation](actions/invoke_model.go#L261)
- [Anthropic Claude 2: Real-time response stream processing](actions/invoke_model_with_response_stream.go#L30)
- [Anthropic Claude 2: Text generation](actions/invoke_model.go#L27)
- [Meta Llama 2: Text generation](actions/invoke_model.go#L130)
- [Meta Llama 2: Text generation](actions/invoke_model.go#L140)


<!--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

0 comments on commit 50c96af

Please sign in to comment.