Observation: Human is not a valid tool, try one of [human, Search, Calculator]
Labels: name: area: memory, name: area: agent, name: auto:bug, name: area: models

### System Info

Langchain version = 0.0.286
Python=3.8.8
MacOs

I am working on a **ReAct agent with Memory and Tools** that should stop and ask a human for input.

I worked off this article in the documentation: https://python.langchain.com/docs/modules/memory/agent_with_memory

On Jupyter Notebook it works well when the agent stops and picks up the "Observation" from the human.
Now I am trying to bring this over to Streamlit and am struggling with having the agent wait for the observation.

As one can see in the video, the output is brought over into the right streamlit container, yet doesn't stop to get the human feedback.

I am using a custom output parser and the recommended StreamlitCallbackHandler.




https://github.com/langchain-ai/langchain/assets/416379/ed57834a-2a72-4938-b901-519f0748dd95




### Who can help?

_No response_

### Information

- [ ] The official example notebooks/scripts
- [X] My own modified scripts

### Related Components

- [X] LLMs/Chat Models
- [ ] Embedding Models
- [ ] Prompts / Prompt Templates / Prompt Selectors
- [X] Output Parsers
- [ ] Document Loaders
- [ ] Vector Stores / Retrievers
- [ ] Memory
- [X] Agents / Agent Executors
- [ ] Tools / Toolkits
- [ ] Chains
- [ ] Callbacks/Tracing
- [ ] Async

### Reproduction

My output parser looks like this:

 ```
class CustomOutputParser(AgentOutputParser):

    def parse(self, llm_output: str) -> Union[AgentAction, AgentFinish]:
        # Check if agent should finish
        
        print(llm_output)

        if "Final Answer:" in llm_output:
            print("Agent should finish")
            return AgentFinish(
                # Return values is generally always a dictionary with a single `output` key
                # It is not recommended to try anything else at the moment :)
                return_values={"output": llm_output.split(
                    "Final Answer:")[-1].strip()},
                log=llm_output,
            )
        # Parse out the action and action input
        regex = r"Action\s*\d*\s*:(.*?)\nAction\s*\d*\s*Input\s*\d*\s*:[\s]*(.*)"
        match = re.search(regex, llm_output, re.DOTALL)
        if not match:

            print("Parsing Action Input")
            return AgentFinish(
                # Return values is generally always a dictionary with a single `output` key
                # It is not recommended to try anything else at the moment :)
                return_values={"output": llm_output},
                log=llm_output,
            )
            # raise ValueError(f"Could not parse LLM output: `{llm_output}`")
        action = match.group(1).strip()
        action_input = match.group(2)

        #This can't be agent finish because otherwise the agent stops working.
        return AgentAction(tool=action, tool_input=action_input.strip(" ").strip('"'), log=llm_output)
 
```

### Expected behavior

The agent should wait for streamlit to create an input_chat and use this as the feedback from the "human" tool