<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_version(path) -> str: """ Reads the version field from a package file :param path: the path to a valid package.json file :return: the version string or "unknown" """

    if path and os.path.exists(path):
        with open(path) as pkg:
            package_dict = json.load(pkg)
            version = package_dict.get('version')
    else:
        version = 'not available'
    return version