from langchain.agents.agent_toolkits import create_python_agent
from langchain.tools.python.tool import PythonREPLTool
from langchain.python import PythonREPL
from langchain.llms.openai import OpenAI
from langchain.agents.agent_types import AgentType
from langchain.chat_models import ChatOpenAI
import os


agent_executor = create_python_agent(
    llm=OpenAI(temperature=0.5, max_tokens=2000),
    tool=PythonREPLTool(),
    verbose=True,
    agent_type=AgentType.ZERO_SHOT_REACT_DESCRIPTION,
)

agent_executor.run("What is the 10th fibonacci number?")


langchain.llms.openai.OpenAI langchain.tools.python.tool.PythonREPLTool
[((354, 394), 'langchain.llms.openai.OpenAI', 'OpenAI', ([], {'temperature': '(0.5)', 'max_tokens': '(2000)'}), '(temperature=0.5, max_tokens=2000)\n', (360, 394), False, 'from langchain.llms.openai import OpenAI\n'), ((405, 421), 'langchain.tools.python.tool.PythonREPLTool', 'PythonREPLTool', ([], {}), '()\n', (419, 421), False, 'from langchain.tools.python.tool import PythonREPLTool\n')]