Helper for Nova's code interpreter system tool.
The nova_code_interpreter tool enables the model to execute Python code in a sandboxed environment. Useful for calculations, data analysis, and other computational tasks.
NovaCodeInterpreterTool(
self,
)Note:
Requires bedrock:InvokeTool IAM permission. Consider increasing timeout for complex code execution.
Example:
from langchain_aws import ChatBedrockConverse from langchain_aws.tools import NovaCodeInterpreterTool
model = ChatBedrockConverse(model="amazon.nova-2-lite-v1:0") model_with_code = model.bind_tools([NovaCodeInterpreterTool()]) response = model_with_code.invoke( "Calculate the square root of 475878756857" )