from langchain.agents import initialize_agent
from langchain.llms.fake import FakeListLLM
from langchain.agents import AgentType
from langchain_experimental.tools import PythonAstREPLTool
res = ["Action: Python REPLnAction Input: print(2.2 + 2.22)", "Final Answer: 4.42"]
llm = FakeListLLM(responses=res)
agent = initialize_agent(tools=[PythonAstREPLTool()],
llm=llm, agent=AgentType.ZERO_SHOT_REACT_DESCRIPTION, verbose=True
)
agent.run("what is 2.2 + 2.22?")
What wrong in this code ? i am getting an error
enter image description here
can someone explain me the better way to implement Fake LLM using Langchain
New contributor
Himanshu Gulati is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1