SystemMessage are not considered while creating AgentExecutor with OPENAI_FUNCTIONS
Labels: name: area: agent, name: auto:bug, name: integration: elasticsearch

### System Info

Langchain version 0.352

SystemMessage is ignored when I invoke AgentExecutor.run function. the code looks as below.

```
from typing import Tuple, Dict

from langchain.agents import initialize_agent, AgentType
from langchain.agents.agent import AgentExecutor
from langchain.agents.format_scratchpad.openai_functions import format_to_openai_function_messages
from langchain.agents.output_parsers import OpenAIFunctionsAgentOutputParser
from langchain.memory import ConversationBufferMemory
from langchain.prompts import ChatPromptTemplate, MessagesPlaceholder
from langchain.tools.render import format_tool_to_openai_function
from langchain_core.messages import SystemMessage

from elasticsearch_agent.config import cfg
from elasticsearch_agent.tools.index_data_tool import IndexShowDataTool
from elasticsearch_agent.tools.index_details_tool import IndexDetailsTool
from elasticsearch_agent.tools.index_search_tool import create_search_tool
from elasticsearch_agent.tools.list_indices_tool import ListIndicesTool

tools = [
    ListIndicesTool(),
    IndexShowDataTool(),
    IndexDetailsTool(),
    create_search_tool(),
]


def elastic_agent_factory() -> AgentExecutor:
    system_msg = """
        You are a helpful AI ElasticSearch Expert Assistant
        **Always you will get the field names of the ElasticSearch index from the Elasticsearch DB as a first step.
        You are provided with various tools to help the user to get information from an ElasticSearch index.
        you will get the index name from the question. If not provided, show the list of available indices and  ask the user to choose it.
        You will generate required aggregation queries for any analytical questions asked.
        You will use 'aggregations' field in response object for answering analytical queries.
        Dont's:
         Never assume index names or field names.
        """

    agent_kwargs, memory = setup_memory()
    agent_kwargs["system_message"] = SystemMessage(content=system_msg)

    return initialize_agent(
        tools,
        cfg.llm,
        agent=AgentType.OPENAI_FUNCTIONS,
        verbose=False,
        agent_kwargs=agent_kwargs,
        memory=memory
    )


def setup_memory() -> Tuple[Dict, ConversationBufferMemory]:
    """
    Sets up memory for the open ai functions agent.
    :return a tuple with the agent keyword pairs and the conversation memory.
    """
    agent_kwargs = {
        "extra_prompt_messages": [MessagesPlaceholder(variable_name="memory")],
    }
    memory = ConversationBufferMemory(memory_key="memory", return_messages=True)

    return agent_kwargs, memory

if __name__ == "__main__":
    agent_executor = elastic_agent_factory()
    prompt = agent_executor.agent.prompt
    print(prompt)
    print(type(agent_executor.agent.prompt))
```

### Who can help?

_No response_

### Information

- [ ] The official example notebooks/scripts
- [X] My own modified scripts

### Related Components

- [ ] LLMs/Chat Models
- [ ] Embedding Models
- [ ] Prompts / Prompt Templates / Prompt Selectors
- [ ] Output Parsers
- [ ] Document Loaders
- [ ] Vector Stores / Retrievers
- [ ] Memory
- [ ] Agents / Agent Executors
- [ ] Tools / Toolkits
- [X] Chains
- [ ] Callbacks/Tracing
- [X] Async

### Reproduction

run the given code

### Expected behavior

The chain agent should consider using the system message and extra prompt message provided to it.