New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

@aigne/bedrock

Package Overview
Dependencies
Maintainers
3
Versions
195
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aigne/bedrock

AIGNE AWS Bedrock SDK for integrating with AWS foundation models

Source
npmnpm
Version
1.74.0-beta.10
Version published
Maintainers
3
Created
Source

@aigne/bedrock

AIGNE Logo

GitHub star chart Open Issues codecov NPM Version Elastic-2.0 licensed

AIGNE AWS Bedrock SDK for integrating with AWS foundation models within the AIGNE Framework.

Introduction

@aigne/bedrock provides a seamless integration between the AIGNE Framework and AWS Bedrock foundation models. This package enables developers to easily leverage various AI models available through AWS Bedrock in their AIGNE applications, providing a consistent interface across the framework while taking advantage of AWS's secure and scalable infrastructure.

AIGNE Arch

Features

  • AWS Bedrock Integration: Direct connection to AWS Bedrock services using the official AWS SDK
  • Multiple Model Support: Access to Claude, Llama, Titan, and other foundation models through AWS Bedrock
  • Chat Completions: Support for chat completions API with all available Bedrock models
  • Streaming Responses: Support for streaming responses for more responsive applications
  • Type-Safe: Comprehensive TypeScript typings for all APIs and models
  • Consistent Interface: Compatible with the AIGNE Framework's model interface
  • Error Handling: Robust error handling and retry mechanisms
  • Full Configuration: Extensive configuration options for fine-tuning behavior

Installation

Using npm

npm install @aigne/bedrock @aigne/model-base

Using yarn

yarn add @aigne/bedrock @aigne/model-base

Using pnpm

pnpm add @aigne/bedrock @aigne/model-base

Basic Usage

import { BedrockChatModel } from "@aigne/bedrock";

const model = new BedrockChatModel({
  // Provide API key directly or use environment variable AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY
  accessKeyId: "YOUR_ACCESS_KEY_ID",
  secretAccessKey: "YOUR_SECRET_ACCESS_KEY",
  model: "us.amazon.nova-premier-v1:0",
  modelOptions: {
    temperature: 0.7,
  },
});

const result = await model.invoke({
  messages: [{ role: "user", content: "Hello, who are you?" }],
});

console.log(result);
/* Output:
  {
    text: "Hello! How can I assist you today?",
    model: "gpt-4o",
    usage: {
      inputTokens: 10,
      outputTokens: 9
    }
  }
  */

Streaming Responses

import { BedrockChatModel } from "@aigne/bedrock";
import { isAgentResponseDelta } from "@aigne/model-base";

const model = new BedrockChatModel({
  // Provide API key directly or use environment variable AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY
  accessKeyId: "YOUR_ACCESS_KEY_ID",
  secretAccessKey: "YOUR_SECRET_ACCESS_KEY",
  model: "us.amazon.nova-premier-v1:0",
  modelOptions: {
    temperature: 0.7,
  },
});

const stream = await model.invoke(
  {
    messages: [{ role: "user", content: "Hello, who are you?" }],
  },
  { streaming: true },
);

let fullText = "";
const json = {};

for await (const chunk of stream) {
  if (isAgentResponseDelta(chunk)) {
    const text = chunk.delta.text?.text;
    if (text) fullText += text;
    if (chunk.delta.json) Object.assign(json, chunk.delta.json);
  }
}

console.log(fullText); // Output: "Hello! How can I assist you today?"
console.log(json); // { model: "gpt-4o", usage: { inputTokens: 10, outputTokens: 9 } }

License

Elastic-2.0

FAQs

Package last updated on 11 Mar 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts