def _convert_to_cohere_tool(
    tool: BaseTool,
) -> Dict[str, Any]:
    """
    Convert a BaseTool instance to a Cohere tool.
    """
    parameters = tool.metadata.get_parameters_dict()
    properties = parameters.get("properties", {})
    return Tool(
        name=tool.metadata.name,
        description=_remove_signature_from_tool_description(
            tool.metadata.name, tool.metadata.description
        ),
        parameter_definitions={
            param_name: ToolParameterDefinitionsValue(
                description=(
                    param_definition.get("description")
                    if "description" in param_definition
                    else ""
                ),
                type=JSON_TO_PYTHON_TYPES.get(
                    param_definition.get("type"), param_definition.get("type")
                ),
                required=param_name in parameters.get("required", []),
            )
            for param_name, param_definition in properties.items()
        },
    ).dict()

    Convert a BaseTool instance to a Cohere tool.
    
llama-index-integrations/llms/llama-index-llms-cohere/llama_index/llms/cohere/utils.py