def format_contexts(contexts: Sequence[str]) -> str:
    """
    Format contexts.

    Taken from https://github.com/SqueezeAILab/LLMCompiler/blob/main/src/llm_compiler/llm_compiler.py

    Contexts is a list of context.
    Each context is formatted as the description of generate_context_for_replanner
    """
    formatted_contexts = ""
    for context in contexts:
        formatted_contexts += f"Previous Plan:\n\n{context}\n\n"
    formatted_contexts += "Current Plan:\n\n"
    return formatted_contexts

    Format contexts.

    Taken from https://github.com/SqueezeAILab/LLMCompiler/blob/main/src/llm_compiler/llm_compiler.py

    Contexts is a list of context.
    Each context is formatted as the description of generate_context_for_replanner
    
llama-index-packs/llama-index-packs-agents-llm-compiler/llama_index/packs/agents_llm_compiler/utils.py