def compile_model_prefix(path: str, chain: Chain) -> str:
    """Compile a prefix for pydantic models.

    Args:
        path: The path for the route.
        chain: A LangChain instance.
    """
    # Remove placeholders like '{item}' using regex
    path_wo_params = re.sub(r"\{.*?\}", "", path)
    path_prefix = "".join([part.capitalize() for part in path_wo_params.split("/")])

    chain_prefix = chain.__class__.__name__

    return f"{path_prefix}{chain_prefix}"
Compile a prefix for pydantic models.

    Args:
        path: The path for the route.
        chain: A LangChain instance.
    
lanarky/adapters/langchain/utils.py