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

    Args:
        path: The path for the route.
        resource: An OpenAIResource 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("/")])

    resource_prefix = resource.__class__.__name__

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

    Args:
        path: The path for the route.
        resource: An OpenAIResource instance.
    
lanarky/adapters/openai/utils.py