AWS Bedrock AgentCore
Installation & Setup
npm install @computesdk/agentcoreIAM permissions
bedrock-agentcore:StartCodeInterpreterSession
bedrock-agentcore:InvokeCodeInterpreter
bedrock-agentcore:StopCodeInterpreterSession
bedrock-agentcore:GetCodeInterpreterSession
bedrock-agentcore:ListCodeInterpreterSessionsUsage
import { agentcore } from '@computesdk/agentcore';
const compute = agentcore({ region: 'us-west-2' });
// Create sandbox (an AgentCore Code Interpreter session)
const sandbox = await compute.sandbox.create();
// Run a command
const result = await sandbox.runCommand('echo "Hello from AgentCore!"');
console.log(result.stdout); // "Hello from AgentCore!"
// Run code via the available runtimes (e.g. Python)
const code = await sandbox.runCommand('python3 -c "print(2 + 2)"');
console.log(code.stdout); // "4"
// Work with files (files persist for the life of the session)
await sandbox.filesystem.writeFile('/tmp/hello.py', 'print("Hello World")');
const content = await sandbox.filesystem.readFile('/tmp/hello.py');
// Clean up
await sandbox.destroy();Named profile
Explicit / temporary credentials
Configuration Options
Limitations
Related topics
Last updated
Was this helpful?