apache / opendal

Apache OpenDAL: access data freely.
https://opendal.apache.org
Apache License 2.0
3.27k stars 455 forks source link

fix(services/huggingface): Align with latest HuggingFace API #5123

Closed morristai closed 2 weeks ago

morristai commented 2 weeks ago

Which issue does this PR close?

Closes #5122.

Rationale for this change

Example for latest response:

[
    {
        "type": "directory",
        "oid": "d564d0bc3dd917926892c55e3706cc116d5b165e",
        "size": 0,
        "path": "testdata/normal_dir",
        "lastCommit": {
            "id": "d836cf493b05f550c469d9c5cd553a3571372f17",
            "title": "Add testdata",
            "date": "2023-11-27T09:12:40.000Z"
        }
    },
    {
        "type": "directory",
        "oid": "d564d0bc3dd917926892c55e3706cc116d5b165e",
        "size": 0,
        "path": "testdata/special_dir  !@#$%^&()_+-=;',",
        "lastCommit": {
            "id": "d836cf493b05f550c469d9c5cd553a3571372f17",
            "title": "Add testdata",
            "date": "2023-11-27T09:12:40.000Z"
        }
    },
    {
        "type": "file",
        "oid": "9f37f432f4f882512be8e29529eb7b68a9ca7b3f",
        "size": 30482,
        "path": "testdata/normal_file.txt",
        "lastCommit": {
            "id": "d836cf493b05f550c469d9c5cd553a3571372f17",
            "title": "Add testdata",
            "date": "2023-11-27T09:12:40.000Z"
        },
        "security": {
            "blobId": "9f37f432f4f882512be8e29529eb7b68a9ca7b3f",
            "indexed": false,
            "safe": true,
            "avScan": {
                "virusFound": false,
                "virusNames": null
            },
            "pickleImportScan": null
        }
    },
    {
        "type": "file",
        "oid": "9f37f432f4f882512be8e29529eb7b68a9ca7b3f",
        "size": 30482,
        "path": "testdata/special_file  !@#$%^&()_+-=;',.txt",
        "lastCommit": {
            "id": "d836cf493b05f550c469d9c5cd553a3571372f17",
            "title": "Add testdata",
            "date": "2023-11-27T09:12:40.000Z"
        },
        "security": {
            "blobId": "9f37f432f4f882512be8e29529eb7b68a9ca7b3f",
            "indexed": false,
            "safe": true,
            "avScan": {
                "virusFound": false,
                "virusNames": null
            },
            "pickleImportScan": null
        }
    }
]

What changes are included in this PR?

Are there any user-facing changes?