Issue: Unable to properly parse output of custom chat agent. 
Labels: name: area: agent, name: auto:bug

### Issue you'd like to raise.

pip list:

- langchain                                0.0.314
- langchain-core                           0.0.8

```python
prompt_template = """
### 
 

Assistant is a large language model trained by Mistral.

Assistant is designed to be able to assist with a wide range of tasks, from answering simple questions to providing in-depth explanations and discussions on a wide range of topics. As a language model, Assistant is able to generate human-like text based on the input it receives, allowing it to engage in natural-sounding conversations and provide responses that are coherent and relevant to the topic at hand.

Assistant is constantly learning and improving, and its capabilities are constantly evolving. It is able to process and understand large amounts of text, and can use this knowledge to provide accurate and informative responses to a wide range of questions. Additionally, Assistant is able to generate its own text based on the input it receives, allowing it to engage in discussions and provide explanations and descriptions on a wide range of topics.

Overall, Assistant is a powerful tool that can help with a wide range of tasks and provide valuable insights and information on a wide range of topics. Whether you need help with a specific question or just want to have a conversation about a particular topic, Assistant is here to assist.

Context:
------

Assistant has access to the following tools:

{tools}

To use a tool, please use the following format:

'''
Thought: Do I need to use a tool? Yes
Action: the action to take, should be one of [{tool_names}]
Action Input: the input to the action
Observation: the result of the action
'''

When you have a response to say to the Human, or if you do not need to use a tool, you MUST use the format:

'''
Thought: Do I need to use a tool? No
Final Answer: [your response here]
'''

Begin!

Previous conversation history:
{chat_history}

New input: {input}

Current Scratchpad:
{agent_scratchpad}



 """

# Create prompt from prompt template 
prompt = PromptTemplate(
    input_variables=['agent_scratchpad', 'chat_history', 'input', 'tool_names', 'tools'],
    template=prompt_template,
)

prompt = prompt.partial(
    tools=render_text_description(tools),
    tool_names=", ".join([t.name for t in tools]),
)

# Create llm chain 
llm_chain = LLMChain(llm=mistral_llm, prompt=prompt)

from langchain.agents import AgentOutputParser
from langchain_core.agents import AgentAction, AgentFinish
import re
from typing import List, Union

class CustomOutputParser(AgentOutputParser):
    def parse(self, output) -> Union[AgentAction, AgentFinish]:
        print(output)
        output = ' '.join(output.split())
        # Check if the output contains 'Final Answer:'
        if 'Final Answer:' in output:
            # Extract the final answer from the output
            final_answer = output.split('Final Answer:')[1].strip()
            print(final_answer)

            agent_finish = 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": final_answer},
                log=output,
            )
            print(agent_finish)
            return agent_finish
        else:
            # Handle other cases or raise an error
            raise ValueError("Unexpected output format")

output_parser = CustomOutputParser()

# Create an agent with your LLMChain
agent = ConversationalAgent(llm_chain=llm_chain , output_parser=output_parser)

memory = ConversationBufferMemory(memory_key="chat_history")
agent_executor = AgentExecutor(agent=agent, tools=tools, verbose=True, memory=memory)

agent_executor.run("Hi, I'm Madhav?")
```

I get the following output:


```python
> Entering new AgentExecutor chain...
Error in StdOutCallbackHandler.on_agent_action callback: 'tuple' object has no attribute 'log'
 Thought: Do I need to use a tool? No
  Final Answer: Hello, Madhav! How can I assist you today?
Hello, Madhav! How can I assist you today?
return_values={'output': 'Hello, Madhav! How can I assist you today?'} log='Thought: Do I need to use a tool? No Final Answer: Hello, Madhav! How can I assist you today?'

File /opt/conda/lib/python3.10/site-packages/langchain/agents/agent.py:1141, in AgentExecutor._call(self, inputs, run_manager)
   1139 # We now enter the agent loop (until it returns something).
   1140 while self._should_continue(iterations, time_elapsed):
-> 1141     next_step_output = self._take_next_step(
   1142         name_to_tool_map,
   1143         color_mapping,
   1144         inputs,
   1145         intermediate_steps,
   1146         run_manager=run_manager,
   1147     )
   1148     if isinstance(next_step_output, AgentFinish):
   1149         return self._return(
   1150             next_step_output, intermediate_steps, run_manager=run_manager
   1151         )

File /opt/conda/lib/python3.10/site-packages/langchain/agents/agent.py:983, in AgentExecutor._take_next_step(self, name_to_tool_map, color_mapping, inputs, intermediate_steps, run_manager)
    981     run_manager.on_agent_action(agent_action, color="green")
    982 # Otherwise we lookup the tool
--> 983 if agent_action.tool in name_to_tool_map:
    984     tool = name_to_tool_map[agent_action.tool]
    985     return_direct = tool.return_direct

AttributeError: 'tuple' object has no attribute 'tool'
...
```

I'm having trouble understading what is happening here. I'm certain my output contains `Final Answer` so I'd assume I need an `ActionFinish` as per [this tutorial](https://python.langchain.com/docs/modules/agents/how_to/custom_llm_agent#output-parser). 

Any tips would be much appreciated!

### Suggestion:

_No response_