Jina Code Interpreter Tool
Guide for using the Jina Code Interpreter tool with PraisonAI agents.
The Jina Code Interpreter tool lets an agent run Python in the Riza sandboxed runtime.
Overview
The Jina Code Interpreter tool is a tool that allows you to execute various programming languages using the AI Agents.
pip install langchain-community rizaio
export RIZA_API_KEY="${RIZA_API_KEY:?Set RIZA_API_KEY in your shell}"from praisonaiagents import Agent, AgentTeam
from langchain_community.tools.riza.command import ExecPython
coder_agent = Agent(instructions="""word = "strawberry"
count = word.count("r")
print(f"There are {count}'R's in the word 'Strawberry'")""", tools=[ExecPython])
agents = AgentTeam(agents=[coder_agent])
agents.start()How It Works
Getting Started
- Simple Usage
- Install dependencies (see Overview above)
- Set required API keys in your environment
- Run the agent example in Overview
- With Configuration
Use the same tool with an agent — see the Overview example, or pass env vars from the sections above.
Best Practices
Keep RIZA_API_KEY in the environment
Set RIZA_API_KEY in your shell or .env. ExecPython reads it automatically — never hard-code the key.
Sandbox untrusted code
Riza runs code in an isolated runtime, so agent-generated code cannot touch your machine. Prefer it over local exec for untrusted input.
Keep snippets self-contained
Each execution is stateless. Include all imports and inputs in the snippet you pass so it runs without external state.