Home

Awesome

<div align= "center"> <h1> ๐Ÿ”งShortcutsBench๐Ÿ“ฑ</h1> </div> <div align="center">

Dialogues Dialogues Dialogues Dialogues Dialogues

</div> <!-- <p align="center"> <a href="#model">Model</a> โ€ข <a href="#data">Data Release</a> โ€ข <a href="#web-ui">Web Demo</a> โ€ข <a href="#tool-eval">Tool Eval</a> โ€ข <a href="https://arxiv.org/pdf/2307.16789.pdf">Paper</a> โ€ข <a href="#citation">Citation</a> </p> --> </div>

Read this in ไธญๆ–‡.

What are Shortcuts?

Shortcuts are workflows built by developers in the Shortcuts app using a user-friendly graphical interface ๐Ÿ–ผ๏ธ with the provided basic actions. Apple describes them as "a quick way to get one or more tasks done with your apps." ๐Ÿ“ฑ

Project Task List (Continuously Updated) ๐Ÿ“‹

All data, data acquisition processes, data generated during cleaning, cleaning scripts, experiment scripts, results, and related files can be found in the following documents: deves_dataset/dataset_src/README.md (English) or Chinese, deves_dataset/dataset_src_valid_apis/README.md (English) or Chinese, and experiments/README.md (English) or Chinese.

How can this project help you?

The Apple Developer Conference WWDC'24 introduced a lot of AI features on Apple devices ๐Ÿค–. We are very interested in how Apple combines large language models like ChatGPT with devices to provide users with a smarter experience ๐Ÿ’ก. In this process, shortcuts will play a significant role! ๐Ÿš€

As a Shortcut User and Enthusiast ๐Ÿ“ฑ

You can find your favorite shortcuts in this dataset ๐Ÿ“ฑ to help you complete various complex tasks with one click! For example:

As a Researcher ๐Ÿ”ฌ

๐ŸŒŸAdvantages of ShortcutsBench Over Existing API-Based Agent Datasets๐ŸŒŸ

ShortcutsBench has significant advantages in terms of the authenticity, richness, and complexity of APIs, the validity of queries and corresponding action sequences, the accurate filling of parameter values, the awareness of obtaining information from the system or users, and the overall scale.

To our knowledge, ShortcutsBench is the first large-scale agent benchmark based on real APIs, considering APIs, queries, and corresponding action sequences. ShortcutsBench provides a rich set of real APIs, queries of varying difficulty and task types, high-quality human-annotated action sequences (provided by shortcut developers), and queries from real user needs. Additionally, it offers precise parameter value filling, including raw data types, enumeration types, and using outputs from previous actions as parameter values, and evaluates the agent's awareness of requesting necessary information from the system or users. Moreover, the scale of APIs, queries, and corresponding action sequences in ShortcutsBench rivals or even surpasses benchmarks and datasets created by LLMs or modified from existing datasets. A comprehensive comparison between ShortcutsBench and existing benchmarks/datasets is shown in the table below.

Example Image

If you find this project helpful, please give us a Star โญ๏ธ! Thank you for your support! ๐Ÿ™

Keywords: Shortcuts, Apple, WWDC'24, Siri, iOS, macOS, watchOS, Workflow, API Calls, Low-Code Programming, Agent, Large Language Model

User Guide for Shortcuts (For Users) ๐Ÿ“ฑ

Search for the Shortcut You Want ๐Ÿ”

In this repository, the users_dataset/${website name}/${category name}/README.md file records the metadata of all shortcuts in the category, including name, description, iCloud download link, etc. Each README.md file follows this structure:

### Name: Wine Shops # Shortcut Name
- URL: https://www.icloud.com/shortcuts/78ffd18288fd4da286bfd570993ea46e # iCloud Link
- Source: https://shortcutsgallery.com # Source
- Description: Look for Wine shops near you # Description

Use the shortcut Ctrl + F to search by keyword in the shortcut name directly in your browser ๐Ÿ”Ž. You can also visit Shortcut Collection Sites to search for the shortcuts you want ๐ŸŒ.

Import the Found Shortcut ๐Ÿ“ฅ

On your Apple device, click the iCloud link in the URL, and the shortcut will automatically open and be imported into your Shortcuts app ๐Ÿ“ฒ.

Download Shortcut Source Files

Besides downloading shortcuts one by one using the iCloud links, you can directly get the complete data from the following links:

Data Sources and Links ๐ŸŒ

Data SourceMetadata LocationCloud Link
MatthewcassinelliLocation in this repositoryGoogle Drive Link | Baidu Cloud Link
RoutinehubLocation in this repositoryGoogle Drive Link | Baidu Cloud Link
MacStoriesLocation in this repositoryGoogle Drive Link | Baidu Cloud Link
ShareShortcutsLocation in this repositoryGoogle Drive Link | Baidu Cloud Link
ShortcutsGalleryLocation in this repositoryGoogle Drive Link | Baidu Cloud Link
iSpazioLocation in this repositoryGoogle Drive Link | Baidu Cloud Link
JiejingkuLocation in this repositoryGoogle Drive Link | Baidu Cloud Link
SSPaiLocation in this repositoryGoogle Drive Link | Baidu Cloud Link
Jiejing.funLocation in this repositoryGoogle Drive Link | Baidu Cloud Link
KejicutLocation in this repositoryGoogle Drive Link | Baidu Cloud Link
RCutsLocation in this repositoryGoogle Drive Link | Baidu Cloud Link

Introduction to Shortcut Source Files

The shortcut source data in the cloud drive is organized in the following directory structure:

users_dataset/
โ”œโ”€โ”€ matthewcassinelli.com_sirishortcuts_library_free # Website Name
โ”‚   โ”œโ”€โ”€ file1
โ”‚   โ”œโ”€โ”€ file2
โ”‚   โ””โ”€โ”€ file3

or

users_dataset/
โ”œโ”€โ”€ jiejingku.net # Website Name
โ”‚   โ”œโ”€โ”€ category1 # Category
โ”‚   โ”‚   โ”œโ”€โ”€ file1 # Each specific shortcut
โ”‚   โ”‚   โ””โ”€โ”€ file2
โ”‚   โ”œโ”€โ”€ category2
โ”‚   โ”‚   โ””โ”€โ”€ file3

Each file represents a shortcut. The file name is generated by simply processing the shortcut name, using the following code:

file_name = re.sub(r'[^a-zA-Z0-9]', '_', name)

The shortcut source files we provide are in JSON format, whereas shortcuts exported from Apple devices are in the form of iCloud links (shared as links) or encrypted shortcut files with the .shortcut extension.

To import a shortcut source file into the Shortcuts app on macOS, follow these steps:

ShortcutsBench Dataset Construction Guide ๐Ÿ“š

Data Acquisition Process

We detail the construction process of ShortcutsBench in the main text of our paper. For more details, please refer to our paper. Below are some additional details.

How to use shortcuts? How to share shortcuts? How to view the source files of shortcuts?

  1. Import shortcuts into the Shortcuts app.

    You can import shortcuts into the Shortcuts app on Apple devices by clicking the iCloud link and using the shortcut as a regular user.

  2. Share shortcuts.

    • You can share the shortcut as an iCloud link using the Share option in the Shortcuts app on macOS or iOS.
    • You can share the shortcut as a source file using the Share option in the Shortcuts app on macOS, resulting in a shortcut file with the .shortcut extension. Note: The shared source file is encrypted by Apple and cannot be directly parsed using the plist package in Python.
  3. Decrypt single or multiple shortcuts. If you want to decrypt a specific shortcut, you can use the following shortcuts to decrypt other shortcuts. The decrypted files will be in plist format.

    To make it easier to read, you can choose to convert the plist files to json format. The shortcut source files we provide are all in json format.

  4. How to acquire shortcut source files on a large scale?

    Instead of using Get Plist and Get Plist Loop to parse shortcuts, we follow these two steps for quicker and more efficient mass acquisition of shortcut source files:

    1. Obtain iCloud links in the format https://www.icloud.com/shortcuts/${unique_id}.
    2. Request partial metadata of the shortcut from https://www.icloud.com/shortcuts/api/records/${unique_id}, including the shortcut name and download link for the source file.
    3. Use the download link cur_dict["fields"]["shortcut"]["value"]["downloadURL"] obtained in the previous step to request the source file of the shortcut. Note: The download link expires quickly, so you need to use it promptly.

    The directly downloaded source file is in plist format. You can choose to convert the plist format to json format.

    The following code (simplified) demonstrates the entire process, with the final response_json being the json format shortcut source file:

    response = requests.get(f"https://www.icloud.com/shortcuts/api/records/{unique_id}")
    
    cur_dict = response.json()
    downloadURL = cur_dict["fields"]["shortcut"]["value"]["downloadURL"]
    new_response = requests.get(downloadURL)
    # Convert using the plist package to json and store in response_json
    response_json = biplist.readPlistFromString(new_response.content)
    

License Statement ๐Ÿ“œ

All code and datasets in this project are licensed under the Apache License 2.0. This means you are free to use, copy, modify, and distribute the content of this project, but must comply with the following conditions:

For the full text of the license, please see LICENSE.

Additionally, you must comply with the license agreements of the shortcut sharing sites that provided the data sources for this project.

Citation

If you find this project helpful, please consider citing our work:


@misc{
    shen2024shortcutsbenchlargescalerealworldbenchmark,
    title={ShortcutsBench: A Large-Scale Real-world Benchmark for API-based Agents}, 
    author={Haiyang Shen and Yue Li and Desong Meng and Dongqi Cai and Sheng Qi and Li Zhang and Mengwei Xu and Yun Ma},
    year={2024},
    eprint={2407.00132},
    archivePrefix={arXiv},
    primaryClass={cs.SE},
    url={https://arxiv.org/abs/2407.00132}, 
}