Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 0 additions & 16 deletions .doc_gen/metadata/bedrock-runtime_metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,6 @@ bedrock-runtime_Converse_Ai21LabsJurassic2:
- description: Send a text message to AI21 Labs Jurassic-2, using Bedrock's Converse API.
snippet_tags:
- python.example_code.bedrock-runtime.Converse_Ai21LabsJurassic2
JavaScript:
versions:
- sdk_version: 3
github: javascriptv3/example_code/bedrock-runtime
excerpts:
- description: Send a text message to AI21 Labs Jurassic-2, using Bedrock's Converse API.
snippet_tags:
- javascript.v3.bedrock-runtime.Converse_Ai21LabsJurassic2
services:
bedrock-runtime: {Converse}

Expand Down Expand Up @@ -739,14 +731,6 @@ bedrock-runtime_InvokeModel_Ai21LabsJurassic2:
snippet_tags:
- gov2.bedrock-runtime.InvokeModelWrapper.struct
- gov2.bedrock-runtime.InvokeJurassic2
JavaScript:
versions:
- sdk_version: 3
github: javascriptv3/example_code/bedrock-runtime
excerpts:
- description: Use the Invoke Model API to send a text message.
snippet_files:
- javascriptv3/example_code/bedrock-runtime/models/ai21LabsJurassic2/invoke_model.js
PHP:
versions:
- sdk_version: 3
Expand Down

This file was deleted.

This file was deleted.

2 changes: 1 addition & 1 deletion javascriptv3/example_code/bedrock-runtime/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
"vitest": "^1.6.1"
},
"dependencies": {
"@aws-sdk/client-bedrock-runtime": "^3.751.0"
"@aws-sdk/client-bedrock-runtime": "^3.785.0"
}
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ describe("Converse with text generation models", () => {
const fileName = "converse.js";

const models = {
ai21LabsJurassic2: "AI21 Labs Jurassic-2",
amazonNovaText: "Amazon Nova",
amazonTitanText: "Amazon Titan",
anthropicClaude: "Anthropic Claude",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,29 +18,32 @@ describe("ConverseStream with text generation models", () => {
mistral: "Mistral",
};

test.each(Object.entries(models).map(([sub, name]) => [name, sub]))(
"should invoke %s and return text",
async (_, subdirectory) => {
let output = "";
const outputStream = new Writable({
write(/** @type string */ chunk, encoding, callback) {
output += chunk.toString();
callback();
},
});

const stdoutWriteSpy = vi
.spyOn(process.stdout, "write")
.mockImplementation(outputStream.write.bind(outputStream));

const script = path.join(baseDirectory, subdirectory, fileName);

try {
await import(script);
expect(output).toMatch(/\S/);
} finally {
stdoutWriteSpy.mockRestore();
}
},
);
const delay = (ms) => new Promise((resolve) => setTimeout(resolve, ms));

test.sequential.each(
Object.entries(models).map(([sub, name]) => [name, sub]),
)("should invoke %s and return text", async (_, subdirectory) => {
// Add a 500 ms delay before each test to avoid throttling issues
await delay(500);
let output = "";
const outputStream = new Writable({
write(/** @type string */ chunk, encoding, callback) {
output += chunk.toString();
callback();
},
});

const stdoutWriteSpy = vi
.spyOn(process.stdout, "write")
.mockImplementation(outputStream.write.bind(outputStream));

const script = path.join(baseDirectory, subdirectory, fileName);

try {
await import(script);
expect(output).toMatch(/\S/);
} finally {
stdoutWriteSpy.mockRestore();
}
});
});
Loading