) -> List[BaseMessage]:
    """Convert (AgentAction, tool output) tuples into FunctionMessages.
    Args:
        intermediate_steps: Steps the LLM has taken to date, along with observations
    Returns:
        list of messages to send to the LLM for the next prediction
    """
    messages = []
    for agent_action, observation in intermediate_steps:
        messages.extend(_convert_agent_action_to_messages(agent_action, observation))
    return messages
# Backwards compatibility
format_to_openai_functions = format_to_openai_function_messages