create_csv_agent with custom prefix prompt is not calling PythonREPL tool, reaching max iterations with no answer

### System Info

agent_new("What is the average age of male members?")

{'input': 'What is the average age of male members?',
 'output': 'Agent stopped due to iteration limit or time limit.',
 'intermediate_steps': [(AgentAction(tool='I will use the `mean()` function from pandas to calculate the average age.', tool_input="`df[df['Sex'] == 'male']['Age'].mean()`\n", log="Thought: I need to calculate the average age of male members in the dataframe.\n\nAction: I will use the `mean()` function from pandas to calculate the average age.\n\nAction Input: `df[df['Sex'] == 'male']['Age'].mean()`\n"),
   'I will use the `mean()` function from pandas to calculate the average age. is not a valid tool, try another one.'),
  (AgentAction(tool='I will use the `mean()` function from pandas to calculate the average age.', tool_input="`df[df['Sex'] == 'male']['Age'].mean()`\n", log="I need to use the `mean()` function from pandas to calculate the average age of male members in the dataframe.\n\nAction: I will use the `mean()` function from pandas to calculate the average age.\n\nAction Input: `df[df['Sex'] == 'male']['Age'].mean()`\n"),
   'I will use the `mean()` function from pandas to calculate the average age. is not a valid tool, try another one.'),
  (AgentAction(tool='I will use the `mean()` function from pandas to calculate the average age.', tool_input="`df[df['Sex'] == 'male']['Age'].mean()`\n", log="I need to use the `mean()` function from pandas to calculate the average age of male members in the dataframe.\n\nAction: I will use the `mean()` function from pandas to calculate the average age.\n\nAction Input: `df[df['Sex'] == 'male']['Age'].mean()`\n"),
   'I will use the `mean()` function from pandas to calculate the average age. is not a valid tool, try another one.'),
  (AgentAction(tool='I will use the `mean()` function from pandas to calculate the average age.', tool_input="`df[df['Sex'] == 'male']['Age'].mean()`\n", log="I need to use the `mean()` function from pandas to calculate the average age of male members in the dataframe.\n\nAction: I will use the `mean()` function from pandas to calculate the average age.\n\nAction Input: `df[df['Sex'] == 'male']['Age'].mean()`\n"),
   'I will use the `mean()` function from pandas to calculate the average age. is not a valid tool, try another one.'),
  (AgentAction(tool='I will use the `mean()` function from pandas to calculate the average age.', tool_input="`df[df['Sex'] == 'male']['Age'].mean()`\n", log="I need to use the `mean()` function from pandas to calculate the average age of male members in the dataframe.\n\nAction: I will use the `mean()` function from pandas to calculate the average age.\n\nAction Input: `df[df['Sex'] == 'male']['Age'].mean()`\n"),
   'I will use the `mean()` function from pandas to calculate the average age. is not a valid tool, try another one.'),
  (AgentAction(tool='I will use the `mean()` function from pandas to calculate the average age.', tool_input="`df[df['Sex'] == 'male']['Age'].mean()`\n", log="I need to use the `mean()` function from pandas to calculate the average age of male members in the dataframe.\n\nAction: I will use the `mean()` function from pandas to calculate the average age.\n\nAction Input: `df[df['Sex'] == 'male']['Age'].mean()`\n"),
   'I will use the `mean()` function from pandas to calculate the average age. is not a valid tool, try another one.'),
  (AgentAction(tool='I will use the `mean()` function from pandas to calculate the average age.', tool_input="`df[df['Sex'] == 'male']['Age'].mean()`\n", log="I need to use the `mean()` function from pandas to calculate the average age of male members in the dataframe.\n\nAction: I will use the `mean()` function from pandas to calculate the average age.\n\nAction Input: `df[df['Sex'] == 'male']['Age'].mean()`\n"),
   'I will use the `mean()` function from pandas to calculate the average age. is not a valid tool, try another one.'),
  (AgentAction(tool='I will use the `mean()` function from pandas to calculate the average age.', tool_input="`df[df['Sex'] == 'male']['Age'].mean()`\n", log="I need to use the `mean()` function from pandas to calculate the average age of male members in the dataframe.\n\nAction: I will use the `mean()` function from pandas to calculate the average age.\n\nAction Input: `df[df['Sex'] == 'male']['Age'].mean()`\n"),
   'I will use the `mean()` function from pandas to calculate the average age. is not a valid tool, try another one.'),
  (AgentAction(tool='I will use the `mean()` function from pandas to calculate the average age.', tool_input="`df[df['Sex'] == 'male']['Age'].mean()`\n", log="I need to use the `mean()` function from pandas to calculate the average age of male members in the dataframe.\n\nAction: I will use the `mean()` function from pandas to calculate the average age.\n\nAction Input: `df[df['Sex'] == 'male']['Age'].mean()`\n"),
   'I will use the `mean()` function from pandas to calculate the average age. is not a valid tool, try another one.'),
  (AgentAction(tool='I will use the `mean()` function from pandas to calculate the average age.', tool_input="`df[df['Sex'] == 'male']['Age'].mean()`\n", log="I need to use the `mean()` function from pandas to calculate the average age of male members in the dataframe.\n\nAction: I will use the `mean()` function from pandas to calculate the average age.\n\nAction Input: `df[df['Sex'] == 'male']['Age'].mean()`\n"),
   'I will use the `mean()` function from pandas to calculate the average age. is not a valid tool, try another one.'),
  (AgentAction(tool='I will use the `mean()` function from pandas to calculate the average age.', tool_input="`df[df['Sex'] == 'male']['Age'].mean()`\n", log="I need to use the `mean()` function from pandas to calculate the average age of male members in the dataframe.\n\nAction: I will use the `mean()` function from pandas to calculate the average age.\n\nAction Input: `df[df['Sex'] == 'male']['Age'].mean()`\n"),
   'I will use the `mean()` function from pandas to calculate the average age. is not a valid tool, try another one.'),
  (AgentAction(tool='I will use the `mean()` function from pandas to calculate the average age.', tool_input="`df[df['Sex'] == 'male']['Age'].mean()`\n", log="I need to use the `mean()` function from pandas to calculate the average age of male members in the dataframe.\n\nAction: I will use the `mean()` function from pandas to calculate the average age.\n\nAction Input: `df[df['Sex'] == 'male']['Age'].mean()`\n"),
   'I will use the `mean()` function from pandas to calculate the average age. is not a valid tool, try another one.'),
  (AgentAction(tool='I will use the `mean()` function from pandas to calculate the average age.', tool_input="`df[df['Sex'] == 'male']['Age'].mean()`\n", log="I need to use the `mean()` function from pandas to calculate the average age of male members in the dataframe.\n\nAction: I will use the `mean()` function from pandas to calculate the average age.\n\nAction Input: `df[df['Sex'] == 'male']['Age'].mean()`\n"),
   'I will use the `mean()` function from pandas to calculate the average age. is not a valid tool, try another one.'),
  (AgentAction(tool='I will use the `mean()` function from pandas to calculate the average age.', tool_input="`df[df['Sex'] == 'male']['Age'].mean()`\n", log="I need to use the `mean()` function from pandas to calculate the average age of male members in the dataframe.\n\nAction: I will use the `mean()` function from pandas to calculate the average age.\n\nAction Input: `df[df['Sex'] == 'male']['Age'].mean()`\n"),
   'I will use the `mean()` function from pandas to calculate the average age. is not a valid tool, try another one.'),
  (AgentAction(tool='I will use the `mean()` function from pandas to calculate the average age.', tool_input="`df[df['Sex'] == 'male']['Age'].mean()`\n", log="I need to use the `mean()` function from pandas to calculate the average age of male members in the dataframe.\n\nAction: I will use the `mean()` function from pandas to calculate the average age.\n\nAction Input: `df[df['Sex'] == 'male']['Age'].mean()`\n"),
   'I will use the `mean()` function from pandas to calculate the average age. is not a valid tool, try another one.')]}

### Who can help?

@hwchase17 @agola11 What is the best way to customize the prompt for CSV Agent, so that I can add a few shot examples as I mentioned above? 

### Information

- [ ] The official example notebooks/scripts
- [X] My own modified scripts

### Related Components

- [ ] LLMs/Chat Models
- [ ] Embedding Models
- [X] Prompts / Prompt Templates / Prompt Selectors
- [ ] Output Parsers
- [ ] Document Loaders
- [ ] Vector Stores / Retrievers
- [ ] Memory
- [X] Agents / Agent Executors
- [X] Tools / Toolkits
- [ ] Chains
- [ ] Callbacks/Tracing
- [ ] Async

### Reproduction

Just follow as below:

PREFIX = """
You are working with a pandas dataframe in Python. The name of the dataframe is `df`.

1. If the query requires a table, format your answer like this:
    {{"table": {{"columns": ["column1", "column2", ...], "data": [[value1, value2, ...], [value1, value2, ...], ...]}}}}

2. For a bar chart, respond like this:
    {{"bar": {{"columns": ["A", "B", "C", ...], "data": [25, 24, 10, ...]}}}}

3. If a line chart is more appropriate, your reply should look like this:
    {{"line": {{"columns": ["A", "B", "C", ...], "data": [25, 24, 10, ...]}}}}

4. For a plain question that doesn't need a chart or table, your response should be:
    {{"answer": "Your answer goes here"}}

    For example:
        {{"answer": "The Product with the highest Orders is '15143Exfo'"}}

5. If the answer is not known or available, respond with:
    {{"answer": "I do not know."}}
    
Return all output as a string. Remember to encase all strings in the "columns" list and data list in double quotes. 
For example: {{"columns": ["Products", "Orders"], "data": [["51993Masc", 191], ["49631Foun", 152]]}}

You should use the tools below to answer the question posed of you:"""

agent_new = create_csv_agent(llm=llm, path='titanic.csv', prefix=PREFIX,
                         return_intermediate_steps=True, verbose=True, include_df_in_prompt=False) 


### Expected behavior

I think I'm replacing the default prefix prompt of the panda's agent with my "prefix=PREFIX" argument. Also, I did not remove any input variables. Just added extra instructions(A few shots). To guide the response to my expectation. it should work as usual as the default prompt. But it's always retrying and not able to use the python REPL tool some how. What is the issue here?