Skip to content

Commit

Permalink
Bedrock Runtime: Replace documentation links (#6040)
Browse files Browse the repository at this point in the history
* Switch documentation links for Claude, Jurassic-2, and Stable Diffusion to docs.aws.amazon.com/...
  • Loading branch information
DennisTraub authored Feb 5, 2024
1 parent 2660c14 commit 4b0bd9a
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 18 deletions.
4 changes: 2 additions & 2 deletions gov2/bedrock-runtime/actions/invoke_model.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ type InvokeModelWrapper struct {

// Each model provider has their own individual request and response formats.
// For the format, ranges, and default values for Anthropic Claude, refer to:
// https://docs.anthropic.com/claude/reference/complete_post
// https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters-claude.html

type ClaudeRequest struct {
Prompt string `json:"prompt"`
Expand Down Expand Up @@ -79,7 +79,7 @@ func (wrapper InvokeModelWrapper) InvokeClaude(prompt string) (string, error) {

// Each model provider has their own individual request and response formats.
// For the format, ranges, and default values for AI21 Labs Jurassic-2, refer to:
// https://docs.ai21.com/reference/j2-complete-ref
// https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters-jurassic2.html

type Jurassic2Request struct {
Prompt string `json:"prompt"`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export const invokeClaude = async (prompt) => {

/* The different model providers have individual request and response formats.
* For the format, ranges, and default values for Anthropic Claude, refer to:
* https://docs.anthropic.com/claude/reference/complete_post
* https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters-claude.html
*/
const payload = {
prompt: enclosedPrompt,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export const invokeJurassic2 = async (prompt) => {

/* The different model providers have individual request and response formats.
* For the format, ranges, and default values for AI21 Labs Jurassic-2, refer to:
* https://docs.ai21.com/reference/j2-complete-ref
* https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters-jurassic2.html
*/
const payload = {
prompt,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public static String invokeClaude(String prompt) {
/*
* The different model providers have individual request and response formats.
* For the format, ranges, and default values for Anthropic Claude, refer to:
* https://docs.anthropic.com/claude/reference/complete_post
* https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters-claude.html
*/

String claudeModelId = "anthropic.claude-v2";
Expand Down Expand Up @@ -89,7 +89,7 @@ public static String invokeJurassic2(String prompt) {
* The different model providers have individual request and response formats.
* For the format, ranges, and default values for AI21 Labs Jurassic-2, refer
* to:
* https://docs.ai21.com/reference/j2-complete-ref
* https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters-jurassic2.html
*/

String jurassic2ModelId = "ai21.j2-mid-v1";
Expand Down Expand Up @@ -190,7 +190,7 @@ public static String invokeStableDiffusion(String prompt, long seed, String styl
* The different model providers have individual request and response formats.
* For the format, ranges, and available style_presets of Stable Diffusion
* models refer to:
* https://platform.stability.ai/docs/api-reference#tag/v1generation
* https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters-stability-diffusion.html
*/

String stableDiffusionModelId = "stability.stable-diffusion-xl";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
package com.example.bedrockruntime;

// snippet-start:[bedrock-runtime.java2.invoke_model_async.import]

import org.json.JSONArray;
import org.json.JSONObject;
import software.amazon.awssdk.auth.credentials.ProfileCredentialsProvider;
import software.amazon.awssdk.core.SdkBytes;
import software.amazon.awssdk.regions.Region;
import software.amazon.awssdk.services.bedrockruntime.BedrockRuntimeAsyncClient;
import software.amazon.awssdk.services.bedrockruntime.BedrockRuntimeClient;
import software.amazon.awssdk.services.bedrockruntime.model.InvokeModelRequest;
import software.amazon.awssdk.services.bedrockruntime.model.InvokeModelResponse;

Expand Down Expand Up @@ -41,7 +41,7 @@ public static String invokeClaude(String prompt) {
/*
* The different model providers have individual request and response formats.
* For the format, ranges, and default values for Anthropic Claude, refer to:
* https://docs.anthropic.com/claude/reference/complete_post
* https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters-claude.html
*/

String claudeModelId = "anthropic.claude-v2";
Expand Down Expand Up @@ -103,7 +103,7 @@ public static String invokeJurassic2(String prompt) {
/*
* The different model providers have individual request and response formats.
* For the format, ranges, and default values for Anthropic Claude, refer to:
* https://docs.anthropic.com/claude/reference/complete_post
* https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters-claude.html
*/

String jurassic2ModelId = "ai21.j2-mid-v1";
Expand Down Expand Up @@ -232,7 +232,7 @@ public static String invokeStableDiffusion(String prompt, long seed, String styl
* The different model providers have individual request and response formats.
* For the format, ranges, and available style_presets of Stable Diffusion
* models refer to:
* https://platform.stability.ai/docs/api-reference#tag/v1generation
* https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters-stability-diffusion.html
*/

String stableDiffusionModelId = "stability.stable-diffusion-xl";
Expand Down
6 changes: 3 additions & 3 deletions php/example_code/bedrock-runtime/BedrockRuntimeService.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function invokeClaude($prompt)
{
# The different model providers have individual request and response formats.
# For the format, ranges, and default values for Anthropic Claude, refer to:
# https://docs.anthropic.com/claude/reference/complete_post
# https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters-claude.html

$completion = "";

Expand Down Expand Up @@ -74,7 +74,7 @@ public function invokeJurassic2($prompt)
{
# The different model providers have individual request and response formats.
# For the format, ranges, and default values for AI21 Labs Jurassic-2, refer to:
# https://docs.ai21.com/reference/j2-complete-ref
# https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters-jurassic2.html

$completion = "";

Expand Down Expand Up @@ -144,7 +144,7 @@ public function invokeStableDiffusion(string $prompt, int $seed, string $style_p
{
# The different model providers have individual request and response formats.
# For the format, ranges, and available style_presets of Stable Diffusion models refer to:
# https://platform.stability.ai/docs/api-reference#tag/v1generation
# https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters-stability-diffusion.html

$base64_image_data = "";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def invoke_claude(self, prompt):
try:
# The different model providers have individual request and response formats.
# For the format, ranges, and default values for Anthropic Claude, refer to:
# https://docs.anthropic.com/claude/reference/complete_post
# https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters-claude.html

# Claude requires you to enclose the prompt as follows:
enclosed_prompt = "Human: " + prompt + "\n\nAssistant:"
Expand Down Expand Up @@ -89,7 +89,7 @@ def invoke_jurassic2(self, prompt):
try:
# The different model providers have individual request and response formats.
# For the format, ranges, and default values for AI21 Labs Jurassic-2, refer to:
# https://docs.ai21.com/reference/j2-complete-ref
# https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters-jurassic2.html

body = {
"prompt": prompt,
Expand Down Expand Up @@ -165,7 +165,7 @@ def invoke_stable_diffusion(self, prompt, seed, style_preset=None):
try:
# The different model providers have individual request and response formats.
# For the format, ranges, and available style_presets of Stable Diffusion models refer to:
# https://platform.stability.ai/docs/api-reference#tag/v1generation
# https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters-stability-diffusion.html

body = {
"text_prompts": [{"text": prompt}],
Expand Down Expand Up @@ -249,7 +249,7 @@ async def invoke_model_with_response_stream(self, prompt):
try:
# The different model providers have individual request and response formats.
# For the format, ranges, and default values for Anthropic Claude, refer to:
# https://docs.anthropic.com/claude/reference/complete_post
# https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters-claude.html

# Claude requires you to enclose the prompt as follows:
enclosed_prompt = "Human: " + prompt + "\n\nAssistant:"
Expand Down

0 comments on commit 4b0bd9a

Please sign in to comment.