From f8c69c375510201423fbbb98630a895990ac3ede Mon Sep 17 00:00:00 2001 From: Brace Sproul Date: Thu, 27 Jun 2024 18:01:47 -0700 Subject: [PATCH] langchain-aws[major]: LangChain AWS package (#5907) * langchain-aws[major]: LangChain AWS package * cr * implemented code and tests * refactor utils/types * implemented streaming * implemented bindTools * implemented streaming tool calls * tool_choice test * getLsParams and standard tests * final * add guardrails * docs * chore: lint files * cr * export types file * cr --- .../docs/integrations/chat/bedrock.mdx | 4 + .../integrations/chat/bedrock_converse.mdx | 77 ++ examples/package.json | 1 + .../chat/integration_bedrock_converse.ts | 65 ++ ...integration_bedrock_multimodal_converse.ts | 42 + .../integration_bedrock_tools_converse.ts | 55 + .../chat/integration_bedrock_wso_converse.ts | 31 + libs/langchain-aws/.eslintrc.cjs | 74 ++ libs/langchain-aws/.gitignore | 7 + libs/langchain-aws/.prettierrc | 19 + libs/langchain-aws/.release-it.json | 10 + libs/langchain-aws/LICENSE | 21 + libs/langchain-aws/README.md | 133 +++ libs/langchain-aws/jest.config.cjs | 21 + libs/langchain-aws/jest.env.cjs | 12 + libs/langchain-aws/langchain.config.js | 22 + libs/langchain-aws/package.json | 97 ++ .../scripts/jest-setup-after-env.js | 3 + libs/langchain-aws/src/chat_models.ts | 443 ++++++++ libs/langchain-aws/src/common.ts | 434 ++++++++ libs/langchain-aws/src/index.ts | 2 + .../src/tests/chat_models.int.test.ts | 307 ++++++ .../tests/chat_models.standard.int.test.ts | 61 ++ .../src/tests/chat_models.standard.test.ts | 41 + libs/langchain-aws/src/types.ts | 16 + libs/langchain-aws/tsconfig.cjs.json | 8 + libs/langchain-aws/tsconfig.json | 23 + libs/langchain-aws/turbo.json | 11 + yarn.lock | 960 ++++++++++++++++++ 29 files changed, 3000 insertions(+) create mode 100644 docs/core_docs/docs/integrations/chat/bedrock_converse.mdx create mode 100644 examples/src/models/chat/integration_bedrock_converse.ts create mode 100644 examples/src/models/chat/integration_bedrock_multimodal_converse.ts create mode 100644 examples/src/models/chat/integration_bedrock_tools_converse.ts create mode 100644 examples/src/models/chat/integration_bedrock_wso_converse.ts create mode 100644 libs/langchain-aws/.eslintrc.cjs create mode 100644 libs/langchain-aws/.gitignore create mode 100644 libs/langchain-aws/.prettierrc create mode 100644 libs/langchain-aws/.release-it.json create mode 100644 libs/langchain-aws/LICENSE create mode 100644 libs/langchain-aws/README.md create mode 100644 libs/langchain-aws/jest.config.cjs create mode 100644 libs/langchain-aws/jest.env.cjs create mode 100644 libs/langchain-aws/langchain.config.js create mode 100644 libs/langchain-aws/package.json create mode 100644 libs/langchain-aws/scripts/jest-setup-after-env.js create mode 100644 libs/langchain-aws/src/chat_models.ts create mode 100644 libs/langchain-aws/src/common.ts create mode 100644 libs/langchain-aws/src/index.ts create mode 100644 libs/langchain-aws/src/tests/chat_models.int.test.ts create mode 100644 libs/langchain-aws/src/tests/chat_models.standard.int.test.ts create mode 100644 libs/langchain-aws/src/tests/chat_models.standard.test.ts create mode 100644 libs/langchain-aws/src/types.ts create mode 100644 libs/langchain-aws/tsconfig.cjs.json create mode 100644 libs/langchain-aws/tsconfig.json create mode 100644 libs/langchain-aws/turbo.json diff --git a/docs/core_docs/docs/integrations/chat/bedrock.mdx b/docs/core_docs/docs/integrations/chat/bedrock.mdx index 10cdc57c9d98..49c291da8fbc 100644 --- a/docs/core_docs/docs/integrations/chat/bedrock.mdx +++ b/docs/core_docs/docs/integrations/chat/bedrock.mdx @@ -9,6 +9,10 @@ sidebar_label: Bedrock ## Setup +:::tip +The [`ChatBedrockConverse` chat model is now available via `@langchain/aws`](/docs/integrations/chat/bedrock_converse). Access tool calling with more models with this package. +::: + You'll need to install the `@langchain/community` package: import IntegrationInstallTooltip from "@mdx_components/integration_install_tooltip.mdx"; diff --git a/docs/core_docs/docs/integrations/chat/bedrock_converse.mdx b/docs/core_docs/docs/integrations/chat/bedrock_converse.mdx new file mode 100644 index 000000000000..2b82a67898b6 --- /dev/null +++ b/docs/core_docs/docs/integrations/chat/bedrock_converse.mdx @@ -0,0 +1,77 @@ +--- +sidebar_label: Bedrock Converse +--- + +# ChatBedrockConverse + +> [Amazon Bedrock Converse](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_Converse.html) is a fully managed service that makes Foundation Models (FMs) +> from leading AI startups and Amazon available via an API. You can choose from a wide range of FMs to find the model that is best suited for your use case. + +## Setup + +You'll need to install the `@langchain/aws` package: + +import IntegrationInstallTooltip from "@mdx_components/integration_install_tooltip.mdx"; + + + +```bash npm2yarn +npm install @langchain/aws +``` + +## Usage + +import UnifiedModelParamsTooltip from "@mdx_components/unified_model_params_tooltip.mdx"; + + + +import CodeBlock from "@theme/CodeBlock"; +import BedrockConverseExample from "@examples/models/chat/integration_bedrock_converse.ts"; + +{BedrockConverseExample} + +:::tip +See the LangSmith traces for the above example [here](https://smith.langchain.com/public/7aeb0c56-9afa-441d-8659-4d52c007eae0/r), and [here for steaming](https://smith.langchain.com/public/74606291-45cd-478c-a874-568b2905427f/r). +::: + +## Multimodal inputs + +:::tip +Multimodal inputs are currently only supported by Anthropic Claude-3 models. +::: + +Anthropic Claude-3 models hosted on Bedrock have multimodal capabilities and can reason about images. Here's an example: + +import BedrockMultimodalExample from "@examples/models/chat/integration_bedrock_multimodal_converse.ts"; + +{BedrockMultimodalExample} + +:::tip +See the LangSmith trace [here](https://smith.langchain.com/public/c40f8d09-123a-4b3b-934a-625d5ee0f57a/r). +::: + +## Tool calling + +The examples below demonstrate how to use tool calling, along with the `withStructuredOutput` method to easily compose structured output LLM calls. + +import ToolCalling from "@examples/models/chat/integration_bedrock_tools_converse.ts"; + +{ToolCalling} + +Check out the output of this tool call! We can see here it's using chain-of-thought before calling the tool, where it describes what it's going to do in plain text before calling the tool: `Okay, let's get the weather for New York City.`. + +:::tip +See the LangSmith trace [here](https://smith.langchain.com/public/d34e378d-5044-4b5b-9ed7-3d2486fe5d47/r) +::: + +### `.withStructuredOutput({ ... })` + +Using the `.withStructuredOutput` method, you can easily make the LLM return structured output, given only a Zod or JSON schema: + +import WSOExample from "@examples/models/chat/integration_bedrock_wso_converse.ts"; + +{WSOExample} + +:::tip +See the LangSmith trace [here](https://smith.langchain.com/public/982940c4-5f96-4168-80c9-99102c3e073a/r) +::: diff --git a/examples/package.json b/examples/package.json index a12a4f3e9f6b..eebdfe237c67 100644 --- a/examples/package.json +++ b/examples/package.json @@ -34,6 +34,7 @@ "@gomomento/sdk": "^1.51.1", "@google/generative-ai": "^0.7.0", "@langchain/anthropic": "workspace:*", + "@langchain/aws": "workspace:*", "@langchain/azure-dynamic-sessions": "workspace:^", "@langchain/azure-openai": "workspace:*", "@langchain/cloudflare": "workspace:*", diff --git a/examples/src/models/chat/integration_bedrock_converse.ts b/examples/src/models/chat/integration_bedrock_converse.ts new file mode 100644 index 000000000000..da0d294220ca --- /dev/null +++ b/examples/src/models/chat/integration_bedrock_converse.ts @@ -0,0 +1,65 @@ +import { ChatBedrockConverse } from "@langchain/aws"; +import { HumanMessage } from "@langchain/core/messages"; + +const model = new ChatBedrockConverse({ + model: "anthropic.claude-3-sonnet-20240229-v1:0", + region: "us-east-1", + credentials: { + accessKeyId: process.env.BEDROCK_AWS_ACCESS_KEY_ID!, + secretAccessKey: process.env.BEDROCK_AWS_SECRET_ACCESS_KEY!, + }, +}); + +const res = await model.invoke([ + new HumanMessage({ content: "Tell me a joke" }), +]); +console.log(res); + +/* +AIMessage { + content: "Here's a joke for you:\n" + + '\n' + + "Why can't a bicycle stand up by itself? Because it's two-tired!", + response_metadata: { ... }, + id: '08afa4fb-c212-4c1e-853a-d854972bec78', + usage_metadata: { input_tokens: 11, output_tokens: 28, total_tokens: 39 } +} +*/ + +const stream = await model.stream([ + new HumanMessage({ content: "Tell me a joke" }), +]); + +for await (const chunk of stream) { + console.log(chunk.content); +} + +/* +Here +'s + a + silly + joke + for + you +: + + +Why + di +d the + tom +ato + turn + re +d? + Because + it + saw + the + sal +a +d +dressing +! +*/ diff --git a/examples/src/models/chat/integration_bedrock_multimodal_converse.ts b/examples/src/models/chat/integration_bedrock_multimodal_converse.ts new file mode 100644 index 000000000000..cf0402f2d254 --- /dev/null +++ b/examples/src/models/chat/integration_bedrock_multimodal_converse.ts @@ -0,0 +1,42 @@ +import * as fs from "node:fs/promises"; + +import { ChatBedrockConverse } from "@langchain/aws"; +import { HumanMessage } from "@langchain/core/messages"; + +const model = new ChatBedrockConverse({ + model: "anthropic.claude-3-sonnet-20240229-v1:0", + region: "us-east-1", + credentials: { + accessKeyId: process.env.BEDROCK_AWS_ACCESS_KEY_ID!, + secretAccessKey: process.env.BEDROCK_AWS_SECRET_ACCESS_KEY!, + }, +}); + +const imageData = await fs.readFile("./hotdog.jpg"); + +const res = await model.invoke([ + new HumanMessage({ + content: [ + { + type: "text", + text: "What's in this image?", + }, + { + type: "image_url", + image_url: { + url: `data:image/jpeg;base64,${imageData.toString("base64")}`, + }, + }, + ], + }), +]); +console.log(res); + +/* +AIMessage { + content: 'The image shows a hot dog or frankfurter. It has a reddish-pink sausage inside a light tan-colored bread bun. The hot dog bun is split open, allowing the sausage filling to be visible. The image appears to be focused solely on depicting this classic American fast food item against a plain white background.', + response_metadata: { ... }, + id: '1608d043-575a-450e-8eac-2fef6297cfe2', + usage_metadata: { input_tokens: 276, output_tokens: 75, total_tokens: 351 } +} +*/ diff --git a/examples/src/models/chat/integration_bedrock_tools_converse.ts b/examples/src/models/chat/integration_bedrock_tools_converse.ts new file mode 100644 index 000000000000..0fea8d54d309 --- /dev/null +++ b/examples/src/models/chat/integration_bedrock_tools_converse.ts @@ -0,0 +1,55 @@ +import { ChatBedrockConverse } from "@langchain/aws"; +import { tool } from "@langchain/core/tools"; +import { z } from "zod"; + +const model = new ChatBedrockConverse({ + model: "anthropic.claude-3-sonnet-20240229-v1:0", + region: "us-east-1", + credentials: { + accessKeyId: process.env.BEDROCK_AWS_ACCESS_KEY_ID!, + secretAccessKey: process.env.BEDROCK_AWS_SECRET_ACCESS_KEY!, + }, +}); + +const weatherTool = tool( + ({ city, state }) => `The weather in ${city}, ${state} is 72°F and sunny`, + { + name: "weather_tool", + description: "Get the weather for a city", + schema: z.object({ + city: z.string().describe("The city to get the weather for"), + state: z.string().describe("The state to get the weather for").optional(), + }), + } +); + +const modelWithTools = model.bindTools([weatherTool]); +// Optionally, you can bind tools via the `.bind` method: +// const modelWithTools = model.bind({ +// tools: [weatherTool] +// }); + +const res = await modelWithTools.invoke("What's the weather in New York?"); +console.log(res); + +/* +AIMessage { + content: [ + { + type: 'text', + text: "Okay, let's get the weather for New York City." + } + ], + response_metadata: { ... }, + id: '49a97da0-e971-4d7f-9f04-2495e068c15e', + tool_calls: [ + { + id: 'tooluse_O6Q1Ghm7SmKA9mn2ZKmBzg', + name: 'weather_tool', + args: { + 'city': 'New York', + }, + ], + usage_metadata: { input_tokens: 289, output_tokens: 68, total_tokens: 357 } +} +*/ diff --git a/examples/src/models/chat/integration_bedrock_wso_converse.ts b/examples/src/models/chat/integration_bedrock_wso_converse.ts new file mode 100644 index 000000000000..91a26f9b1576 --- /dev/null +++ b/examples/src/models/chat/integration_bedrock_wso_converse.ts @@ -0,0 +1,31 @@ +import { ChatBedrockConverse } from "@langchain/aws"; +import { z } from "zod"; + +const model = new ChatBedrockConverse({ + model: "anthropic.claude-3-sonnet-20240229-v1:0", + region: "us-east-1", + credentials: { + accessKeyId: process.env.BEDROCK_AWS_ACCESS_KEY_ID!, + secretAccessKey: process.env.BEDROCK_AWS_SECRET_ACCESS_KEY!, + }, +}); + +const weatherSchema = z + .object({ + city: z.string().describe("The city to get the weather for"), + state: z.string().describe("The state to get the weather for").optional(), + }) + .describe("Get the weather for a city"); + +const modelWithStructuredOutput = model.withStructuredOutput(weatherSchema, { + name: "weather_tool", // Optional, defaults to 'extract' +}); + +const res = await modelWithStructuredOutput.invoke( + "What's the weather in New York?" +); +console.log(res); + +/* +{ city: 'New York', state: 'NY' } +*/ diff --git a/libs/langchain-aws/.eslintrc.cjs b/libs/langchain-aws/.eslintrc.cjs new file mode 100644 index 000000000000..e3033ac0160c --- /dev/null +++ b/libs/langchain-aws/.eslintrc.cjs @@ -0,0 +1,74 @@ +module.exports = { + extends: [ + "airbnb-base", + "eslint:recommended", + "prettier", + "plugin:@typescript-eslint/recommended", + ], + parserOptions: { + ecmaVersion: 12, + parser: "@typescript-eslint/parser", + project: "./tsconfig.json", + sourceType: "module", + }, + plugins: ["@typescript-eslint", "no-instanceof"], + ignorePatterns: [ + ".eslintrc.cjs", + "scripts", + "node_modules", + "dist", + "dist-cjs", + "*.js", + "*.cjs", + "*.d.ts", + ], + rules: { + "no-process-env": 2, + "no-instanceof/no-instanceof": 2, + "@typescript-eslint/explicit-module-boundary-types": 0, + "@typescript-eslint/no-empty-function": 0, + "@typescript-eslint/no-shadow": 0, + "@typescript-eslint/no-empty-interface": 0, + "@typescript-eslint/no-use-before-define": ["error", "nofunc"], + "@typescript-eslint/no-unused-vars": ["warn", { args: "none" }], + "@typescript-eslint/no-floating-promises": "error", + "@typescript-eslint/no-misused-promises": "error", + camelcase: 0, + "class-methods-use-this": 0, + "import/extensions": [2, "ignorePackages"], + "import/no-extraneous-dependencies": [ + "error", + { devDependencies: ["**/*.test.ts"] }, + ], + "import/no-unresolved": 0, + "import/prefer-default-export": 0, + "keyword-spacing": "error", + "max-classes-per-file": 0, + "max-len": 0, + "no-await-in-loop": 0, + "no-bitwise": 0, + "no-console": 0, + "no-restricted-syntax": 0, + "no-shadow": 0, + "no-continue": 0, + "no-void": 0, + "no-underscore-dangle": 0, + "no-use-before-define": 0, + "no-useless-constructor": 0, + "no-return-await": 0, + "consistent-return": 0, + "no-else-return": 0, + "func-names": 0, + "no-lonely-if": 0, + "prefer-rest-params": 0, + "new-cap": ["error", { properties: false, capIsNew: false }], + }, + overrides: [ + { + files: ["**/*.test.ts"], + rules: { + "@typescript-eslint/no-unused-vars": "off", + }, + }, + ], +}; diff --git a/libs/langchain-aws/.gitignore b/libs/langchain-aws/.gitignore new file mode 100644 index 000000000000..c10034e2f1be --- /dev/null +++ b/libs/langchain-aws/.gitignore @@ -0,0 +1,7 @@ +index.cjs +index.js +index.d.ts +index.d.cts +node_modules +dist +.yarn diff --git a/libs/langchain-aws/.prettierrc b/libs/langchain-aws/.prettierrc new file mode 100644 index 000000000000..ba08ff04f677 --- /dev/null +++ b/libs/langchain-aws/.prettierrc @@ -0,0 +1,19 @@ +{ + "$schema": "https://json.schemastore.org/prettierrc", + "printWidth": 80, + "tabWidth": 2, + "useTabs": false, + "semi": true, + "singleQuote": false, + "quoteProps": "as-needed", + "jsxSingleQuote": false, + "trailingComma": "es5", + "bracketSpacing": true, + "arrowParens": "always", + "requirePragma": false, + "insertPragma": false, + "proseWrap": "preserve", + "htmlWhitespaceSensitivity": "css", + "vueIndentScriptAndStyle": false, + "endOfLine": "lf" +} diff --git a/libs/langchain-aws/.release-it.json b/libs/langchain-aws/.release-it.json new file mode 100644 index 000000000000..522ee6abf705 --- /dev/null +++ b/libs/langchain-aws/.release-it.json @@ -0,0 +1,10 @@ +{ + "github": { + "release": true, + "autoGenerate": true, + "tokenRef": "GITHUB_TOKEN_RELEASE" + }, + "npm": { + "versionArgs": ["--workspaces-update=false"] + } +} diff --git a/libs/langchain-aws/LICENSE b/libs/langchain-aws/LICENSE new file mode 100644 index 000000000000..8cd8f501eb49 --- /dev/null +++ b/libs/langchain-aws/LICENSE @@ -0,0 +1,21 @@ +The MIT License + +Copyright (c) 2023 LangChain + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. \ No newline at end of file diff --git a/libs/langchain-aws/README.md b/libs/langchain-aws/README.md new file mode 100644 index 000000000000..7e0950c34bcc --- /dev/null +++ b/libs/langchain-aws/README.md @@ -0,0 +1,133 @@ +# @langchain/aws + +This package contains the LangChain.js integrations for AWS through their SDK. + +## Installation + +```bash +npm install @langchain/aws +``` + +This package, along with the main LangChain package, depends on [`@langchain/core`](https://npmjs.com/package/@langchain/core/). +If you are using this package with other LangChain packages, you should make sure that all of the packages depend on the same instance of @langchain/core. +You can do so by adding appropriate fields to your project's `package.json` like this: + +```json +{ + "name": "your-project", + "version": "0.0.0", + "dependencies": { + "@langchain/aws": "^0.0.1", + "langchain": "0.0.207" + }, + "resolutions": { + "@langchain/core": "0.1.5" + }, + "overrides": { + "@langchain/core": "0.1.5" + }, + "pnpm": { + "overrides": { + "@langchain/core": "0.1.5" + } + } +} +``` + +The field you need depends on the package manager you're using, but we recommend adding a field for the common `yarn`, `npm`, and `pnpm` to maximize compatibility. + +## Chat Models + +This package contains the `ChatBedrockConverse` class, which is the recommended way to interface with the AWS Bedrock Converse series of models. + +To use, install the requirements, and configure your environment. + +```bash +export BEDROCK_AWS_REGION= +export BEDROCK_AWS_SECRET_ACCESS_KEY= +export BEDROCK_AWS_ACCESS_KEY_ID= +``` + +Then initialize + +```typescript +import { ChatBedrockConverse } from "@langchain/aws"; + +const model = new ChatBedrockConverse({ + region: process.env.BEDROCK_AWS_REGION ?? "us-east-1", + credentials: { + secretAccessKey: process.env.BEDROCK_AWS_SECRET_ACCESS_KEY, + accessKeyId: process.env.BEDROCK_AWS_ACCESS_KEY_ID, + }, +}); + +const response = await model.invoke(new HumanMessage("Hello world!")); +``` + +### Streaming + +```typescript +import { ChatBedrockConverse } from "@langchain/aws"; + +const model = new ChatBedrockConverse({ + region: process.env.BEDROCK_AWS_REGION ?? "us-east-1", + credentials: { + secretAccessKey: process.env.BEDROCK_AWS_SECRET_ACCESS_KEY, + accessKeyId: process.env.BEDROCK_AWS_ACCESS_KEY_ID, + }, +}); + +const response = await model.stream(new HumanMessage("Hello world!")); +``` + +## Development + +To develop the AWS package, you'll need to follow these instructions: + +### Install dependencies + +```bash +yarn install +``` + +### Build the package + +```bash +yarn build +``` + +Or from the repo root: + +```bash +yarn build --filter=@langchain/aws +``` + +### Run tests + +Test files should live within a `tests/` file in the `src/` folder. Unit tests should end in `.test.ts` and integration tests should +end in `.int.test.ts`: + +```bash +$ yarn test +$ yarn test:int +``` + +### Lint & Format + +Run the linter & formatter to ensure your code is up to standard: + +```bash +yarn lint && yarn format +``` + +### Adding new entrypoints + +If you add a new file to be exported, either import & re-export from `src/index.ts`, or add it to the `entrypoints` field in the `config` variable located inside `langchain.config.js` and run `yarn build` to generate the new entrypoint. + +## Publishing + +After running `yarn build`, publish a new version with: + +```bash +$ npm publish +``` \ No newline at end of file diff --git a/libs/langchain-aws/jest.config.cjs b/libs/langchain-aws/jest.config.cjs new file mode 100644 index 000000000000..994826496bc5 --- /dev/null +++ b/libs/langchain-aws/jest.config.cjs @@ -0,0 +1,21 @@ +/** @type {import('ts-jest').JestConfigWithTsJest} */ +module.exports = { + preset: "ts-jest/presets/default-esm", + testEnvironment: "./jest.env.cjs", + modulePathIgnorePatterns: ["dist/", "docs/"], + moduleNameMapper: { + "^(\\.{1,2}/.*)\\.js$": "$1", + }, + transform: { + "^.+\\.tsx?$": ["@swc/jest"], + }, + transformIgnorePatterns: [ + "/node_modules/", + "\\.pnp\\.[^\\/]+$", + "./scripts/jest-setup-after-env.js", + ], + setupFiles: ["dotenv/config"], + testTimeout: 20_000, + passWithNoTests: true, + collectCoverageFrom: ["src/**/*.ts"], +}; diff --git a/libs/langchain-aws/jest.env.cjs b/libs/langchain-aws/jest.env.cjs new file mode 100644 index 000000000000..2ccedccb8672 --- /dev/null +++ b/libs/langchain-aws/jest.env.cjs @@ -0,0 +1,12 @@ +const { TestEnvironment } = require("jest-environment-node"); + +class AdjustedTestEnvironmentToSupportFloat32Array extends TestEnvironment { + constructor(config, context) { + // Make `instanceof Float32Array` return true in tests + // to avoid https://github.com/xenova/transformers.js/issues/57 and https://github.com/jestjs/jest/issues/2549 + super(config, context); + this.global.Float32Array = Float32Array; + } +} + +module.exports = AdjustedTestEnvironmentToSupportFloat32Array; diff --git a/libs/langchain-aws/langchain.config.js b/libs/langchain-aws/langchain.config.js new file mode 100644 index 000000000000..46b1a2b31264 --- /dev/null +++ b/libs/langchain-aws/langchain.config.js @@ -0,0 +1,22 @@ +import { resolve, dirname } from "node:path"; +import { fileURLToPath } from "node:url"; + +/** + * @param {string} relativePath + * @returns {string} + */ +function abs(relativePath) { + return resolve(dirname(fileURLToPath(import.meta.url)), relativePath); +} + +export const config = { + internals: [/node\:/, /@langchain\/core\//], + entrypoints: { + index: "index", + }, + requiresOptionalDependency: [], + tsConfigPath: resolve("./tsconfig.json"), + cjsSource: "./dist-cjs", + cjsDestination: "./dist", + abs, +}; diff --git a/libs/langchain-aws/package.json b/libs/langchain-aws/package.json new file mode 100644 index 000000000000..28ce13f0e10e --- /dev/null +++ b/libs/langchain-aws/package.json @@ -0,0 +1,97 @@ +{ + "name": "@langchain/aws", + "version": "0.0.0", + "description": "LangChain AWS integration", + "type": "module", + "engines": { + "node": ">=18" + }, + "main": "./index.js", + "types": "./index.d.ts", + "repository": { + "type": "git", + "url": "git@github.com:langchain-ai/langchainjs.git" + }, + "homepage": "https://github.com/langchain-ai/langchainjs/tree/main/libs/langchain-aws/", + "scripts": { + "build": "yarn turbo:command build:internal --filter=@langchain/aws", + "build:internal": "yarn lc-build:v2 --create-entrypoints --pre --tree-shaking", + "build:esm": "NODE_OPTIONS=--max-old-space-size=4096 tsc --outDir dist/ && rm -rf dist/tests dist/**/tests", + "build:cjs": "NODE_OPTIONS=--max-old-space-size=4096 tsc --outDir dist-cjs/ -p tsconfig.cjs.json && yarn move-cjs-to-dist && rm -rf dist-cjs", + "build:watch": "yarn create-entrypoints && tsc --outDir dist/ --watch", + "build:scripts": "yarn create-entrypoints && yarn check-tree-shaking", + "lint:eslint": "NODE_OPTIONS=--max-old-space-size=4096 eslint --cache --ext .ts,.js src/", + "lint:dpdm": "dpdm --exit-code circular:1 --no-warning --no-tree src/*.ts src/**/*.ts", + "lint": "yarn lint:eslint && yarn lint:dpdm", + "lint:fix": "yarn lint:eslint --fix && yarn lint:dpdm", + "clean": "rm -rf .turbo dist/", + "prepack": "yarn build", + "test": "NODE_OPTIONS=--experimental-vm-modules jest --testPathIgnorePatterns=\\.int\\.test.ts --testTimeout 30000 --maxWorkers=50%", + "test:watch": "NODE_OPTIONS=--experimental-vm-modules jest --watch --testPathIgnorePatterns=\\.int\\.test.ts", + "test:single": "NODE_OPTIONS=--experimental-vm-modules yarn run jest --config jest.config.cjs --testTimeout 100000", + "test:int": "NODE_OPTIONS=--experimental-vm-modules jest --testPathPattern=\\.int\\.test.ts --testTimeout 100000 --maxWorkers=50%", + "format": "prettier --config .prettierrc --write \"src\"", + "format:check": "prettier --config .prettierrc --check \"src\"", + "move-cjs-to-dist": "yarn lc-build --config ./langchain.config.js --move-cjs-dist", + "create-entrypoints": "yarn lc-build --config ./langchain.config.js --create-entrypoints", + "check-tree-shaking": "yarn lc-build --config ./langchain.config.js --tree-shaking" + }, + "author": "LangChain", + "license": "MIT", + "dependencies": { + "@aws-sdk/client-bedrock-runtime": "^3.602.0", + "@aws-sdk/credential-provider-node": "^3.600.0", + "@langchain/core": ">=0.2.9 <0.3.0", + "zod-to-json-schema": "^3.22.5" + }, + "devDependencies": { + "@aws-sdk/types": "^3.598.0", + "@jest/globals": "^29.5.0", + "@langchain/scripts": "~0.0.14", + "@langchain/standard-tests": "0.0.0", + "@smithy/types": "^3.2.0", + "@swc/core": "^1.3.90", + "@swc/jest": "^0.2.29", + "@tsconfig/recommended": "^1.0.3", + "@typescript-eslint/eslint-plugin": "^6.12.0", + "@typescript-eslint/parser": "^6.12.0", + "dotenv": "^16.3.1", + "dpdm": "^3.12.0", + "eslint": "^8.33.0", + "eslint-config-airbnb-base": "^15.0.0", + "eslint-config-prettier": "^8.6.0", + "eslint-plugin-import": "^2.27.5", + "eslint-plugin-no-instanceof": "^1.0.1", + "eslint-plugin-prettier": "^4.2.1", + "jest": "^29.5.0", + "jest-environment-node": "^29.6.4", + "prettier": "^2.8.3", + "release-it": "^15.10.1", + "rollup": "^4.5.2", + "ts-jest": "^29.1.0", + "typescript": "<5.2.0", + "zod": "^3.22.4" + }, + "publishConfig": { + "access": "public" + }, + "exports": { + ".": { + "types": { + "import": "./index.d.ts", + "require": "./index.d.cts", + "default": "./index.d.ts" + }, + "import": "./index.js", + "require": "./index.cjs" + }, + "./package.json": "./package.json" + }, + "files": [ + "dist/", + "index.cjs", + "index.js", + "index.d.ts", + "index.d.cts" + ] +} diff --git a/libs/langchain-aws/scripts/jest-setup-after-env.js b/libs/langchain-aws/scripts/jest-setup-after-env.js new file mode 100644 index 000000000000..778cf7437a20 --- /dev/null +++ b/libs/langchain-aws/scripts/jest-setup-after-env.js @@ -0,0 +1,3 @@ +import { awaitAllCallbacks } from "@langchain/core/callbacks/promises"; + +afterAll(awaitAllCallbacks); diff --git a/libs/langchain-aws/src/chat_models.ts b/libs/langchain-aws/src/chat_models.ts new file mode 100644 index 000000000000..6d565fc10130 --- /dev/null +++ b/libs/langchain-aws/src/chat_models.ts @@ -0,0 +1,443 @@ +import type { BaseMessage } from "@langchain/core/messages"; +import { AIMessageChunk } from "@langchain/core/messages"; +import type { + ToolDefinition, + BaseLanguageModelCallOptions, + BaseLanguageModelInput, +} from "@langchain/core/language_models/base"; +import { CallbackManagerForLLMRun } from "@langchain/core/callbacks/manager"; +import { + type BaseChatModelParams, + BaseChatModel, + LangSmithParams, +} from "@langchain/core/language_models/chat_models"; +import type { + ToolConfiguration, + Tool as BedrockTool, + GuardrailConfiguration, +} from "@aws-sdk/client-bedrock-runtime"; +import { + BedrockRuntimeClient, + ConverseCommand, + ConverseStreamCommand, +} from "@aws-sdk/client-bedrock-runtime"; +import { ChatGenerationChunk, ChatResult } from "@langchain/core/outputs"; +import { getEnvironmentVariable } from "@langchain/core/utils/env"; +import { + defaultProvider, + DefaultProviderInit, +} from "@aws-sdk/credential-provider-node"; +import type { DocumentType as __DocumentType } from "@smithy/types"; +import { StructuredToolInterface } from "@langchain/core/tools"; +import { Runnable } from "@langchain/core/runnables"; +import { + BedrockToolChoice, + ConverseCommandParams, + CredentialType, +} from "./types.js"; +import { + convertToConverseTools, + convertToBedrockToolChoice, + convertToConverseMessages, + convertConverseMessageToLangChainMessage, + handleConverseStreamContentBlockDelta, + handleConverseStreamMetadata, + handleConverseStreamContentBlockStart, +} from "./common.js"; + +/** + * Inputs for ChatBedrockConverse. + */ +export interface ChatBedrockConverseInput + extends BaseChatModelParams, + Partial { + /** + * Whether or not to stream responses + */ + streaming?: boolean; + + /** + * Model to use. + * For example, "anthropic.claude-3-haiku-20240307-v1:0", this is equivalent to the modelId property in the + * list-foundation-models api. + * See the below link for a full list of models. + * @link https://docs.aws.amazon.com/bedrock/latest/userguide/model-ids.html#model-ids-arns + * + * @default anthropic.claude-3-haiku-20240307-v1:0 + */ + model?: string; + + /** + * The AWS region e.g. `us-west-2`. + * Fallback to AWS_DEFAULT_REGION env variable or region specified in ~/.aws/config + * in case it is not provided here. + */ + region?: string; + + /** + * AWS Credentials. If no credentials are provided, the default credentials from + * `@aws-sdk/credential-provider-node` will be used. + */ + credentials?: CredentialType; + + /** + * Temperature. + */ + temperature?: number; + + /** + * Max tokens. + */ + maxTokens?: number; + + /** + * Override the default endpoint hostname. + */ + endpointHost?: string; + + /** + * The percentage of most-likely candidates that the model considers for the next token. For + * example, if you choose a value of 0.8 for `topP`, the model selects from the top 80% of the + * probability distribution of tokens that could be next in the sequence. + * The default value is the default value for the model that you are using. + * For more information, see the inference parameters for foundation models link below. + * @link https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html + */ + topP?: number; + + /** + * Additional inference parameters that the model supports, beyond the + * base set of inference parameters that the Converse API supports in the `inferenceConfig` + * field. For more information, see the model parameters link below. + * @link https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html + */ + additionalModelRequestFields?: __DocumentType; + /** + * Whether or not to include usage data, like token counts + * in the streamed response chunks. Passing as a call option will + * take precedence over the class-level setting. + * @default true + */ + streamUsage?: boolean; + + /** + * Configuration information for a guardrail that you want to use in the request. + */ + guardrailConfig?: GuardrailConfiguration; +} + +export interface ChatBedrockConverseCallOptions + extends BaseLanguageModelCallOptions, + Pick< + ChatBedrockConverseInput, + "additionalModelRequestFields" | "streamUsage" + > { + /** + * A list of stop sequences. A stop sequence is a sequence of characters that causes + * the model to stop generating the response. + */ + stop?: string[]; + + tools?: (StructuredToolInterface | ToolDefinition | BedrockTool)[]; + + /** + * Tool choice for the model. If passing a string, it must be "any", "auto" or the + * name of the tool to use. Or, pass a BedrockToolChoice object. + * + * If "any" is passed, the model must request at least one tool. + * If "auto" is passed, the model automatically decides if a tool should be called + * or whether to generate text instead. + * If a tool name is passed, it will force the model to call that specific tool. + */ + tool_choice?: "any" | "auto" | string | BedrockToolChoice; +} + +/** + * Integration with AWS Bedrock Converse API. + * + * @example + * ```typescript + * import { ChatBedrockConverse } from "@langchain/aws"; + * + * const model = new ChatBedrockConverse({ + * region: process.env.BEDROCK_AWS_REGION ?? "us-east-1", + * credentials: { + * secretAccessKey: process.env.BEDROCK_AWS_SECRET_ACCESS_KEY!, + * accessKeyId: process.env.BEDROCK_AWS_ACCESS_KEY_ID!, + * }, + * }); + * + * const res = await model.invoke([new HumanMessage("Print hello world")]); + * ``` + */ +export class ChatBedrockConverse + extends BaseChatModel + implements ChatBedrockConverseInput +{ + // Used for tracing, replace with the same name as your class + static lc_name() { + return "ChatBedrockConverse"; + } + + /** + * Replace with any secrets this class passes to `super`. + * See {@link ../../langchain-cohere/src/chat_model.ts} for + * an example. + */ + get lc_secrets(): { [key: string]: string } | undefined { + return { + apiKey: "API_KEY_NAME", + }; + } + + get lc_aliases(): { [key: string]: string } | undefined { + return { + apiKey: "API_KEY_NAME", + }; + } + + model = "anthropic.claude-3-haiku-20240307-v1:0"; + + streaming = false; + + region: string; + + temperature?: number | undefined = undefined; + + maxTokens?: number | undefined = undefined; + + endpointHost?: string; + + topP?: number; + + additionalModelRequestFields?: __DocumentType; + + streamUsage = true; + + guardrailConfig?: GuardrailConfiguration; + + client: BedrockRuntimeClient; + + constructor(fields?: ChatBedrockConverseInput) { + super(fields ?? {}); + const { + profile, + filepath, + configFilepath, + ignoreCache, + mfaCodeProvider, + roleAssumer, + roleArn, + webIdentityTokenFile, + roleAssumerWithWebIdentity, + ...rest + } = fields ?? {}; + + const credentials = + rest?.credentials ?? + defaultProvider({ + profile, + filepath, + configFilepath, + ignoreCache, + mfaCodeProvider, + roleAssumer, + roleArn, + webIdentityTokenFile, + roleAssumerWithWebIdentity, + }); + + const region = rest?.region ?? getEnvironmentVariable("AWS_DEFAULT_REGION"); + if (!region) { + throw new Error( + "Please set the AWS_DEFAULT_REGION environment variable or pass it to the constructor as the region field." + ); + } + + this.client = new BedrockRuntimeClient({ + region, + credentials, + }); + this.region = region; + this.model = rest?.model ?? this.model; + this.streaming = rest?.streaming ?? this.streaming; + this.temperature = rest?.temperature; + this.maxTokens = rest?.maxTokens; + this.endpointHost = rest?.endpointHost; + this.topP = rest?.topP; + this.additionalModelRequestFields = rest?.additionalModelRequestFields; + this.streamUsage = rest?.streamUsage ?? this.streamUsage; + this.guardrailConfig = rest?.guardrailConfig; + } + + getLsParams(options: this["ParsedCallOptions"]): LangSmithParams { + const params = this.invocationParams(options); + return { + ls_provider: "amazon_bedrock", + ls_model_name: this.model, + ls_model_type: "chat", + ls_temperature: params.inferenceConfig?.temperature ?? this.temperature, + ls_max_tokens: params.inferenceConfig?.maxTokens ?? undefined, + ls_stop: options.stop, + }; + } + + override bindTools( + tools: ( + | StructuredToolInterface + | BedrockTool + | ToolDefinition + // eslint-disable-next-line @typescript-eslint/no-explicit-any + | Record + )[], + kwargs?: Partial + ): Runnable< + BaseLanguageModelInput, + AIMessageChunk, + this["ParsedCallOptions"] + > { + return this.bind({ tools: convertToConverseTools(tools), ...kwargs }); + } + + // Replace + _llmType() { + return "chat_bedrock_converse"; + } + + invocationParams( + options?: this["ParsedCallOptions"] + ): Partial { + let toolConfig: ToolConfiguration | undefined; + if (options?.tools && options.tools.length) { + const tools = convertToConverseTools(options.tools); + toolConfig = { + tools, + toolChoice: options.tool_choice + ? convertToBedrockToolChoice(options.tool_choice, tools) + : undefined, + }; + } + return { + inferenceConfig: { + maxTokens: this.maxTokens, + temperature: this.temperature, + topP: this.topP, + stopSequences: options?.stop, + }, + toolConfig, + additionalModelRequestFields: + this.additionalModelRequestFields ?? + options?.additionalModelRequestFields, + guardrailConfig: this.guardrailConfig, + }; + } + + async _generate( + messages: BaseMessage[], + options: this["ParsedCallOptions"], + runManager?: CallbackManagerForLLMRun + ): Promise { + if (this.streaming) { + const stream = this._streamResponseChunks(messages, options, runManager); + let finalResult: ChatGenerationChunk | undefined; + for await (const chunk of stream) { + if (finalResult === undefined) { + finalResult = chunk; + } else { + finalResult = finalResult.concat(chunk); + } + } + if (finalResult === undefined) { + throw new Error( + "Could not parse final output from Bedrock streaming call." + ); + } + return { + generations: [finalResult], + llmOutput: finalResult.generationInfo, + }; + } + return this._generateNonStreaming(messages, options, runManager); + } + + async _generateNonStreaming( + messages: BaseMessage[], + options: Partial, + _runManager?: CallbackManagerForLLMRun + ): Promise { + const { converseMessages, converseSystem } = + convertToConverseMessages(messages); + const params = this.invocationParams(options); + + const command = new ConverseCommand({ + modelId: this.model, + messages: converseMessages, + system: converseSystem, + ...params, + }); + const response = await this.client.send(command); + const { output, ...responseMetadata } = response; + if (!output?.message) { + throw new Error("No message found in Bedrock response."); + } + + const message = convertConverseMessageToLangChainMessage( + output.message, + responseMetadata + ); + return { + generations: [ + { + text: typeof message.content === "string" ? message.content : "", + message, + }, + ], + }; + } + + async *_streamResponseChunks( + messages: BaseMessage[], + options: this["ParsedCallOptions"], + runManager?: CallbackManagerForLLMRun + ): AsyncGenerator { + const { converseMessages, converseSystem } = + convertToConverseMessages(messages); + const params = this.invocationParams(options); + let { streamUsage } = this; + if (options.streamUsage !== undefined) { + streamUsage = options.streamUsage; + } + const command = new ConverseStreamCommand({ + modelId: this.model, + messages: converseMessages, + system: converseSystem, + ...params, + }); + const response = await this.client.send(command); + if (response.stream) { + for await (const chunk of response.stream) { + if (chunk.contentBlockStart) { + yield handleConverseStreamContentBlockStart(chunk.contentBlockStart); + } else if (chunk.contentBlockDelta) { + const textChatGeneration = handleConverseStreamContentBlockDelta( + chunk.contentBlockDelta + ); + yield textChatGeneration; + await runManager?.handleLLMNewToken(textChatGeneration.text); + } else if (chunk.metadata) { + yield handleConverseStreamMetadata(chunk.metadata, { + streamUsage, + }); + } else { + yield new ChatGenerationChunk({ + text: "", + message: new AIMessageChunk({ + content: "", + response_metadata: chunk, + }), + }); + } + } + } + } +} diff --git a/libs/langchain-aws/src/common.ts b/libs/langchain-aws/src/common.ts new file mode 100644 index 000000000000..945fa932f43f --- /dev/null +++ b/libs/langchain-aws/src/common.ts @@ -0,0 +1,434 @@ +import type { + MessageContentComplex, + BaseMessage, + UsageMetadata, +} from "@langchain/core/messages"; +import { + AIMessage, + AIMessageChunk, + ToolMessage, +} from "@langchain/core/messages"; +import type { ToolCall } from "@langchain/core/messages/tool"; +import type { ToolDefinition } from "@langchain/core/language_models/base"; +import { isOpenAITool } from "@langchain/core/language_models/base"; +import type { + Message as BedrockMessage, + SystemContentBlock as BedrockSystemContentBlock, + Tool as BedrockTool, + ContentBlock, + ImageFormat, + ConverseResponse, + ContentBlockDeltaEvent, + ConverseStreamMetadataEvent, + ContentBlockStartEvent, +} from "@aws-sdk/client-bedrock-runtime"; +import type { DocumentType as __DocumentType } from "@smithy/types"; +import { StructuredToolInterface } from "@langchain/core/tools"; +import { isStructuredTool } from "@langchain/core/utils/function_calling"; +import { zodToJsonSchema } from "zod-to-json-schema"; +import { ChatGenerationChunk } from "@langchain/core/outputs"; +import { BedrockToolChoice } from "./types.js"; + +export function extractImageInfo(base64: string): ContentBlock.ImageMember { + // Extract the format from the base64 string + const formatMatch = base64.match(/^data:image\/(\w+);base64,/); + let format: ImageFormat | undefined; + if (formatMatch) { + const extractedFormat = formatMatch[1].toLowerCase(); + if (["gif", "jpeg", "png", "webp"].includes(extractedFormat)) { + format = extractedFormat as ImageFormat; + } + } + + // Remove the data URL prefix if present + const base64Data = base64.replace(/^data:image\/\w+;base64,/, ""); + + // Convert base64 to Uint8Array + const binaryString = atob(base64Data); + const bytes = new Uint8Array(binaryString.length); + for (let i = 0; i < binaryString.length; i += 1) { + bytes[i] = binaryString.charCodeAt(i); + } + + return { + image: { + format, + source: { + bytes, + }, + }, + }; +} + +export function convertToConverseMessages(messages: BaseMessage[]): { + converseMessages: BedrockMessage[]; + converseSystem: BedrockSystemContentBlock[]; +} { + const converseSystem: BedrockSystemContentBlock[] = messages + .filter((msg) => msg._getType() === "system") + .map((msg) => { + const text = msg.content; + if (typeof text !== "string") { + throw new Error("System message content must be a string."); + } + return { text }; + }); + const converseMessages: BedrockMessage[] = messages + .filter((msg) => !["system", "tool", "function"].includes(msg._getType())) + .map((msg) => { + if (msg._getType() === "ai") { + const castMsg = msg as AIMessage; + if (typeof castMsg.content === "string") { + return { + role: "assistant", + content: [ + { + text: castMsg.content, + }, + ], + }; + } else { + if (castMsg.tool_calls && castMsg.tool_calls.length) { + return { + role: "assistant", + content: castMsg.tool_calls.map((tc) => ({ + toolUse: { + toolUseId: tc.id, + name: tc.name, + input: tc.args, + }, + })), + }; + } else { + const contentBlocks: ContentBlock[] = castMsg.content.map( + (block) => { + if (block.type === "text") { + return { + text: block.text, + }; + } else { + throw new Error( + `Unsupported content block type: ${block.type}` + ); + } + } + ); + return { + role: "assistant", + content: contentBlocks, + }; + } + } + } else if (msg._getType() === "human" || msg._getType() === "generic") { + if (typeof msg.content === "string") { + return { + role: "user", + content: [ + { + text: msg.content, + }, + ], + }; + } else { + const contentBlocks: ContentBlock[] = msg.content.flatMap((block) => { + if (block.type === "image_url") { + const base64: string = + typeof block.image_url === "string" + ? block.image_url + : block.image_url.url; + return extractImageInfo(base64); + } else if (block.type === "text") { + return { + text: block.text, + }; + } else { + throw new Error(`Unsupported content block type: ${block.type}`); + } + }); + return { + role: "user", + content: contentBlocks, + }; + } + } else if (msg._getType() === "tool") { + const castMsg = msg as ToolMessage; + if (typeof castMsg.content === "string") { + return { + role: undefined, + content: [ + { + toolResult: { + toolUseId: castMsg.tool_call_id, + content: [ + { + text: castMsg.content, + }, + ], + }, + }, + ], + }; + } else { + return { + role: undefined, + content: [ + { + toolResult: { + toolUseId: castMsg.tool_call_id, + content: [ + { + json: castMsg.content, + }, + ], + }, + }, + ], + }; + } + } else { + throw new Error(`Unsupported message type: ${msg._getType()}`); + } + }); + + return { converseMessages, converseSystem }; +} + +export function isBedrockTool(tool: unknown): tool is BedrockTool { + if (typeof tool === "object" && tool && "toolSpec" in tool) { + return true; + } + return false; +} + +export function convertToConverseTools( + tools: ( + | StructuredToolInterface + | ToolDefinition + | BedrockTool + // eslint-disable-next-line @typescript-eslint/no-explicit-any + | Record + )[] +): BedrockTool[] { + if (tools.every(isOpenAITool)) { + return tools.map((tool) => ({ + toolSpec: { + name: tool.function.name, + description: tool.function.description, + inputSchema: { + json: tool.function.parameters as __DocumentType, + }, + }, + })); + } else if (tools.every(isStructuredTool)) { + return tools.map((tool) => ({ + toolSpec: { + name: tool.name, + description: tool.description, + inputSchema: { + json: zodToJsonSchema(tool.schema) as __DocumentType, + }, + }, + })); + } else if (tools.every(isBedrockTool)) { + return tools; + } + + throw new Error( + "Invalid tools passed. Must be an array of StructuredToolInterface, ToolDefinition, or BedrockTool." + ); +} + +export function convertToBedrockToolChoice( + toolChoice: string | BedrockToolChoice, + tools: BedrockTool[] +): BedrockToolChoice { + if (typeof toolChoice === "string") { + switch (toolChoice) { + case "any": + return { + any: {}, + }; + case "auto": + return { + auto: {}, + }; + default: { + const foundTool = tools.find( + (tool) => tool.toolSpec?.name === toolChoice + ); + if (!foundTool) { + throw new Error( + `Tool with name ${toolChoice} not found in tools list.` + ); + } + return { + tool: { + name: toolChoice, + }, + }; + } + } + } + return toolChoice; +} + +export function convertConverseMessageToLangChainMessage( + message: BedrockMessage, + responseMetadata: Omit +): BaseMessage { + if (!message.content) { + throw new Error("No message content found in response."); + } + if (message.role !== "assistant") { + throw new Error( + `Unsupported message role received in ChatBedrockConverse response: ${message.role}` + ); + } + let requestId: string | undefined; + if ( + "$metadata" in responseMetadata && + responseMetadata.$metadata && + typeof responseMetadata.$metadata === "object" && + "requestId" in responseMetadata.$metadata + ) { + requestId = responseMetadata.$metadata.requestId as string; + } + let tokenUsage: UsageMetadata | undefined; + if (responseMetadata.usage) { + const input_tokens = responseMetadata.usage.inputTokens ?? 0; + const output_tokens = responseMetadata.usage.outputTokens ?? 0; + tokenUsage = { + input_tokens, + output_tokens, + total_tokens: + responseMetadata.usage.totalTokens ?? input_tokens + output_tokens, + }; + } + + if ( + message.content?.length === 1 && + "text" in message.content[0] && + typeof message.content[0].text === "string" + ) { + return new AIMessage({ + content: message.content[0].text, + response_metadata: responseMetadata, + usage_metadata: tokenUsage, + id: requestId, + }); + } else { + const toolCalls: ToolCall[] = []; + const content: MessageContentComplex[] = []; + message.content.forEach((c) => { + if ( + "toolUse" in c && + c.toolUse && + c.toolUse.name && + c.toolUse.input && + typeof c.toolUse.input === "object" + ) { + toolCalls.push({ + id: c.toolUse.toolUseId, + name: c.toolUse.name, + args: c.toolUse.input, + }); + } else if ("text" in c && typeof c.text === "string") { + content.push({ type: "text", text: c.text }); + } else { + content.push(c); + } + }); + return new AIMessage({ + content: content.length ? content : "", + tool_calls: toolCalls.length ? toolCalls : undefined, + response_metadata: responseMetadata, + usage_metadata: tokenUsage, + id: requestId, + }); + } +} + +export function handleConverseStreamContentBlockDelta( + contentBlockDelta: ContentBlockDeltaEvent +): ChatGenerationChunk { + if (!contentBlockDelta.delta) { + throw new Error("No delta found in content block."); + } + if (contentBlockDelta.delta.text) { + return new ChatGenerationChunk({ + text: contentBlockDelta.delta.text, + message: new AIMessageChunk({ + content: contentBlockDelta.delta.text, + }), + }); + } else if (contentBlockDelta.delta.toolUse) { + const index = contentBlockDelta.contentBlockIndex; + return new ChatGenerationChunk({ + text: "", + message: new AIMessageChunk({ + content: "", + tool_call_chunks: [ + { + args: contentBlockDelta.delta.toolUse.input, + index, + }, + ], + }), + }); + } else { + const unsupportedField = Object.entries(contentBlockDelta.delta).filter( + ([_, value]) => !!value + ); + throw new Error( + `Unsupported content block type: ${unsupportedField[0][0]}` + ); + } +} + +export function handleConverseStreamContentBlockStart( + contentBlockStart: ContentBlockStartEvent +): ChatGenerationChunk { + const index = contentBlockStart.contentBlockIndex; + if (contentBlockStart.start?.toolUse) { + return new ChatGenerationChunk({ + text: "", + message: new AIMessageChunk({ + content: "", + tool_call_chunks: [ + { + name: contentBlockStart.start.toolUse.name, + id: contentBlockStart.start.toolUse.toolUseId, + index, + }, + ], + }), + }); + } + throw new Error("Unsupported content block start event."); +} + +export function handleConverseStreamMetadata( + metadata: ConverseStreamMetadataEvent, + extra: { + streamUsage: boolean; + } +): ChatGenerationChunk { + const inputTokens = metadata.usage?.inputTokens ?? 0; + const outputTokens = metadata.usage?.outputTokens ?? 0; + const usage_metadata: UsageMetadata = { + input_tokens: inputTokens, + output_tokens: outputTokens, + total_tokens: metadata.usage?.totalTokens ?? inputTokens + outputTokens, + }; + return new ChatGenerationChunk({ + text: "", + message: new AIMessageChunk({ + content: "", + usage_metadata: extra.streamUsage ? usage_metadata : undefined, + response_metadata: { + // Use the same key as returned from the Converse API + metadata, + }, + }), + }); +} diff --git a/libs/langchain-aws/src/index.ts b/libs/langchain-aws/src/index.ts new file mode 100644 index 000000000000..bf58aa718fec --- /dev/null +++ b/libs/langchain-aws/src/index.ts @@ -0,0 +1,2 @@ +export * from "./chat_models.js"; +export * from "./types.js"; diff --git a/libs/langchain-aws/src/tests/chat_models.int.test.ts b/libs/langchain-aws/src/tests/chat_models.int.test.ts new file mode 100644 index 000000000000..bd8d547b90c2 --- /dev/null +++ b/libs/langchain-aws/src/tests/chat_models.int.test.ts @@ -0,0 +1,307 @@ +/* eslint-disable no-process-env */ +import { test, expect } from "@jest/globals"; +import { AIMessageChunk, HumanMessage } from "@langchain/core/messages"; +import { tool } from "@langchain/core/tools"; +import { z } from "zod"; +import { ChatBedrockConverse } from "../chat_models.js"; + +const baseConstructorArgs: Partial< + ConstructorParameters[0] +> = { + region: process.env.BEDROCK_AWS_REGION ?? "us-east-1", + credentials: { + secretAccessKey: process.env.BEDROCK_AWS_SECRET_ACCESS_KEY!, + accessKeyId: process.env.BEDROCK_AWS_ACCESS_KEY_ID!, + }, + maxRetries: 1, +}; + +test("Test ChatBedrockConverse can invoke", async () => { + const model = new ChatBedrockConverse({ + ...baseConstructorArgs, + maxTokens: 5, + }); + const res = await model.invoke([new HumanMessage("Print hello world")]); + console.log({ res }); + expect(typeof res.content).toBe("string"); + expect(res.content.length).toBeGreaterThan(1); + expect(res.content).not.toContain("world"); +}); + +test("Test ChatBedrockConverse stream method", async () => { + const model = new ChatBedrockConverse({ + ...baseConstructorArgs, + maxTokens: 50, + }); + const stream = await model.stream("Print hello world."); + const chunks = []; + for await (const chunk of stream) { + chunks.push(chunk); + } + const finalMessage = chunks.map((c) => c.content).join(""); + console.log(finalMessage); + expect(chunks.length).toBeGreaterThan(1); +}); + +test("Test ChatBedrockConverse in streaming mode", async () => { + let nrNewTokens = 0; + let streamedCompletion = ""; + + const model = new ChatBedrockConverse({ + ...baseConstructorArgs, + streaming: true, + maxTokens: 10, + callbacks: [ + { + async handleLLMNewToken(token: string) { + nrNewTokens += 1; + streamedCompletion += token; + }, + }, + ], + }); + const message = new HumanMessage("Hello!"); + const result = await model.invoke([message]); + console.log(result); + + expect(nrNewTokens > 0).toBe(true); + expect(result.content).toBe(streamedCompletion); +}, 10000); + +test("Test ChatBedrockConverse with stop", async () => { + const model = new ChatBedrockConverse({ + ...baseConstructorArgs, + maxTokens: 5, + }); + const res = await model.invoke([new HumanMessage("Print hello world")], { + stop: ["world"], + }); + console.log({ res }); + expect(typeof res.content).toBe("string"); + expect(res.content.length).toBeGreaterThan(1); + expect(res.content).not.toContain("world"); +}); + +test("Test ChatBedrockConverse stream method with early break", async () => { + const model = new ChatBedrockConverse({ + ...baseConstructorArgs, + maxTokens: 50, + }); + const stream = await model.stream( + "How is your day going? Be extremely verbose." + ); + let i = 0; + for await (const chunk of stream) { + console.log(chunk); + i += 1; + if (i > 10) { + break; + } + } +}); + +test("Streaming tokens can be found in usage_metadata field", async () => { + const model = new ChatBedrockConverse({ + ...baseConstructorArgs, + maxTokens: 5, + }); + const response = await model.stream("Hello, how are you?"); + let finalResult: AIMessageChunk | undefined; + for await (const chunk of response) { + if (finalResult) { + finalResult = finalResult.concat(chunk); + } else { + finalResult = chunk; + } + } + console.log({ + usage_metadata: finalResult?.usage_metadata, + }); + expect(finalResult).toBeTruthy(); + expect(finalResult?.usage_metadata).toBeTruthy(); + expect(finalResult?.usage_metadata?.input_tokens).toBeGreaterThan(0); + expect(finalResult?.usage_metadata?.output_tokens).toBeGreaterThan(0); + expect(finalResult?.usage_metadata?.total_tokens).toBeGreaterThan(0); +}); + +test("populates ID field on AIMessage", async () => { + const model = new ChatBedrockConverse({ + ...baseConstructorArgs, + maxTokens: 5, + }); + const response = await model.invoke("Hell"); + console.log({ + invokeId: response.id, + }); + expect(response.id?.length).toBeGreaterThan(1); + + /** + * Bedrock Converse does not include an ID in + * the response of a streaming call. + */ + + // Streaming + // let finalChunk: AIMessageChunk | undefined; + // for await (const chunk of await model.stream("Hell")) { + // if (!finalChunk) { + // finalChunk = chunk; + // } else { + // finalChunk = finalChunk.concat(chunk); + // } + // } + // console.log({ + // streamId: finalChunk?.id, + // }); + // expect(finalChunk?.id?.length).toBeGreaterThan(1); +}); + +test("Test ChatBedrockConverse can invoke tools", async () => { + const model = new ChatBedrockConverse({ + ...baseConstructorArgs, + }); + const tools = [ + tool( + (input) => { + console.log("tool", input); + return "Hello"; + }, + { + name: "get_weather", + description: "Get the weather", + schema: z.object({ + location: z.string().describe("Location to get the weather for"), + }), + } + ), + ]; + const modelWithTools = model.bindTools(tools); + const result = await modelWithTools.invoke([ + new HumanMessage("Get the weather for London"), + ]); + + expect(result.tool_calls).toBeDefined(); + expect(result.tool_calls).toHaveLength(1); + console.log("result.tool_calls?.[0]", result.tool_calls?.[0]); + expect(result.tool_calls?.[0].name).toBe("get_weather"); + expect(result.tool_calls?.[0].id).toBeDefined(); +}); + +test("Test ChatBedrockConverse can invoke tools with non anthropic model", async () => { + const model = new ChatBedrockConverse({ + ...baseConstructorArgs, + model: "cohere.command-r-v1:0", + }); + const tools = [ + tool( + (input) => { + console.log("tool", input); + return "Hello"; + }, + { + name: "get_weather", + description: "Get the weather", + schema: z.object({ + location: z.string().describe("Location to get the weather for"), + }), + } + ), + ]; + const modelWithTools = model.bindTools(tools); + const result = await modelWithTools.invoke([ + new HumanMessage("Get the weather for London"), + ]); + + expect(result.tool_calls).toBeDefined(); + expect(result.tool_calls).toHaveLength(1); + console.log("result.tool_calls?.[0]", result.tool_calls?.[0]); + expect(result.tool_calls?.[0].name).toBe("get_weather"); + expect(result.tool_calls?.[0].id).toBeDefined(); +}); + +test("Test ChatBedrockConverse can stream tools", async () => { + const model = new ChatBedrockConverse({ + ...baseConstructorArgs, + }); + const tools = [ + tool( + (input) => { + console.log("tool", input); + return "Hello"; + }, + { + name: "get_weather", + description: "Get the weather", + schema: z.object({ + location: z.string().describe("Location to get the weather for"), + }), + } + ), + ]; + const modelWithTools = model.bindTools(tools); + const stream = await modelWithTools.stream([ + new HumanMessage("Get the weather for London"), + ]); + + let finalChunk: AIMessageChunk | undefined; + for await (const chunk of stream) { + if (!finalChunk) { + finalChunk = chunk; + } else { + finalChunk = finalChunk.concat(chunk); + } + } + expect(finalChunk?.tool_calls).toBeDefined(); + expect(finalChunk?.tool_calls).toHaveLength(1); + console.log("result.tool_calls?.[0]", finalChunk?.tool_calls?.[0]); + expect(finalChunk?.tool_calls?.[0].name).toBe("get_weather"); + expect(finalChunk?.tool_calls?.[0].id).toBeDefined(); +}); + +test("Test ChatBedrockConverse tool_choice works", async () => { + const model = new ChatBedrockConverse({ + ...baseConstructorArgs, + }); + const tools = [ + tool( + (input) => { + console.log("tool", input); + return "Hello"; + }, + { + name: "get_weather", + description: "Get the weather", + schema: z.object({ + location: z.string().describe("Location to get the weather for"), + }), + } + ), + tool( + (input) => { + console.log("tool", input); + return "Hello"; + }, + { + name: "calculator", + description: "Sum two numbers", + schema: z.object({ + a: z.number().describe("First number to sum"), + b: z.number().describe("Second number to sum"), + }), + } + ), + ]; + const modelWithTools = model.bindTools(tools, { + tool_choice: "get_weather", + }); + const result = await modelWithTools.invoke([ + new HumanMessage( + "What is 261319136 plus 81863183? It is VERY important you tell me the answer to that math problem." + ), + ]); + + expect(result.tool_calls).toBeDefined(); + expect(result.tool_calls).toHaveLength(1); + console.log("result.tool_calls?.[0]", result.tool_calls?.[0]); + expect(result.tool_calls?.[0].name).toBe("get_weather"); + expect(result.tool_calls?.[0].id).toBeDefined(); +}); diff --git a/libs/langchain-aws/src/tests/chat_models.standard.int.test.ts b/libs/langchain-aws/src/tests/chat_models.standard.int.test.ts new file mode 100644 index 000000000000..bf222ea61ba3 --- /dev/null +++ b/libs/langchain-aws/src/tests/chat_models.standard.int.test.ts @@ -0,0 +1,61 @@ +/* eslint-disable no-process-env */ +import { test, expect } from "@jest/globals"; +import { ChatModelIntegrationTests } from "@langchain/standard-tests"; +import { AIMessageChunk } from "@langchain/core/messages"; +import { + ChatBedrockConverse, + ChatBedrockConverseCallOptions, +} from "../chat_models.js"; + +class ChatBedrockConverseStandardIntegrationTests extends ChatModelIntegrationTests< + ChatBedrockConverseCallOptions, + AIMessageChunk +> { + constructor() { + const region = process.env.BEDROCK_AWS_REGION ?? "us-east-1"; + super({ + Cls: ChatBedrockConverse, + chatModelHasToolCalling: true, + chatModelHasStructuredOutput: true, + constructorArgs: { + region, + model: "anthropic.claude-3-sonnet-20240229-v1:0", + credentials: { + secretAccessKey: process.env.BEDROCK_AWS_SECRET_ACCESS_KEY, + accessKeyId: process.env.BEDROCK_AWS_ACCESS_KEY_ID, + }, + }, + }); + } + + async testToolMessageHistoriesStringContent() { + this.skipTestMessage( + "testToolMessageHistoriesStringContent", + "ChatBedrockConverse", + "Not properly implemented." + ); + } + + async testToolMessageHistoriesListContent() { + this.skipTestMessage( + "testToolMessageHistoriesListContent", + "ChatBedrockConverse", + "Not properly implemented." + ); + } + + async testStructuredFewShotExamples() { + this.skipTestMessage( + "testStructuredFewShotExamples", + "ChatBedrockConverse", + "Not properly implemented." + ); + } +} + +const testClass = new ChatBedrockConverseStandardIntegrationTests(); + +test("ChatBedrockConverseStandardIntegrationTests", async () => { + const testResults = await testClass.runTests(); + expect(testResults).toBe(true); +}); diff --git a/libs/langchain-aws/src/tests/chat_models.standard.test.ts b/libs/langchain-aws/src/tests/chat_models.standard.test.ts new file mode 100644 index 000000000000..b22b59e932c2 --- /dev/null +++ b/libs/langchain-aws/src/tests/chat_models.standard.test.ts @@ -0,0 +1,41 @@ +/* eslint-disable no-process-env */ +import { test, expect } from "@jest/globals"; +import { ChatModelUnitTests } from "@langchain/standard-tests"; +import { AIMessageChunk } from "@langchain/core/messages"; +import { + ChatBedrockConverse, + ChatBedrockConverseCallOptions, +} from "../chat_models.js"; + +class ChatBedrockConverseStandardUnitTests extends ChatModelUnitTests< + ChatBedrockConverseCallOptions, + AIMessageChunk +> { + constructor() { + super({ + Cls: ChatBedrockConverse, + chatModelHasToolCalling: true, + chatModelHasStructuredOutput: true, + constructorArgs: {}, + }); + process.env.BEDROCK_AWS_SECRET_ACCESS_KEY = "test"; + process.env.BEDROCK_AWS_ACCESS_KEY_ID = "test"; + process.env.BEDROCK_AWS_SESSION_TOKEN = "test"; + process.env.AWS_DEFAULT_REGION = "us-east-1"; + } + + testChatModelInitApiKey() { + this.skipTestMessage( + "testChatModelInitApiKey", + "BedrockChat", + this.multipleApiKeysRequiredMessage + ); + } +} + +const testClass = new ChatBedrockConverseStandardUnitTests(); + +test("ChatBedrockConverseStandardUnitTests", () => { + const testResults = testClass.runTests(); + expect(testResults).toBe(true); +}); diff --git a/libs/langchain-aws/src/types.ts b/libs/langchain-aws/src/types.ts new file mode 100644 index 000000000000..0296c5e90e99 --- /dev/null +++ b/libs/langchain-aws/src/types.ts @@ -0,0 +1,16 @@ +import type { ToolChoice } from "@aws-sdk/client-bedrock-runtime"; +import type { AwsCredentialIdentity, Provider } from "@aws-sdk/types"; +import { ConverseCommand } from "@aws-sdk/client-bedrock-runtime"; + +export type CredentialType = + | AwsCredentialIdentity + | Provider; + +export type ConverseCommandParams = ConstructorParameters< + typeof ConverseCommand +>[0]; + +export type BedrockToolChoice = + | ToolChoice.AnyMember + | ToolChoice.AutoMember + | ToolChoice.ToolMember; diff --git a/libs/langchain-aws/tsconfig.cjs.json b/libs/langchain-aws/tsconfig.cjs.json new file mode 100644 index 000000000000..3b7026ea406c --- /dev/null +++ b/libs/langchain-aws/tsconfig.cjs.json @@ -0,0 +1,8 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "module": "commonjs", + "declaration": false + }, + "exclude": ["node_modules", "dist", "docs", "**/tests"] +} diff --git a/libs/langchain-aws/tsconfig.json b/libs/langchain-aws/tsconfig.json new file mode 100644 index 000000000000..bc85d83b6229 --- /dev/null +++ b/libs/langchain-aws/tsconfig.json @@ -0,0 +1,23 @@ +{ + "extends": "@tsconfig/recommended", + "compilerOptions": { + "outDir": "../dist", + "rootDir": "./src", + "target": "ES2021", + "lib": ["ES2021", "ES2022.Object", "DOM"], + "module": "ES2020", + "moduleResolution": "nodenext", + "esModuleInterop": true, + "declaration": true, + "noImplicitReturns": true, + "noFallthroughCasesInSwitch": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "useDefineForClassFields": true, + "strictPropertyInitialization": false, + "allowJs": true, + "strict": true + }, + "include": ["src/**/*"], + "exclude": ["node_modules", "dist", "docs"] +} diff --git a/libs/langchain-aws/turbo.json b/libs/langchain-aws/turbo.json new file mode 100644 index 000000000000..d024cee15c81 --- /dev/null +++ b/libs/langchain-aws/turbo.json @@ -0,0 +1,11 @@ +{ + "extends": ["//"], + "pipeline": { + "build": { + "outputs": ["**/dist/**"] + }, + "build:internal": { + "dependsOn": ["^build:internal"] + } + } +} diff --git a/yarn.lock b/yarn.lock index 72acfa4da29e..3cb5ed84b03e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -273,6 +273,17 @@ __metadata: languageName: node linkType: hard +"@aws-crypto/crc32@npm:5.2.0": + version: 5.2.0 + resolution: "@aws-crypto/crc32@npm:5.2.0" + dependencies: + "@aws-crypto/util": ^5.2.0 + "@aws-sdk/types": ^3.222.0 + tslib: ^2.6.2 + checksum: 1ddf7ec3fccf106205ff2476d90ae1d6625eabd47752f689c761b71e41fe451962b7a1c9ed25fe54e17dd747a62fbf4de06030fe56fe625f95285f6f70b96c57 + languageName: node + linkType: hard + "@aws-crypto/crc32c@npm:3.0.0": version: 3.0.0 resolution: "@aws-crypto/crc32c@npm:3.0.0" @@ -324,6 +335,21 @@ __metadata: languageName: node linkType: hard +"@aws-crypto/sha256-browser@npm:5.2.0": + version: 5.2.0 + resolution: "@aws-crypto/sha256-browser@npm:5.2.0" + dependencies: + "@aws-crypto/sha256-js": ^5.2.0 + "@aws-crypto/supports-web-crypto": ^5.2.0 + "@aws-crypto/util": ^5.2.0 + "@aws-sdk/types": ^3.222.0 + "@aws-sdk/util-locate-window": ^3.0.0 + "@smithy/util-utf8": ^2.0.0 + tslib: ^2.6.2 + checksum: 773f12f2026d82a6bb4a23a8f491894a6d32525bd9b8bfbc12896526cf11882a7607a671c478c45f9cd7d6ba1caaed48a62b67c6f725244bd83a1275108f46c7 + languageName: node + linkType: hard + "@aws-crypto/sha256-js@npm:3.0.0, @aws-crypto/sha256-js@npm:^3.0.0": version: 3.0.0 resolution: "@aws-crypto/sha256-js@npm:3.0.0" @@ -335,6 +361,17 @@ __metadata: languageName: node linkType: hard +"@aws-crypto/sha256-js@npm:5.2.0, @aws-crypto/sha256-js@npm:^5.2.0": + version: 5.2.0 + resolution: "@aws-crypto/sha256-js@npm:5.2.0" + dependencies: + "@aws-crypto/util": ^5.2.0 + "@aws-sdk/types": ^3.222.0 + tslib: ^2.6.2 + checksum: 007fbe0436d714d0d0d282e2b61c90e45adcb9ad75eac9ac7ba03d32b56624afd09b2a9ceb4d659661cf17c51d74d1900ab6b00eacafc002da1101664955ca53 + languageName: node + linkType: hard + "@aws-crypto/sha256-js@npm:^5.0.0": version: 5.0.0 resolution: "@aws-crypto/sha256-js@npm:5.0.0" @@ -355,6 +392,15 @@ __metadata: languageName: node linkType: hard +"@aws-crypto/supports-web-crypto@npm:^5.2.0": + version: 5.2.0 + resolution: "@aws-crypto/supports-web-crypto@npm:5.2.0" + dependencies: + tslib: ^2.6.2 + checksum: 6ffc21de48b2b2c3e918193101d7e8fe949d47b37688892e1c39eaedaa938be80c0f404fe1c874c30cce16781026777a53bf47d5d90143ca91d0feb7c4a6f830 + languageName: node + linkType: hard + "@aws-crypto/util@npm:^3.0.0": version: 3.0.0 resolution: "@aws-crypto/util@npm:3.0.0" @@ -377,6 +423,17 @@ __metadata: languageName: node linkType: hard +"@aws-crypto/util@npm:^5.2.0": + version: 5.2.0 + resolution: "@aws-crypto/util@npm:5.2.0" + dependencies: + "@aws-sdk/types": ^3.222.0 + "@smithy/util-utf8": ^2.0.0 + tslib: ^2.6.2 + checksum: f0f81d9d2771c59946cfec48b86cb23d39f78a966c4a1f89d4753abdc3cb38de06f907d1e6450059b121d48ac65d612ab88bdb70014553a077fc3dabddfbf8d6 + languageName: node + linkType: hard + "@aws-sdk/abort-controller@npm:3.310.0": version: 3.310.0 resolution: "@aws-sdk/abort-controller@npm:3.310.0" @@ -510,6 +567,59 @@ __metadata: languageName: node linkType: hard +"@aws-sdk/client-bedrock-runtime@npm:^3.602.0": + version: 3.602.0 + resolution: "@aws-sdk/client-bedrock-runtime@npm:3.602.0" + dependencies: + "@aws-crypto/sha256-browser": 5.2.0 + "@aws-crypto/sha256-js": 5.2.0 + "@aws-sdk/client-sso-oidc": 3.600.0 + "@aws-sdk/client-sts": 3.600.0 + "@aws-sdk/core": 3.598.0 + "@aws-sdk/credential-provider-node": 3.600.0 + "@aws-sdk/middleware-host-header": 3.598.0 + "@aws-sdk/middleware-logger": 3.598.0 + "@aws-sdk/middleware-recursion-detection": 3.598.0 + "@aws-sdk/middleware-user-agent": 3.598.0 + "@aws-sdk/region-config-resolver": 3.598.0 + "@aws-sdk/types": 3.598.0 + "@aws-sdk/util-endpoints": 3.598.0 + "@aws-sdk/util-user-agent-browser": 3.598.0 + "@aws-sdk/util-user-agent-node": 3.598.0 + "@smithy/config-resolver": ^3.0.2 + "@smithy/core": ^2.2.1 + "@smithy/eventstream-serde-browser": ^3.0.2 + "@smithy/eventstream-serde-config-resolver": ^3.0.1 + "@smithy/eventstream-serde-node": ^3.0.2 + "@smithy/fetch-http-handler": ^3.0.2 + "@smithy/hash-node": ^3.0.1 + "@smithy/invalid-dependency": ^3.0.1 + "@smithy/middleware-content-length": ^3.0.1 + "@smithy/middleware-endpoint": ^3.0.2 + "@smithy/middleware-retry": ^3.0.4 + "@smithy/middleware-serde": ^3.0.1 + "@smithy/middleware-stack": ^3.0.1 + "@smithy/node-config-provider": ^3.1.1 + "@smithy/node-http-handler": ^3.0.1 + "@smithy/protocol-http": ^4.0.1 + "@smithy/smithy-client": ^3.1.2 + "@smithy/types": ^3.1.0 + "@smithy/url-parser": ^3.0.1 + "@smithy/util-base64": ^3.0.0 + "@smithy/util-body-length-browser": ^3.0.0 + "@smithy/util-body-length-node": ^3.0.0 + "@smithy/util-defaults-mode-browser": ^3.0.4 + "@smithy/util-defaults-mode-node": ^3.0.4 + "@smithy/util-endpoints": ^2.0.2 + "@smithy/util-middleware": ^3.0.1 + "@smithy/util-retry": ^3.0.1 + "@smithy/util-stream": ^3.0.2 + "@smithy/util-utf8": ^3.0.0 + tslib: ^2.6.2 + checksum: 6a0539c36fbacd5d1d49297466e3083ccd54622f5c32e4fa26579b07a8f3175072237586c69b4e43a153bba8ee33a74034587e9bbca7d05bfa312800e8977c9b + languageName: node + linkType: hard + "@aws-sdk/client-cognito-identity@npm:3.592.0": version: 3.592.0 resolution: "@aws-sdk/client-cognito-identity@npm:3.592.0" @@ -1161,6 +1271,54 @@ __metadata: languageName: node linkType: hard +"@aws-sdk/client-sso-oidc@npm:3.600.0": + version: 3.600.0 + resolution: "@aws-sdk/client-sso-oidc@npm:3.600.0" + dependencies: + "@aws-crypto/sha256-browser": 5.2.0 + "@aws-crypto/sha256-js": 5.2.0 + "@aws-sdk/client-sts": 3.600.0 + "@aws-sdk/core": 3.598.0 + "@aws-sdk/credential-provider-node": 3.600.0 + "@aws-sdk/middleware-host-header": 3.598.0 + "@aws-sdk/middleware-logger": 3.598.0 + "@aws-sdk/middleware-recursion-detection": 3.598.0 + "@aws-sdk/middleware-user-agent": 3.598.0 + "@aws-sdk/region-config-resolver": 3.598.0 + "@aws-sdk/types": 3.598.0 + "@aws-sdk/util-endpoints": 3.598.0 + "@aws-sdk/util-user-agent-browser": 3.598.0 + "@aws-sdk/util-user-agent-node": 3.598.0 + "@smithy/config-resolver": ^3.0.2 + "@smithy/core": ^2.2.1 + "@smithy/fetch-http-handler": ^3.0.2 + "@smithy/hash-node": ^3.0.1 + "@smithy/invalid-dependency": ^3.0.1 + "@smithy/middleware-content-length": ^3.0.1 + "@smithy/middleware-endpoint": ^3.0.2 + "@smithy/middleware-retry": ^3.0.4 + "@smithy/middleware-serde": ^3.0.1 + "@smithy/middleware-stack": ^3.0.1 + "@smithy/node-config-provider": ^3.1.1 + "@smithy/node-http-handler": ^3.0.1 + "@smithy/protocol-http": ^4.0.1 + "@smithy/smithy-client": ^3.1.2 + "@smithy/types": ^3.1.0 + "@smithy/url-parser": ^3.0.1 + "@smithy/util-base64": ^3.0.0 + "@smithy/util-body-length-browser": ^3.0.0 + "@smithy/util-body-length-node": ^3.0.0 + "@smithy/util-defaults-mode-browser": ^3.0.4 + "@smithy/util-defaults-mode-node": ^3.0.4 + "@smithy/util-endpoints": ^2.0.2 + "@smithy/util-middleware": ^3.0.1 + "@smithy/util-retry": ^3.0.1 + "@smithy/util-utf8": ^3.0.0 + tslib: ^2.6.2 + checksum: ef7a40ce69de30b25a8a7a5ee035f17e87edc1060c128b3b50f30f19b681aaa7b99b564ffc348cd74fe0e1079bd46087a6784674266d743c45564bcd4d5221b3 + languageName: node + linkType: hard + "@aws-sdk/client-sso@npm:3.310.0": version: 3.310.0 resolution: "@aws-sdk/client-sso@npm:3.310.0" @@ -1543,6 +1701,52 @@ __metadata: languageName: node linkType: hard +"@aws-sdk/client-sso@npm:3.598.0": + version: 3.598.0 + resolution: "@aws-sdk/client-sso@npm:3.598.0" + dependencies: + "@aws-crypto/sha256-browser": 5.2.0 + "@aws-crypto/sha256-js": 5.2.0 + "@aws-sdk/core": 3.598.0 + "@aws-sdk/middleware-host-header": 3.598.0 + "@aws-sdk/middleware-logger": 3.598.0 + "@aws-sdk/middleware-recursion-detection": 3.598.0 + "@aws-sdk/middleware-user-agent": 3.598.0 + "@aws-sdk/region-config-resolver": 3.598.0 + "@aws-sdk/types": 3.598.0 + "@aws-sdk/util-endpoints": 3.598.0 + "@aws-sdk/util-user-agent-browser": 3.598.0 + "@aws-sdk/util-user-agent-node": 3.598.0 + "@smithy/config-resolver": ^3.0.2 + "@smithy/core": ^2.2.1 + "@smithy/fetch-http-handler": ^3.0.2 + "@smithy/hash-node": ^3.0.1 + "@smithy/invalid-dependency": ^3.0.1 + "@smithy/middleware-content-length": ^3.0.1 + "@smithy/middleware-endpoint": ^3.0.2 + "@smithy/middleware-retry": ^3.0.4 + "@smithy/middleware-serde": ^3.0.1 + "@smithy/middleware-stack": ^3.0.1 + "@smithy/node-config-provider": ^3.1.1 + "@smithy/node-http-handler": ^3.0.1 + "@smithy/protocol-http": ^4.0.1 + "@smithy/smithy-client": ^3.1.2 + "@smithy/types": ^3.1.0 + "@smithy/url-parser": ^3.0.1 + "@smithy/util-base64": ^3.0.0 + "@smithy/util-body-length-browser": ^3.0.0 + "@smithy/util-body-length-node": ^3.0.0 + "@smithy/util-defaults-mode-browser": ^3.0.4 + "@smithy/util-defaults-mode-node": ^3.0.4 + "@smithy/util-endpoints": ^2.0.2 + "@smithy/util-middleware": ^3.0.1 + "@smithy/util-retry": ^3.0.1 + "@smithy/util-utf8": ^3.0.0 + tslib: ^2.6.2 + checksum: b570f54643ac0ab0f300bf074e77c2fbba70206a11d2aed1f6ecd361027f2f6a1d62719627e905bcb44dd73d481a29ef5a70878c676386afe2a133f479a445d4 + languageName: node + linkType: hard + "@aws-sdk/client-sts@npm:3.310.0": version: 3.310.0 resolution: "@aws-sdk/client-sts@npm:3.310.0" @@ -1911,6 +2115,54 @@ __metadata: languageName: node linkType: hard +"@aws-sdk/client-sts@npm:3.600.0": + version: 3.600.0 + resolution: "@aws-sdk/client-sts@npm:3.600.0" + dependencies: + "@aws-crypto/sha256-browser": 5.2.0 + "@aws-crypto/sha256-js": 5.2.0 + "@aws-sdk/client-sso-oidc": 3.600.0 + "@aws-sdk/core": 3.598.0 + "@aws-sdk/credential-provider-node": 3.600.0 + "@aws-sdk/middleware-host-header": 3.598.0 + "@aws-sdk/middleware-logger": 3.598.0 + "@aws-sdk/middleware-recursion-detection": 3.598.0 + "@aws-sdk/middleware-user-agent": 3.598.0 + "@aws-sdk/region-config-resolver": 3.598.0 + "@aws-sdk/types": 3.598.0 + "@aws-sdk/util-endpoints": 3.598.0 + "@aws-sdk/util-user-agent-browser": 3.598.0 + "@aws-sdk/util-user-agent-node": 3.598.0 + "@smithy/config-resolver": ^3.0.2 + "@smithy/core": ^2.2.1 + "@smithy/fetch-http-handler": ^3.0.2 + "@smithy/hash-node": ^3.0.1 + "@smithy/invalid-dependency": ^3.0.1 + "@smithy/middleware-content-length": ^3.0.1 + "@smithy/middleware-endpoint": ^3.0.2 + "@smithy/middleware-retry": ^3.0.4 + "@smithy/middleware-serde": ^3.0.1 + "@smithy/middleware-stack": ^3.0.1 + "@smithy/node-config-provider": ^3.1.1 + "@smithy/node-http-handler": ^3.0.1 + "@smithy/protocol-http": ^4.0.1 + "@smithy/smithy-client": ^3.1.2 + "@smithy/types": ^3.1.0 + "@smithy/url-parser": ^3.0.1 + "@smithy/util-base64": ^3.0.0 + "@smithy/util-body-length-browser": ^3.0.0 + "@smithy/util-body-length-node": ^3.0.0 + "@smithy/util-defaults-mode-browser": ^3.0.4 + "@smithy/util-defaults-mode-node": ^3.0.4 + "@smithy/util-endpoints": ^2.0.2 + "@smithy/util-middleware": ^3.0.1 + "@smithy/util-retry": ^3.0.1 + "@smithy/util-utf8": ^3.0.0 + tslib: ^2.6.2 + checksum: 47d6d145d481c8dc285b68baccf36ab76b92ed1fbf5a58a0900bbe913a7caf3eddc84414428b013e58c91242e7ffd5a55b0620217dc295c75c2729ccb89b9ae8 + languageName: node + linkType: hard + "@aws-sdk/config-resolver@npm:3.310.0": version: 3.310.0 resolution: "@aws-sdk/config-resolver@npm:3.310.0" @@ -1979,6 +2231,21 @@ __metadata: languageName: node linkType: hard +"@aws-sdk/core@npm:3.598.0": + version: 3.598.0 + resolution: "@aws-sdk/core@npm:3.598.0" + dependencies: + "@smithy/core": ^2.2.1 + "@smithy/protocol-http": ^4.0.1 + "@smithy/signature-v4": ^3.1.0 + "@smithy/smithy-client": ^3.1.2 + "@smithy/types": ^3.1.0 + fast-xml-parser: 4.2.5 + tslib: ^2.6.2 + checksum: e58944a6571808b53d21f012b9671ffec597d2a826a9c0f1fbcbe160189a3c47f5b4671ac92b7437c349f19b8a8df7e12255c57795ab0224c318ed69a0d23229 + languageName: node + linkType: hard + "@aws-sdk/credential-provider-cognito-identity@npm:3.592.0": version: 3.592.0 resolution: "@aws-sdk/credential-provider-cognito-identity@npm:3.592.0" @@ -2074,6 +2341,18 @@ __metadata: languageName: node linkType: hard +"@aws-sdk/credential-provider-env@npm:3.598.0": + version: 3.598.0 + resolution: "@aws-sdk/credential-provider-env@npm:3.598.0" + dependencies: + "@aws-sdk/types": 3.598.0 + "@smithy/property-provider": ^3.1.1 + "@smithy/types": ^3.1.0 + tslib: ^2.6.2 + checksum: 517f06dd47b7aa4c8d5a9fe82698150237c28c46ed9f82cd1d92d1453690b9d6139b65519d92dea611d319c4418fe4540e7d52c03d3897e7e471731fb0156afb + languageName: node + linkType: hard + "@aws-sdk/credential-provider-http@npm:3.582.0": version: 3.582.0 resolution: "@aws-sdk/credential-provider-http@npm:3.582.0" @@ -2108,6 +2387,23 @@ __metadata: languageName: node linkType: hard +"@aws-sdk/credential-provider-http@npm:3.598.0": + version: 3.598.0 + resolution: "@aws-sdk/credential-provider-http@npm:3.598.0" + dependencies: + "@aws-sdk/types": 3.598.0 + "@smithy/fetch-http-handler": ^3.0.2 + "@smithy/node-http-handler": ^3.0.1 + "@smithy/property-provider": ^3.1.1 + "@smithy/protocol-http": ^4.0.1 + "@smithy/smithy-client": ^3.1.2 + "@smithy/types": ^3.1.0 + "@smithy/util-stream": ^3.0.2 + tslib: ^2.6.2 + checksum: e2f6208491a6e58b7ac7368c2247dee55080be740511ded01cc3454920ef29d0b7712930571651a8d0ec2aea4e0a107c7d5dd6ecd01bd4de3c264c54e32959b3 + languageName: node + linkType: hard + "@aws-sdk/credential-provider-imds@npm:3.310.0": version: 3.310.0 resolution: "@aws-sdk/credential-provider-imds@npm:3.310.0" @@ -2297,6 +2593,27 @@ __metadata: languageName: node linkType: hard +"@aws-sdk/credential-provider-ini@npm:3.598.0": + version: 3.598.0 + resolution: "@aws-sdk/credential-provider-ini@npm:3.598.0" + dependencies: + "@aws-sdk/credential-provider-env": 3.598.0 + "@aws-sdk/credential-provider-http": 3.598.0 + "@aws-sdk/credential-provider-process": 3.598.0 + "@aws-sdk/credential-provider-sso": 3.598.0 + "@aws-sdk/credential-provider-web-identity": 3.598.0 + "@aws-sdk/types": 3.598.0 + "@smithy/credential-provider-imds": ^3.1.1 + "@smithy/property-provider": ^3.1.1 + "@smithy/shared-ini-file-loader": ^3.1.1 + "@smithy/types": ^3.1.0 + tslib: ^2.6.2 + peerDependencies: + "@aws-sdk/client-sts": ^3.598.0 + checksum: 9fab1e9c312e20150c96daf15e0347b79f0589cc44eb299c15e80c7d5380e8966805fa8893d3c906f99b7eb3c0f872f0795415f75921204580a30d869dd87f54 + languageName: node + linkType: hard + "@aws-sdk/credential-provider-node@npm:3.310.0": version: 3.310.0 resolution: "@aws-sdk/credential-provider-node@npm:3.310.0" @@ -2447,6 +2764,26 @@ __metadata: languageName: node linkType: hard +"@aws-sdk/credential-provider-node@npm:3.600.0, @aws-sdk/credential-provider-node@npm:^3.600.0": + version: 3.600.0 + resolution: "@aws-sdk/credential-provider-node@npm:3.600.0" + dependencies: + "@aws-sdk/credential-provider-env": 3.598.0 + "@aws-sdk/credential-provider-http": 3.598.0 + "@aws-sdk/credential-provider-ini": 3.598.0 + "@aws-sdk/credential-provider-process": 3.598.0 + "@aws-sdk/credential-provider-sso": 3.598.0 + "@aws-sdk/credential-provider-web-identity": 3.598.0 + "@aws-sdk/types": 3.598.0 + "@smithy/credential-provider-imds": ^3.1.1 + "@smithy/property-provider": ^3.1.1 + "@smithy/shared-ini-file-loader": ^3.1.1 + "@smithy/types": ^3.1.0 + tslib: ^2.6.2 + checksum: 480c7c36a8558667a25617e6f7f2292b4362b0e894bc204ce62f565dc8e8cc46c713dc04621321336ce715b493590b3b854b33dc6d5123ed39a17643158d94fc + languageName: node + linkType: hard + "@aws-sdk/credential-provider-node@npm:^3.388.0": version: 3.388.0 resolution: "@aws-sdk/credential-provider-node@npm:3.388.0" @@ -2555,6 +2892,19 @@ __metadata: languageName: node linkType: hard +"@aws-sdk/credential-provider-process@npm:3.598.0": + version: 3.598.0 + resolution: "@aws-sdk/credential-provider-process@npm:3.598.0" + dependencies: + "@aws-sdk/types": 3.598.0 + "@smithy/property-provider": ^3.1.1 + "@smithy/shared-ini-file-loader": ^3.1.1 + "@smithy/types": ^3.1.0 + tslib: ^2.6.2 + checksum: cd1f0dbbc38b137a0e9c2cfa9bb9e55eed1da5166e13576295205d276ab313e9d4a2f97a566d576abc85c6f4e9e84ad676ca5c32f90de17e027d6a1372fb00e6 + languageName: node + linkType: hard + "@aws-sdk/credential-provider-sso@npm:3.310.0": version: 3.310.0 resolution: "@aws-sdk/credential-provider-sso@npm:3.310.0" @@ -2686,6 +3036,21 @@ __metadata: languageName: node linkType: hard +"@aws-sdk/credential-provider-sso@npm:3.598.0": + version: 3.598.0 + resolution: "@aws-sdk/credential-provider-sso@npm:3.598.0" + dependencies: + "@aws-sdk/client-sso": 3.598.0 + "@aws-sdk/token-providers": 3.598.0 + "@aws-sdk/types": 3.598.0 + "@smithy/property-provider": ^3.1.1 + "@smithy/shared-ini-file-loader": ^3.1.1 + "@smithy/types": ^3.1.0 + tslib: ^2.6.2 + checksum: 16828609b9ac17772eecd89deb9ac9b98a1decad42ca1f8cf6a57e6873eeb3563db00bfb67684cbb08108d5ee6b8f98ec23047d7f6750cb67c1342cd8b96ac1c + languageName: node + linkType: hard + "@aws-sdk/credential-provider-web-identity@npm:3.310.0": version: 3.310.0 resolution: "@aws-sdk/credential-provider-web-identity@npm:3.310.0" @@ -2772,6 +3137,20 @@ __metadata: languageName: node linkType: hard +"@aws-sdk/credential-provider-web-identity@npm:3.598.0": + version: 3.598.0 + resolution: "@aws-sdk/credential-provider-web-identity@npm:3.598.0" + dependencies: + "@aws-sdk/types": 3.598.0 + "@smithy/property-provider": ^3.1.1 + "@smithy/types": ^3.1.0 + tslib: ^2.6.2 + peerDependencies: + "@aws-sdk/client-sts": ^3.598.0 + checksum: e62352ae7f408ae8969d22fd42a502ec078536952be1253f184bf96c57f3c88589fd431762b2300b494159df4eb4af975358645772ac36f2cc722c86a88ff85e + languageName: node + linkType: hard + "@aws-sdk/credential-providers@npm:^3.583.0": version: 3.592.0 resolution: "@aws-sdk/credential-providers@npm:3.592.0" @@ -3189,6 +3568,18 @@ __metadata: languageName: node linkType: hard +"@aws-sdk/middleware-host-header@npm:3.598.0": + version: 3.598.0 + resolution: "@aws-sdk/middleware-host-header@npm:3.598.0" + dependencies: + "@aws-sdk/types": 3.598.0 + "@smithy/protocol-http": ^4.0.1 + "@smithy/types": ^3.1.0 + tslib: ^2.6.2 + checksum: c505de5bf4f39051a55011b9b2da0b673bda668def00a9b3b4696a3146bfbf0e5509d3bde28ef238648158b863816ce85fbf5829228bb97450c826b7d24d40d0 + languageName: node + linkType: hard + "@aws-sdk/middleware-location-constraint@npm:3.310.0": version: 3.310.0 resolution: "@aws-sdk/middleware-location-constraint@npm:3.310.0" @@ -3273,6 +3664,17 @@ __metadata: languageName: node linkType: hard +"@aws-sdk/middleware-logger@npm:3.598.0": + version: 3.598.0 + resolution: "@aws-sdk/middleware-logger@npm:3.598.0" + dependencies: + "@aws-sdk/types": 3.598.0 + "@smithy/types": ^3.1.0 + tslib: ^2.6.2 + checksum: 8c90bf68b65fe82ae08bf0c665bfea335fef757f8be7ddac6f9059f9f149c9bebc68e034bc225d131d168a61d61a409936d4f4d260c4b2aa2251385238df765a + languageName: node + linkType: hard + "@aws-sdk/middleware-recursion-detection@npm:3.310.0": version: 3.310.0 resolution: "@aws-sdk/middleware-recursion-detection@npm:3.310.0" @@ -3354,6 +3756,18 @@ __metadata: languageName: node linkType: hard +"@aws-sdk/middleware-recursion-detection@npm:3.598.0": + version: 3.598.0 + resolution: "@aws-sdk/middleware-recursion-detection@npm:3.598.0" + dependencies: + "@aws-sdk/types": 3.598.0 + "@smithy/protocol-http": ^4.0.1 + "@smithy/types": ^3.1.0 + tslib: ^2.6.2 + checksum: 161247dbbc8aa31d77c8d4c9c55264c775b5f9996e58451574605435c4a0ff6b9fce28be6f133ddce9f93a24f08c7af6fde59ef93ecb2cc4cd170a4db72b4833 + languageName: node + linkType: hard + "@aws-sdk/middleware-retry@npm:3.310.0": version: 3.310.0 resolution: "@aws-sdk/middleware-retry@npm:3.310.0" @@ -3711,6 +4125,19 @@ __metadata: languageName: node linkType: hard +"@aws-sdk/middleware-user-agent@npm:3.598.0": + version: 3.598.0 + resolution: "@aws-sdk/middleware-user-agent@npm:3.598.0" + dependencies: + "@aws-sdk/types": 3.598.0 + "@aws-sdk/util-endpoints": 3.598.0 + "@smithy/protocol-http": ^4.0.1 + "@smithy/types": ^3.1.0 + tslib: ^2.6.2 + checksum: 11dcf64badadf8c6b3283b3cec4cb684467eaf57206782c68a9b758e6f7a4f1b632d5ed89bb6ffbc855bf6d3fb855f0a56858bda640a67c0812ced08cd19959f + languageName: node + linkType: hard + "@aws-sdk/node-config-provider@npm:3.310.0": version: 3.310.0 resolution: "@aws-sdk/node-config-provider@npm:3.310.0" @@ -3934,6 +4361,20 @@ __metadata: languageName: node linkType: hard +"@aws-sdk/region-config-resolver@npm:3.598.0": + version: 3.598.0 + resolution: "@aws-sdk/region-config-resolver@npm:3.598.0" + dependencies: + "@aws-sdk/types": 3.598.0 + "@smithy/node-config-provider": ^3.1.1 + "@smithy/types": ^3.1.0 + "@smithy/util-config-provider": ^3.0.0 + "@smithy/util-middleware": ^3.0.1 + tslib: ^2.6.2 + checksum: 649115771cb6b77e793088f3ee6eec346c1379f9f5d0e925f71103ad55c5f4a1132fca7e859a6b75ff46ecd1cc165a4eb260227596e4a2871118e6918602a726 + languageName: node + linkType: hard + "@aws-sdk/service-error-classification@npm:3.310.0": version: 3.310.0 resolution: "@aws-sdk/service-error-classification@npm:3.310.0" @@ -4294,6 +4735,21 @@ __metadata: languageName: node linkType: hard +"@aws-sdk/token-providers@npm:3.598.0": + version: 3.598.0 + resolution: "@aws-sdk/token-providers@npm:3.598.0" + dependencies: + "@aws-sdk/types": 3.598.0 + "@smithy/property-provider": ^3.1.1 + "@smithy/shared-ini-file-loader": ^3.1.1 + "@smithy/types": ^3.1.0 + tslib: ^2.6.2 + peerDependencies: + "@aws-sdk/client-sso-oidc": ^3.598.0 + checksum: 24197672226e1e953fa57ca10c6adae9c3f6b571fbf40f517609e028d8ea6ab45c3afd285bd999bc35c0690b3427be04d4af3f677ced6778b0a716e0dd4e5280 + languageName: node + linkType: hard + "@aws-sdk/types@npm:3.310.0, @aws-sdk/types@npm:^3.222.0": version: 3.310.0 resolution: "@aws-sdk/types@npm:3.310.0" @@ -4352,6 +4808,16 @@ __metadata: languageName: node linkType: hard +"@aws-sdk/types@npm:3.598.0, @aws-sdk/types@npm:^3.598.0": + version: 3.598.0 + resolution: "@aws-sdk/types@npm:3.598.0" + dependencies: + "@smithy/types": ^3.1.0 + tslib: ^2.6.2 + checksum: 9b2bd50d6935422dd1046e6eaa48c4c774d06aa1374bf4600a3af2c7a52432b5e25ec111cf49976b07b03d7cb5f4fa6fd44b7ce8a67dd0b3a4cee4abaf9e6fa5 + languageName: node + linkType: hard + "@aws-sdk/types@npm:^3.357.0": version: 3.378.0 resolution: "@aws-sdk/types@npm:3.378.0" @@ -4631,6 +5097,18 @@ __metadata: languageName: node linkType: hard +"@aws-sdk/util-endpoints@npm:3.598.0": + version: 3.598.0 + resolution: "@aws-sdk/util-endpoints@npm:3.598.0" + dependencies: + "@aws-sdk/types": 3.598.0 + "@smithy/types": ^3.1.0 + "@smithy/util-endpoints": ^2.0.2 + tslib: ^2.6.2 + checksum: 6fb92e8c99b6ce96cda21c9d1744a290c683bae8d82394c1b1fe7ed7d3cb0a18d4025b8863532680db3f550ad130e54d528c64a0a32f398f3c00c5ce2e043ecd + languageName: node + linkType: hard + "@aws-sdk/util-hex-encoding@npm:3.310.0": version: 3.310.0 resolution: "@aws-sdk/util-hex-encoding@npm:3.310.0" @@ -4844,6 +5322,18 @@ __metadata: languageName: node linkType: hard +"@aws-sdk/util-user-agent-browser@npm:3.598.0": + version: 3.598.0 + resolution: "@aws-sdk/util-user-agent-browser@npm:3.598.0" + dependencies: + "@aws-sdk/types": 3.598.0 + "@smithy/types": ^3.1.0 + bowser: ^2.11.0 + tslib: ^2.6.2 + checksum: c53afc0fe7a07838ad22ae1e9ed6834d56a69cb0ad623d4912deeaa715af479b64266965fce30e7210e576118f80ceb525f79f504dc459fe0294fd15e694752e + languageName: node + linkType: hard + "@aws-sdk/util-user-agent-node@npm:3.310.0": version: 3.310.0 resolution: "@aws-sdk/util-user-agent-node@npm:3.310.0" @@ -4961,6 +5451,23 @@ __metadata: languageName: node linkType: hard +"@aws-sdk/util-user-agent-node@npm:3.598.0": + version: 3.598.0 + resolution: "@aws-sdk/util-user-agent-node@npm:3.598.0" + dependencies: + "@aws-sdk/types": 3.598.0 + "@smithy/node-config-provider": ^3.1.1 + "@smithy/types": ^3.1.0 + tslib: ^2.6.2 + peerDependencies: + aws-crt: ">=1.0.0" + peerDependenciesMeta: + aws-crt: + optional: true + checksum: 1560fabf19b236cfbce42769e1ef7e46bdad881b8a4b0ce069401d9a6edd5e1b195f45cb2847abf9ef1453d2e69447e7a3dabc92b037d9a41fe58960538db1ae + languageName: node + linkType: hard + "@aws-sdk/util-utf8-browser@npm:^3.0.0": version: 3.259.0 resolution: "@aws-sdk/util-utf8-browser@npm:3.259.0" @@ -9428,6 +9935,43 @@ __metadata: languageName: unknown linkType: soft +"@langchain/aws@workspace:*, @langchain/aws@workspace:libs/langchain-aws": + version: 0.0.0-use.local + resolution: "@langchain/aws@workspace:libs/langchain-aws" + dependencies: + "@aws-sdk/client-bedrock-runtime": ^3.602.0 + "@aws-sdk/credential-provider-node": ^3.600.0 + "@aws-sdk/types": ^3.598.0 + "@jest/globals": ^29.5.0 + "@langchain/core": ">=0.2.9 <0.3.0" + "@langchain/scripts": ~0.0.14 + "@langchain/standard-tests": 0.0.0 + "@smithy/types": ^3.2.0 + "@swc/core": ^1.3.90 + "@swc/jest": ^0.2.29 + "@tsconfig/recommended": ^1.0.3 + "@typescript-eslint/eslint-plugin": ^6.12.0 + "@typescript-eslint/parser": ^6.12.0 + dotenv: ^16.3.1 + dpdm: ^3.12.0 + eslint: ^8.33.0 + eslint-config-airbnb-base: ^15.0.0 + eslint-config-prettier: ^8.6.0 + eslint-plugin-import: ^2.27.5 + eslint-plugin-no-instanceof: ^1.0.1 + eslint-plugin-prettier: ^4.2.1 + jest: ^29.5.0 + jest-environment-node: ^29.6.4 + prettier: ^2.8.3 + release-it: ^15.10.1 + rollup: ^4.5.2 + ts-jest: ^29.1.0 + typescript: <5.2.0 + zod: ^3.22.4 + zod-to-json-schema: ^3.22.5 + languageName: unknown + linkType: soft + "@langchain/azure-dynamic-sessions@workspace:^, @langchain/azure-dynamic-sessions@workspace:libs/langchain-azure-dynamic-sessions": version: 0.0.0-use.local resolution: "@langchain/azure-dynamic-sessions@workspace:libs/langchain-azure-dynamic-sessions" @@ -12341,6 +12885,16 @@ __metadata: languageName: node linkType: hard +"@smithy/abort-controller@npm:^3.1.0": + version: 3.1.0 + resolution: "@smithy/abort-controller@npm:3.1.0" + dependencies: + "@smithy/types": ^3.2.0 + tslib: ^2.6.2 + checksum: 78643bddda2bcb68e00bb95ae866741407236b92b1834796c0855710950386ae1e5e67d72fb42ec444e8a4dc4357a1527c4f331324a2fad156468f5a0cccf128 + languageName: node + linkType: hard + "@smithy/config-resolver@npm:^2.0.11": version: 2.0.11 resolution: "@smithy/config-resolver@npm:2.0.11" @@ -12418,6 +12972,19 @@ __metadata: languageName: node linkType: hard +"@smithy/config-resolver@npm:^3.0.2, @smithy/config-resolver@npm:^3.0.3": + version: 3.0.3 + resolution: "@smithy/config-resolver@npm:3.0.3" + dependencies: + "@smithy/node-config-provider": ^3.1.2 + "@smithy/types": ^3.2.0 + "@smithy/util-config-provider": ^3.0.0 + "@smithy/util-middleware": ^3.0.2 + tslib: ^2.6.2 + checksum: 7a7baf23e64ed85d4229bfd320a3ea96087c57ce1b94638a89bab5f92dcc24ec22c11740d90f2fab38eb39eeb860463ae98b24598555c2b55a01bd79c20ef99b + languageName: node + linkType: hard + "@smithy/core@npm:^1.2.2": version: 1.2.2 resolution: "@smithy/core@npm:1.2.2" @@ -12466,6 +13033,22 @@ __metadata: languageName: node linkType: hard +"@smithy/core@npm:^2.2.1": + version: 2.2.3 + resolution: "@smithy/core@npm:2.2.3" + dependencies: + "@smithy/middleware-endpoint": ^3.0.3 + "@smithy/middleware-retry": ^3.0.6 + "@smithy/middleware-serde": ^3.0.2 + "@smithy/protocol-http": ^4.0.2 + "@smithy/smithy-client": ^3.1.4 + "@smithy/types": ^3.2.0 + "@smithy/util-middleware": ^3.0.2 + tslib: ^2.6.2 + checksum: 6addaede7f4699c48d690872647bbc86efc5bf9adb088557cfd4263e629e6bd7d45a1de983824a7c5ff608ec2cd42d7c6f61854d3d33b8ded352df550789b34b + languageName: node + linkType: hard + "@smithy/credential-provider-imds@npm:^2.0.0": version: 2.0.1 resolution: "@smithy/credential-provider-imds@npm:2.0.1" @@ -12544,6 +13127,19 @@ __metadata: languageName: node linkType: hard +"@smithy/credential-provider-imds@npm:^3.1.1, @smithy/credential-provider-imds@npm:^3.1.2": + version: 3.1.2 + resolution: "@smithy/credential-provider-imds@npm:3.1.2" + dependencies: + "@smithy/node-config-provider": ^3.1.2 + "@smithy/property-provider": ^3.1.2 + "@smithy/types": ^3.2.0 + "@smithy/url-parser": ^3.0.2 + tslib: ^2.6.2 + checksum: bf0ce9f7c510f5f7e05d08c2b1d861f133016457e3872bfc5e4ac9b22f26123adcf773a562189971e2ce97bdad2f576a4eefb764808df2ae1833e77be86358f2 + languageName: node + linkType: hard + "@smithy/eventstream-codec@npm:^1.1.0": version: 1.1.0 resolution: "@smithy/eventstream-codec@npm:1.1.0" @@ -12616,6 +13212,18 @@ __metadata: languageName: node linkType: hard +"@smithy/eventstream-codec@npm:^3.1.1": + version: 3.1.1 + resolution: "@smithy/eventstream-codec@npm:3.1.1" + dependencies: + "@aws-crypto/crc32": 5.2.0 + "@smithy/types": ^3.2.0 + "@smithy/util-hex-encoding": ^3.0.0 + tslib: ^2.6.2 + checksum: fdc7a2bcf99f7c830ba24b5745877ec26556613423a025c6b122b167ef92a76a860f7dffe21f25667f12c2736a121f4e2064050dcf768406a60ce3ebc029e402 + languageName: node + linkType: hard + "@smithy/eventstream-serde-browser@npm:^2.0.10": version: 2.0.11 resolution: "@smithy/eventstream-serde-browser@npm:2.0.11" @@ -12649,6 +13257,17 @@ __metadata: languageName: node linkType: hard +"@smithy/eventstream-serde-browser@npm:^3.0.2": + version: 3.0.3 + resolution: "@smithy/eventstream-serde-browser@npm:3.0.3" + dependencies: + "@smithy/eventstream-serde-universal": ^3.0.3 + "@smithy/types": ^3.2.0 + tslib: ^2.6.2 + checksum: 3e41fb32f06dc266ab41185482e441068c1e84ac5637462fc107511a495a7338972f10568bb57970e22eef2d14e024f93e0991b30b54545bca5b5189add5d41e + languageName: node + linkType: hard + "@smithy/eventstream-serde-config-resolver@npm:^2.0.10": version: 2.0.11 resolution: "@smithy/eventstream-serde-config-resolver@npm:2.0.11" @@ -12679,6 +13298,16 @@ __metadata: languageName: node linkType: hard +"@smithy/eventstream-serde-config-resolver@npm:^3.0.1": + version: 3.0.2 + resolution: "@smithy/eventstream-serde-config-resolver@npm:3.0.2" + dependencies: + "@smithy/types": ^3.2.0 + tslib: ^2.6.2 + checksum: 5c2113b6acc65df61f6fc844054c5a85825305e1d9f47987a5f350b603e304c8d90ad2c62cb7a098f10b7243c4f466fa413264821d261a3b69dc12c33fa976d4 + languageName: node + linkType: hard + "@smithy/eventstream-serde-node@npm:^2.0.10": version: 2.0.11 resolution: "@smithy/eventstream-serde-node@npm:2.0.11" @@ -12712,6 +13341,17 @@ __metadata: languageName: node linkType: hard +"@smithy/eventstream-serde-node@npm:^3.0.2": + version: 3.0.3 + resolution: "@smithy/eventstream-serde-node@npm:3.0.3" + dependencies: + "@smithy/eventstream-serde-universal": ^3.0.3 + "@smithy/types": ^3.2.0 + tslib: ^2.6.2 + checksum: 29e2323b92a87302518ecfd75096e856c77a3d39ffa2680ff56e11c2c01b4434f56f86940e13c636e207af7cadf867f824f5c60249c53e1c27faa1cf932b6eb9 + languageName: node + linkType: hard + "@smithy/eventstream-serde-universal@npm:^2.0.11": version: 2.0.11 resolution: "@smithy/eventstream-serde-universal@npm:2.0.11" @@ -12745,6 +13385,17 @@ __metadata: languageName: node linkType: hard +"@smithy/eventstream-serde-universal@npm:^3.0.3": + version: 3.0.3 + resolution: "@smithy/eventstream-serde-universal@npm:3.0.3" + dependencies: + "@smithy/eventstream-codec": ^3.1.1 + "@smithy/types": ^3.2.0 + tslib: ^2.6.2 + checksum: 6c0c3602e3e79bb0abe47f1d7b8c277f58879ab613cda99d80cf0e825653055f892daee313e6d40e5096932e004838e3c9f674e440b97921520257f80337bed8 + languageName: node + linkType: hard + "@smithy/fetch-http-handler@npm:^2.0.2, @smithy/fetch-http-handler@npm:^2.0.3": version: 2.0.3 resolution: "@smithy/fetch-http-handler@npm:2.0.3" @@ -12810,6 +13461,19 @@ __metadata: languageName: node linkType: hard +"@smithy/fetch-http-handler@npm:^3.0.2, @smithy/fetch-http-handler@npm:^3.1.0": + version: 3.1.0 + resolution: "@smithy/fetch-http-handler@npm:3.1.0" + dependencies: + "@smithy/protocol-http": ^4.0.2 + "@smithy/querystring-builder": ^3.0.2 + "@smithy/types": ^3.2.0 + "@smithy/util-base64": ^3.0.0 + tslib: ^2.6.2 + checksum: 7b9b928e8a094e41a9c7516aa2fcfd3bb88b0271737e1d4fa301973a49f577094fa967ba481a0cf6e5c977be6bb8b2898d868b3269a476cae2aaaed582277733 + languageName: node + linkType: hard + "@smithy/hash-node@npm:^2.0.10": version: 2.0.11 resolution: "@smithy/hash-node@npm:2.0.11" @@ -12858,6 +13522,18 @@ __metadata: languageName: node linkType: hard +"@smithy/hash-node@npm:^3.0.1": + version: 3.0.2 + resolution: "@smithy/hash-node@npm:3.0.2" + dependencies: + "@smithy/types": ^3.2.0 + "@smithy/util-buffer-from": ^3.0.0 + "@smithy/util-utf8": ^3.0.0 + tslib: ^2.6.2 + checksum: 2b7b678d429b9806a28f18472f8beec45f5a2e1d004b084cc4b591c1239565c46435b278c7f76be09790d6d6eabc617e7d0f3aef11c375721b78600506d62856 + languageName: node + linkType: hard + "@smithy/invalid-dependency@npm:^2.0.10": version: 2.0.11 resolution: "@smithy/invalid-dependency@npm:2.0.11" @@ -12898,6 +13574,16 @@ __metadata: languageName: node linkType: hard +"@smithy/invalid-dependency@npm:^3.0.1": + version: 3.0.2 + resolution: "@smithy/invalid-dependency@npm:3.0.2" + dependencies: + "@smithy/types": ^3.2.0 + tslib: ^2.6.2 + checksum: 21f0f2669989d9b8ffdc86e80fa8d0a39b5ada187a21c61bc4405936a31fa054a59577fa8fde4de707de559cc3e08c80aaac0205aaacf0eaf3a2ff620fa12830 + languageName: node + linkType: hard + "@smithy/is-array-buffer@npm:^1.1.0": version: 1.1.0 resolution: "@smithy/is-array-buffer@npm:1.1.0" @@ -12969,6 +13655,17 @@ __metadata: languageName: node linkType: hard +"@smithy/middleware-content-length@npm:^3.0.1": + version: 3.0.2 + resolution: "@smithy/middleware-content-length@npm:3.0.2" + dependencies: + "@smithy/protocol-http": ^4.0.2 + "@smithy/types": ^3.2.0 + tslib: ^2.6.2 + checksum: 67758207c3a26eb6d44fd922d178299418fc42a07937813364a17a76547bf736df75d279cb493fca9ac5c3897c0c8d24c6e124f3edc143c991a26b44521eb423 + languageName: node + linkType: hard + "@smithy/middleware-endpoint@npm:^2.0.10": version: 2.0.11 resolution: "@smithy/middleware-endpoint@npm:2.0.11" @@ -13040,6 +13737,21 @@ __metadata: languageName: node linkType: hard +"@smithy/middleware-endpoint@npm:^3.0.2, @smithy/middleware-endpoint@npm:^3.0.3": + version: 3.0.3 + resolution: "@smithy/middleware-endpoint@npm:3.0.3" + dependencies: + "@smithy/middleware-serde": ^3.0.2 + "@smithy/node-config-provider": ^3.1.2 + "@smithy/shared-ini-file-loader": ^3.1.2 + "@smithy/types": ^3.2.0 + "@smithy/url-parser": ^3.0.2 + "@smithy/util-middleware": ^3.0.2 + tslib: ^2.6.2 + checksum: 15a37293aa590bd0c8ab59430e967f786500603bca92dbde655480c3b7c1812a8cbcd267ff31691c2d8ea596f7917769ef91fa4033e07ec9971bf252fc12ebcd + languageName: node + linkType: hard + "@smithy/middleware-retry@npm:^2.0.13": version: 2.0.16 resolution: "@smithy/middleware-retry@npm:2.0.16" @@ -13122,6 +13834,23 @@ __metadata: languageName: node linkType: hard +"@smithy/middleware-retry@npm:^3.0.4, @smithy/middleware-retry@npm:^3.0.6": + version: 3.0.6 + resolution: "@smithy/middleware-retry@npm:3.0.6" + dependencies: + "@smithy/node-config-provider": ^3.1.2 + "@smithy/protocol-http": ^4.0.2 + "@smithy/service-error-classification": ^3.0.2 + "@smithy/smithy-client": ^3.1.4 + "@smithy/types": ^3.2.0 + "@smithy/util-middleware": ^3.0.2 + "@smithy/util-retry": ^3.0.2 + tslib: ^2.6.2 + uuid: ^9.0.1 + checksum: c17ac5665e0dd2315e996c219b5aa2327c9270a49ca7dc64b8d81c80261f9d0098d3725641f2e4c87aac293c283d709fb062b5c7be6912e72f9042492a3e91d9 + languageName: node + linkType: hard + "@smithy/middleware-serde@npm:^2.0.10": version: 2.0.10 resolution: "@smithy/middleware-serde@npm:2.0.10" @@ -13172,6 +13901,16 @@ __metadata: languageName: node linkType: hard +"@smithy/middleware-serde@npm:^3.0.1, @smithy/middleware-serde@npm:^3.0.2": + version: 3.0.2 + resolution: "@smithy/middleware-serde@npm:3.0.2" + dependencies: + "@smithy/types": ^3.2.0 + tslib: ^2.6.2 + checksum: 16c933ecb8061ff9fcf49ecabcc54b6d56de0e02464e5dd995ac729ad06e70be7a341c329b0b7cc1b33c8dbaa31372e337130e9eb6aac4c2df63ce37cb36d54f + languageName: node + linkType: hard + "@smithy/middleware-stack@npm:^2.0.0": version: 2.0.0 resolution: "@smithy/middleware-stack@npm:2.0.0" @@ -13221,6 +13960,16 @@ __metadata: languageName: node linkType: hard +"@smithy/middleware-stack@npm:^3.0.1, @smithy/middleware-stack@npm:^3.0.2": + version: 3.0.2 + resolution: "@smithy/middleware-stack@npm:3.0.2" + dependencies: + "@smithy/types": ^3.2.0 + tslib: ^2.6.2 + checksum: 70ec59d020ae6d8c53aefecb039fb511cfa67a57ce00ba1e41d2c3da346265cc18bdf1e0724b0df10f1ef838807e151e93f6da6e886fafbac51d2ed962b795d1 + languageName: node + linkType: hard + "@smithy/node-config-provider@npm:^2.0.1": version: 2.0.1 resolution: "@smithy/node-config-provider@npm:2.0.1" @@ -13305,6 +14054,18 @@ __metadata: languageName: node linkType: hard +"@smithy/node-config-provider@npm:^3.1.1, @smithy/node-config-provider@npm:^3.1.2": + version: 3.1.2 + resolution: "@smithy/node-config-provider@npm:3.1.2" + dependencies: + "@smithy/property-provider": ^3.1.2 + "@smithy/shared-ini-file-loader": ^3.1.2 + "@smithy/types": ^3.2.0 + tslib: ^2.6.2 + checksum: 596e7a6b92fa68f6c172969bde6a04aadf35634f78a601351642b44bc271f3ad5444588a8c3dea8f7cdbe65a2d69e1c1d93291bf8d240736a035ac8db4e96ce3 + languageName: node + linkType: hard + "@smithy/node-http-handler@npm:^2.0.2, @smithy/node-http-handler@npm:^2.0.3": version: 2.0.3 resolution: "@smithy/node-http-handler@npm:2.0.3" @@ -13370,6 +14131,19 @@ __metadata: languageName: node linkType: hard +"@smithy/node-http-handler@npm:^3.0.1, @smithy/node-http-handler@npm:^3.1.0": + version: 3.1.0 + resolution: "@smithy/node-http-handler@npm:3.1.0" + dependencies: + "@smithy/abort-controller": ^3.1.0 + "@smithy/protocol-http": ^4.0.2 + "@smithy/querystring-builder": ^3.0.2 + "@smithy/types": ^3.2.0 + tslib: ^2.6.2 + checksum: 915cc2876cfe5b2330e868aa512930d4c126192d7695354dc2a88aab1c6639968ace36c1e8778c8a647a8b6f3f3faac2a14870607043cba972e05ee94491738a + languageName: node + linkType: hard + "@smithy/property-provider@npm:^2.0.0, @smithy/property-provider@npm:^2.0.1": version: 2.0.1 resolution: "@smithy/property-provider@npm:2.0.1" @@ -13440,6 +14214,16 @@ __metadata: languageName: node linkType: hard +"@smithy/property-provider@npm:^3.1.1, @smithy/property-provider@npm:^3.1.2": + version: 3.1.2 + resolution: "@smithy/property-provider@npm:3.1.2" + dependencies: + "@smithy/types": ^3.2.0 + tslib: ^2.6.2 + checksum: 9ec0cce2728dd4a0d327fef523ca5bddcba9a7750e6e5a614293d6ba4c12d6b86c32020689481a529b4797d07315fd84647f13ea0dbe91f1da7932c954b08421 + languageName: node + linkType: hard + "@smithy/protocol-http@npm:^1.0.1": version: 1.1.0 resolution: "@smithy/protocol-http@npm:1.1.0" @@ -13510,6 +14294,16 @@ __metadata: languageName: node linkType: hard +"@smithy/protocol-http@npm:^4.0.1, @smithy/protocol-http@npm:^4.0.2": + version: 4.0.2 + resolution: "@smithy/protocol-http@npm:4.0.2" + dependencies: + "@smithy/types": ^3.2.0 + tslib: ^2.6.2 + checksum: e1b419e0324f20300c490491cbc32b9d151579a6ce11f708b76ed265ef3499d404d9c0e3443692984514a0f8042b456f5c7e1a62694d42c7dc9bc64bfcff0301 + languageName: node + linkType: hard + "@smithy/querystring-builder@npm:^2.0.10": version: 2.0.10 resolution: "@smithy/querystring-builder@npm:2.0.10" @@ -13565,6 +14359,17 @@ __metadata: languageName: node linkType: hard +"@smithy/querystring-builder@npm:^3.0.2": + version: 3.0.2 + resolution: "@smithy/querystring-builder@npm:3.0.2" + dependencies: + "@smithy/types": ^3.2.0 + "@smithy/util-uri-escape": ^3.0.0 + tslib: ^2.6.2 + checksum: c6f6fc8681879daed9c85b3fd2d81cbbf553addbdc1d6ab2660687d967af40eba0112e40cf1157bdd4c42784bc22977a3da9ed9dde674b7ede5e70720a0b38af + languageName: node + linkType: hard + "@smithy/querystring-parser@npm:^2.0.1": version: 2.0.1 resolution: "@smithy/querystring-parser@npm:2.0.1" @@ -13625,6 +14430,16 @@ __metadata: languageName: node linkType: hard +"@smithy/querystring-parser@npm:^3.0.2": + version: 3.0.2 + resolution: "@smithy/querystring-parser@npm:3.0.2" + dependencies: + "@smithy/types": ^3.2.0 + tslib: ^2.6.2 + checksum: 7f18281e8d73c70dc020e1a8719a8322d88130c24e8c8cffa39ffe83e9f18d28bb9d420e6026ddb17d60ac950b0fb5b9465a4ba8493086e6186f60a9573b2ad8 + languageName: node + linkType: hard + "@smithy/service-error-classification@npm:^2.0.0": version: 2.0.0 resolution: "@smithy/service-error-classification@npm:2.0.0" @@ -13668,6 +14483,15 @@ __metadata: languageName: node linkType: hard +"@smithy/service-error-classification@npm:^3.0.2": + version: 3.0.2 + resolution: "@smithy/service-error-classification@npm:3.0.2" + dependencies: + "@smithy/types": ^3.2.0 + checksum: f7cfd6438286942ec1f7f059c4bdac517c64833fcbea27198880106c7e55d0c2083f0c8e22c8fe5a68f0d86e5bd33a78f644898b48008b2f14c0c13d46f0923c + languageName: node + linkType: hard + "@smithy/shared-ini-file-loader@npm:^2.0.0, @smithy/shared-ini-file-loader@npm:^2.0.1": version: 2.0.1 resolution: "@smithy/shared-ini-file-loader@npm:2.0.1" @@ -13738,6 +14562,16 @@ __metadata: languageName: node linkType: hard +"@smithy/shared-ini-file-loader@npm:^3.1.1, @smithy/shared-ini-file-loader@npm:^3.1.2": + version: 3.1.2 + resolution: "@smithy/shared-ini-file-loader@npm:3.1.2" + dependencies: + "@smithy/types": ^3.2.0 + tslib: ^2.6.2 + checksum: bbb7ceaefdcbe4e43e5a65cf424e41f6a70e44fc9b05b7f8c968bd6134253e04af4455ad0fa91fda18f55695b7992c8bfc5281aa201be2a69f7733014fd84042 + languageName: node + linkType: hard + "@smithy/signature-v4@npm:^1.0.1": version: 1.1.0 resolution: "@smithy/signature-v4@npm:1.1.0" @@ -13785,6 +14619,21 @@ __metadata: languageName: node linkType: hard +"@smithy/signature-v4@npm:^3.1.0": + version: 3.1.1 + resolution: "@smithy/signature-v4@npm:3.1.1" + dependencies: + "@smithy/is-array-buffer": ^3.0.0 + "@smithy/types": ^3.2.0 + "@smithy/util-hex-encoding": ^3.0.0 + "@smithy/util-middleware": ^3.0.2 + "@smithy/util-uri-escape": ^3.0.0 + "@smithy/util-utf8": ^3.0.0 + tslib: ^2.6.2 + checksum: f7eca9889ac4252e8fff76bf31a75bbc8afebc7ac690e3fddffadaccde64fd05305b6e22ad00f8d8da3bb3ca8739d310d6abe70350a4c12c996fb0335a8bd975 + languageName: node + linkType: hard + "@smithy/smithy-client@npm:^2.0.2": version: 2.0.3 resolution: "@smithy/smithy-client@npm:2.0.3" @@ -13863,6 +14712,20 @@ __metadata: languageName: node linkType: hard +"@smithy/smithy-client@npm:^3.1.2, @smithy/smithy-client@npm:^3.1.4": + version: 3.1.4 + resolution: "@smithy/smithy-client@npm:3.1.4" + dependencies: + "@smithy/middleware-endpoint": ^3.0.3 + "@smithy/middleware-stack": ^3.0.2 + "@smithy/protocol-http": ^4.0.2 + "@smithy/types": ^3.2.0 + "@smithy/util-stream": ^3.0.4 + tslib: ^2.6.2 + checksum: be1ce3523d5b49d1c2fb75695201dcc3748583050675efc7910b0a8bc9444c781daf435bec711166e6d2f0238ed301187283362c33aa31aefd2c21b09fb305a5 + languageName: node + linkType: hard + "@smithy/types@npm:^1.0.0, @smithy/types@npm:^1.1.0": version: 1.1.0 resolution: "@smithy/types@npm:1.1.0" @@ -13944,6 +14807,15 @@ __metadata: languageName: node linkType: hard +"@smithy/types@npm:^3.1.0, @smithy/types@npm:^3.2.0": + version: 3.2.0 + resolution: "@smithy/types@npm:3.2.0" + dependencies: + tslib: ^2.6.2 + checksum: f07caa63cd2f1ed9a14612a9493fcc9c0aca974593e16c1328daecc7f36af2ece5e5e79c24212966180f88a183abf078bfbcd98cf362a8d8f95f3f8642d41389 + languageName: node + linkType: hard + "@smithy/url-parser@npm:^2.0.1": version: 2.0.1 resolution: "@smithy/url-parser@npm:2.0.1" @@ -14010,6 +14882,17 @@ __metadata: languageName: node linkType: hard +"@smithy/url-parser@npm:^3.0.1, @smithy/url-parser@npm:^3.0.2": + version: 3.0.2 + resolution: "@smithy/url-parser@npm:3.0.2" + dependencies: + "@smithy/querystring-parser": ^3.0.2 + "@smithy/types": ^3.2.0 + tslib: ^2.6.2 + checksum: a0dac1ff3eac440d3dba7f2ad80eb3cfb46cf912ceb4a533b0bd87ad5b5f1e9b641ca9a247844129c33dc2901cbe753c89185b70c6d323b781b83451a738702e + languageName: node + linkType: hard + "@smithy/util-base64@npm:^2.0.0": version: 2.0.0 resolution: "@smithy/util-base64@npm:2.0.0" @@ -14216,6 +15099,19 @@ __metadata: languageName: node linkType: hard +"@smithy/util-defaults-mode-browser@npm:^3.0.4": + version: 3.0.6 + resolution: "@smithy/util-defaults-mode-browser@npm:3.0.6" + dependencies: + "@smithy/property-provider": ^3.1.2 + "@smithy/smithy-client": ^3.1.4 + "@smithy/types": ^3.2.0 + bowser: ^2.11.0 + tslib: ^2.6.2 + checksum: 753e21d8b6c9cbfb874dd9468823bce7ebfa979da8972fb5c67a31333513cebe09072fcb9ae803219bf41775569c8277e49f83abd96041042d3c487d299c7a0a + languageName: node + linkType: hard + "@smithy/util-defaults-mode-node@npm:^2.0.15": version: 2.0.18 resolution: "@smithy/util-defaults-mode-node@npm:2.0.18" @@ -14290,6 +15186,21 @@ __metadata: languageName: node linkType: hard +"@smithy/util-defaults-mode-node@npm:^3.0.4": + version: 3.0.6 + resolution: "@smithy/util-defaults-mode-node@npm:3.0.6" + dependencies: + "@smithy/config-resolver": ^3.0.3 + "@smithy/credential-provider-imds": ^3.1.2 + "@smithy/node-config-provider": ^3.1.2 + "@smithy/property-provider": ^3.1.2 + "@smithy/smithy-client": ^3.1.4 + "@smithy/types": ^3.2.0 + tslib: ^2.6.2 + checksum: d64efd2b5bd7b4b3b1a668725d34018bd8cae00b8a59991eadabf122e590ad153be4f9beda58b063b451d9f03371575c9a8e2806bcc0b7790e63fc9d839f5c95 + languageName: node + linkType: hard + "@smithy/util-endpoints@npm:^1.0.8": version: 1.0.8 resolution: "@smithy/util-endpoints@npm:1.0.8" @@ -14323,6 +15234,17 @@ __metadata: languageName: node linkType: hard +"@smithy/util-endpoints@npm:^2.0.2": + version: 2.0.3 + resolution: "@smithy/util-endpoints@npm:2.0.3" + dependencies: + "@smithy/node-config-provider": ^3.1.2 + "@smithy/types": ^3.2.0 + tslib: ^2.6.2 + checksum: f8b77a7f68bd99b73362b29a56e35270b509f76ed82c003e82dae1468f46c2c986060aea1fcb78f3d9346830f62c1c3f3e0aa4de856b8897ba183efabc22969d + languageName: node + linkType: hard + "@smithy/util-hex-encoding@npm:^1.1.0": version: 1.1.0 resolution: "@smithy/util-hex-encoding@npm:1.1.0" @@ -14408,6 +15330,16 @@ __metadata: languageName: node linkType: hard +"@smithy/util-middleware@npm:^3.0.1, @smithy/util-middleware@npm:^3.0.2": + version: 3.0.2 + resolution: "@smithy/util-middleware@npm:3.0.2" + dependencies: + "@smithy/types": ^3.2.0 + tslib: ^2.6.2 + checksum: 8a6183d3fd4a7c01787fbfd1dd901b1cdf0937f3c5e73646e8377b1e3322782e191cb7c1c9278e6c84d7462d4b0e70bcac9cfca52367728b3357914db96f90cc + languageName: node + linkType: hard + "@smithy/util-retry@npm:^2.0.0": version: 2.0.0 resolution: "@smithy/util-retry@npm:2.0.0" @@ -14462,6 +15394,17 @@ __metadata: languageName: node linkType: hard +"@smithy/util-retry@npm:^3.0.1, @smithy/util-retry@npm:^3.0.2": + version: 3.0.2 + resolution: "@smithy/util-retry@npm:3.0.2" + dependencies: + "@smithy/service-error-classification": ^3.0.2 + "@smithy/types": ^3.2.0 + tslib: ^2.6.2 + checksum: 68846a52a6c71658db40f54681afad8c9bdb4687dc3c12fd13c27cf9aa3b96c57469a4d5658d4caabc9c710d95f920c0a3faafc9503fb99fb6466f51072fe852 + languageName: node + linkType: hard + "@smithy/util-stream@npm:^2.0.14": version: 2.0.14 resolution: "@smithy/util-stream@npm:2.0.14" @@ -14542,6 +15485,22 @@ __metadata: languageName: node linkType: hard +"@smithy/util-stream@npm:^3.0.2, @smithy/util-stream@npm:^3.0.4": + version: 3.0.4 + resolution: "@smithy/util-stream@npm:3.0.4" + dependencies: + "@smithy/fetch-http-handler": ^3.1.0 + "@smithy/node-http-handler": ^3.1.0 + "@smithy/types": ^3.2.0 + "@smithy/util-base64": ^3.0.0 + "@smithy/util-buffer-from": ^3.0.0 + "@smithy/util-hex-encoding": ^3.0.0 + "@smithy/util-utf8": ^3.0.0 + tslib: ^2.6.2 + checksum: ba4a785d30606e82cbf80e644be05fad7a1813e19226ec8893a91993e0c943bc222643ab9c70625f72ee760b4f4d1632e74af586e028e7d3dc8197b1927e580b + languageName: node + linkType: hard + "@smithy/util-uri-escape@npm:^1.1.0": version: 1.1.0 resolution: "@smithy/util-uri-escape@npm:1.1.0" @@ -23432,6 +24391,7 @@ __metadata: "@gomomento/sdk": ^1.51.1 "@google/generative-ai": ^0.7.0 "@langchain/anthropic": "workspace:*" + "@langchain/aws": "workspace:*" "@langchain/azure-dynamic-sessions": "workspace:^" "@langchain/azure-openai": "workspace:*" "@langchain/cloudflare": "workspace:*"