def get_parameters(fn: Callable) -> Tuple[Set[str], Set[str]]:
    """
    Get parameters from function.

    Returns:
        Tuple[Set[str], Set[str]]: required and optional parameters

    """
    # please write function below
    params = signature(fn).parameters
    required_params = set()
    optional_params = set()
    for param_name in params:
        param_default = params[param_name].default
        if param_default is params[param_name].empty:
            required_params.add(param_name)
        else:
            optional_params.add(param_name)
    return required_params, optional_params

    Get parameters from function.

    Returns:
        Tuple[Set[str], Set[str]]: required and optional parameters

    
llama-index-core/llama_index/core/query_pipeline/components/agent.py