size_categories:10K<n<100K format:parquet modality:text library:datasets library:pandas library:mlcroissant library:polars library:distilabel arxiv:2406.18518 region:us synthetic distilabel rlaif
---
size_categories: n<1K
dataset_info:
  features:
  - name: func_name
    dtype: string
  - name: func_desc
    dtype: string
  - name: tools
    dtype: string
  - name: examples
    dtype: string
  - name: query
    dtype: string
  - name: answers
    dtype: string
  - name: distilabel_metadata
    struct:
    - name: raw_input_a_p_i_gen_generator_0
      list:
      - name: content
        dtype: string
      - name: role
        dtype: string
    - name: raw_output_a_p_i_gen_generator_0
      dtype: string
  - name: model_name
    dtype: string
  - name: keep_row_after_execution_check
    dtype: bool
  - name: execution_result
    sequence: string
  splits:
  - name: train
    num_bytes: 331481072
    num_examples: 40528
  download_size: 85003654
  dataset_size: 331481072
configs:
- config_name: default
  data_files:
  - split: train
    path: data/train-*
tags:
- synthetic
- distilabel
- rlaif
---

<p align="left">
  <a href="https://github.com/argilla-io/distilabel">
    <img src="https://raw.githubusercontent.com/argilla-io/distilabel/main/docs/assets/distilabel-badge-light.png" alt="Built with Distilabel" width="200" height="32"/>
  </a>
</p>

# Dataset Card for synth-apigen-qwen-exec

This dataset has been created with [distilabel](https://distilabel.argilla.io/).


The pipeline script was uploaded to easily reproduce the dataset:
[apigen_exec.py](https://huggingface.co/datasets/plaguss/synth-apigen-qwen-exec/raw/main/apigen_exec.py).

It can be run directly using the CLI:

```console
distilabel pipeline run --script "https://huggingface.co/datasets/plaguss/synth-apigen-qwen-exec/raw/main/apigen_exec.py"
```


## Dataset Summary

This dataset contains a `pipeline.yaml` which can be used to reproduce the pipeline that generated it in distilabel using the `distilabel` CLI:

```console
distilabel pipeline run --config "https://huggingface.co/datasets/plaguss/synth-apigen-qwen-exec/raw/main/pipeline.yaml"
```

or explore the configuration:

```console
distilabel pipeline info --config "https://huggingface.co/datasets/plaguss/synth-apigen-qwen-exec/raw/main/pipeline.yaml"
```

## Dataset structure

The examples have the following structure per configuration:


<details><summary> Configuration: default </summary><hr>

```json
{
    "answers": "[{\"name\": \"read_text_file\", \"arguments\": {\"filename\": \"notes.txt\"}}, {\"name\": \"read_text_file\", \"arguments\": {\"filename\": \"log.txt\"}}]",
    "distilabel_metadata": {
        "raw_input_a_p_i_gen_generator_0": [
            {
                "content": "You are a data labeler. Your responsibility is to generate a set of diverse queries and corresponding answers for the given functions in JSON format.\n\nConstruct queries and answers that exemplify how to use these functions in a practical scenario. Include in each query specific, plausible values for each parameter. For instance, if the function requires a date, use a typical and reasonable date.\n\nEnsure the query:\n- Is clear and concise\n- Demonstrates typical use cases\n- Includes all necessary parameters in a meaningful way. For numerical parameters, it could be either numbers or words\n- Across a variety level of difficulties, ranging from beginner and advanced use cases\n- The corresponding result\u0027s parameter types and ranges match with the function\u0027s descriptions\n\nEnsure the answer:\n- Is a list of function calls in JSON format\n- The length of the answer list should be equal to the number of requests in the query\n- Can solve all the requests in the query effectively",
                "role": "system"
            },
            {
                "content": "Here are examples of queries and the corresponding answers for similar functions:\n## Query:\nCould you get the comments from the YouTube community post using the cursor \u0027mno345\u0027? Also, what genres are available in Webtoon originals for Thai readers?\n## Answers:\n[{\"name\": \"community_post_comments\", \"arguments\": {\"cursor\": \"mno345\"}}, {\"name\": \"originals_genres_list\", \"arguments\": {\"language\": \"th\"}}]\n\n## Query:\nWho was the runner-up in the NCAA Final Four for the year 2015?\n## Answers:\n[{\"name\": \"runner_up\", \"arguments\": {\"identifier\": \"2015\"}}]\n\n## Query:\nCan you fetch the artificial intelligence projects from page 1?\n## Answers:\n[{\"name\": \"getprojects\", \"arguments\": {\"page\": 1}}]\n\n## Query:\nWhat kind of crimes happened at the location with latitude 51.5074 and longitude -0.1278 on the fifteenth of December, two thousand twenty-two?\n## Answers:\n[{\"name\": \"crimes_at_location\", \"arguments\": {\"date\": \"2022-12-15\", \"lat\": \"51.5074\", \"lng\": \"-0.1278\"}}]\n\nNote that the query could be interpreted as a combination of several independent requests.\n\nBased on these examples, generate 1 diverse query and answer pairs for the function `read_text_file`.\nThe detailed function description is the following:\nReads a text file and returns its content as a string.\n\nThis is the available tool to guide you (respect the order of the parameters):\n[{\"type\": \"function\", \"function\": {\"name\": \"read_text_file\", \"description\": \"Reads a text file and returns its content as a string.\", \"parameters\": {\"type\": \"object\", \"properties\": {\"filename\": {\"type\": \"string\", \"description\": \"The name of the file to read.\"}}, \"required\": [\"filename\"]}}}]\n\nThe output MUST strictly adhere to the following JSON format, and NO other text MUST be included:\n```\n[\n   {\n       \"query\": \"The generated query.\",\n       \"answers\": [\n           {\n               \"name\": \"api_name\",\n               \"arguments\": {\n                   \"arg_name\": \"value\"\n                   ... (more arguments as required)\n               }\n           },\n           ... (more API calls as required)\n       ]\n   }\n]\n```\n\nNow please generate 1 diverse query and answer pairs following the above format.",
                "role": "user"
            }
        ],
        "raw_output_a_p_i_gen_generator_0": "```\n[\n    {\n        \"query\": \"Could you please read the content of the file named \u0027notes.txt\u0027 and also fetch the data from \u0027log.txt\u0027?\",\n        \"answers\": [\n            {\n                \"name\": \"read_text_file\",\n                \"arguments\": {\n                    \"filename\": \"notes.txt\"\n                }\n            },\n            {\n                \"name\": \"read_text_file\",\n                \"arguments\": {\n                    \"filename\": \"log.txt\"\n                }\n            }\n        ]\n    },\n    {\n        \"query\": \"What is the content of the \u0027terms_of_service.txt\u0027 file? Also, can you read the \u0027user_guide.txt\u0027 file for me?\",\n        \"answers\": [\n            {\n                \"name\": \"read_text_file\",\n                \"arguments\": {\n                    \"filename\": \"terms_of_service.txt\"\n                }\n            },\n            {\n                \"name\": \"read_text_file\",\n                \"arguments\": {\n                    \"filename\": \"user_guide.txt\"\n                }\n            }\n        ]\n    }\n]\n```"
    },
    "examples": "## Query:\nCould you get the comments from the YouTube community post using the cursor \u0027mno345\u0027? Also, what genres are available in Webtoon originals for Thai readers?\n## Answers:\n[{\"name\": \"community_post_comments\", \"arguments\": {\"cursor\": \"mno345\"}}, {\"name\": \"originals_genres_list\", \"arguments\": {\"language\": \"th\"}}]\n\n## Query:\nWho was the runner-up in the NCAA Final Four for the year 2015?\n## Answers:\n[{\"name\": \"runner_up\", \"arguments\": {\"identifier\": \"2015\"}}]\n\n## Query:\nCan you fetch the artificial intelligence projects from page 1?\n## Answers:\n[{\"name\": \"getprojects\", \"arguments\": {\"page\": 1}}]\n\n## Query:\nWhat kind of crimes happened at the location with latitude 51.5074 and longitude -0.1278 on the fifteenth of December, two thousand twenty-two?\n## Answers:\n[{\"name\": \"crimes_at_location\", \"arguments\": {\"date\": \"2022-12-15\", \"lat\": \"51.5074\", \"lng\": \"-0.1278\"}}]",
    "execution_result": [
        "File not found",
        "{\"os\": \"Windows 10\"}\n{\"ram\": \"16 GB\"}\n{\"cpu\": \"Intel Core i7\"}\nHello abc world -\u003e Hello xyz world\n"
    ],
    "func_desc": "Reads a text file and returns its content as a string.",
    "func_name": "read_text_file",
    "keep_row_after_execution_check": false,
    "model_name": "Qwen/Qwen2.5-72B-Instruct",
    "query": "Could you please read the content of the file named \u0027notes.txt\u0027 and also fetch the data from \u0027log.txt\u0027?",
    "tools": "[{\"type\": \"function\", \"function\": {\"name\": \"read_text_file\", \"description\": \"Reads a text file and returns its content as a string.\", \"parameters\": {\"type\": \"object\", \"properties\": {\"filename\": {\"type\": \"string\", \"description\": \"The name of the file to read.\"}}, \"required\": [\"filename\"]}}}]"
}
```

This subset can be loaded as:

```python
from datasets import load_dataset

ds = load_dataset("plaguss/synth-apigen-qwen-exec", "default")
```

Or simply as it follows, since there's only one configuration and is named `default`: 

```python
from datasets import load_dataset

ds = load_dataset("plaguss/synth-apigen-qwen-exec")
```


</details>





## References


```
@misc{2406.18518,
Author = {Zuxin Liu and Thai Hoang and Jianguo Zhang and Ming Zhu and Tian Lan and Shirley Kokane and Juntao Tan and Weiran Yao and Zhiwei Liu and Yihao Feng and Rithesh Murthy and Liangwei Yang and Silvio Savarese and Juan Carlos Niebles and Huan Wang and Shelby Heinecke and Caiming Xiong},
Title = {APIGen: Automated Pipeline for Generating Verifiable and Diverse Function-Calling Datasets},
Year = {2024},
Eprint = {arXiv:2406.18518},
}
```


