def {{ function_name }}(
    {%- for species in species %}
    {{ species.id.lower() }}: Annotated[str, "{{ species.shortDescription }}"]
    {%- if not loop.last or parameters -%},{%- endif %}
    {%- endfor %}
    {%- for param in parameters %}
    {{ param.id }}: Annotated[str, "{{ param.shortDescription }}"] = "{{ param.id }}"
    {%- if not loop.last -%},{%- endif %}
    {%- endfor %}
) -> Expr:
    """{{ description }}
    
    Args:
    {%- for species in species %}
        {{ species.id.lower() }} (str): {{ species.shortDescription }}
    {%- endfor %}
    {%- for param in parameters %}
        {{ param.id }} (str): {{ param.shortDescription }}
    {%- endfor %}
        
    Returns:
        str: The kinetic law equation as a string
    """
    equation = sympify("{{ equation }}", locals=LOCALS)
    
    substitutions = {}
    {%- for species in species %}
    substitutions[sympify("{{ species.id }}", locals=LOCALS)] = sympify({{ species.id.lower() }}, locals=LOCALS)
    {%- endfor %}
    {%- for param in parameters %}
    substitutions[sympify("{{ param.id }}", locals=LOCALS)] = sympify({{ param.id }}, locals=LOCALS)
    {%- endfor %}
    
    for original, replacement in substitutions.items():
        equation = equation.subs(original, replacement)
    
    return equation
