Skip to content

AgentExecutor chain #3500

Closed Answered by oddrationale
fynn3003 asked this question in Q&A
Apr 25, 2023 · 4 comments · 6 replies
Discussion options

You must be logged in to vote

I see. You should use the load_tools function to properly load the tools:

from langchain.agents import load_tools

def answer_question(question):
    agent_exe = initialize_agent(
        llm=OpenAI(temperature=0),
        tools=load_tools(["python_repl"]),
        return_intermediate_steps=True,
        verbose=True,
    )
    response = agent_exe({"input": question})
    answer = response["output"]
    steps = response["intermediate_steps"]
    return answer, steps

Replies: 4 comments 6 replies

Comment options

You must be logged in to vote
4 replies
@fynn3003
Comment options

@oddrationale
Comment options

@fynn3003
Comment options

@oddrationale
Comment options

Comment options

You must be logged in to vote
1 reply
@oddrationale
Comment options

Answer selected by fynn3003
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@oddrationale
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants