Skip to main content

Bedrock AgentCore

AWS Bedrock AgentCore provides code interpretation and browser automation capabilities.

Installation

npm install praisonai-ts

Code Interpreter

Execute Python code in a sandboxed environment:
import { Agent, bedrockCodeInterpreter } from 'praisonai-ts';

const codeInterpreter = bedrockCodeInterpreter({
  // Optional configuration
});

const agent = new Agent({
  name: 'CodeAgent',
  instructions: 'You help with data analysis using Python code.',
  tools: [codeInterpreter],
});

const response = await agent.chat('Calculate the factorial of 10');

Browser Tools

import { bedrockBrowserNavigate } from 'praisonai-ts';

const navigate = bedrockBrowserNavigate();

const agent = new Agent({
  name: 'BrowserAgent',
  instructions: 'You help navigate websites.',
  tools: [navigate],
});

Click

import { bedrockBrowserClick } from 'praisonai-ts';

const click = bedrockBrowserClick();

Fill Form

import { bedrockBrowserFill } from 'praisonai-ts';

const fill = bedrockBrowserFill();

Configuration

interface CodeInterpreterConfig {
  timeout?: number;      // Execution timeout in ms
  maxMemory?: number;    // Max memory in MB
}

interface BrowserConfig {
  headless?: boolean;    // Run in headless mode
  timeout?: number;      // Navigation timeout
}

Environment Variables

VariableRequiredDescription
AWS_ACCESS_KEY_IDYesAWS access key
AWS_SECRET_ACCESS_KEYYesAWS secret key
AWS_REGIONYesAWS region