size_categories:n<1K format:parquet modality:text library:datasets library:pandas library:mlcroissant library:polars library:distilabel arxiv:2406.08464 region:us synthetic distilabel rlaif datacraft
---
size_categories: n<1K
dataset_info:
  features:
  - name: prompt
    dtype: string
  - name: completion
    dtype: string
  - name: model_name
    dtype: string
  splits:
  - name: train
    num_bytes: 37577
    num_examples: 10
  download_size: 27693
  dataset_size: 37577
configs:
- config_name: default
  data_files:
  - split: train
    path: data/train-*
tags:
- synthetic
- distilabel
- rlaif
- datacraft
---

<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 my-distiset

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


The pipeline script was uploaded to easily reproduce the dataset:
[app.py](https://huggingface.co/datasets/MavenGlider/my-distiset/raw/main/app.py).

It can be run directly using the CLI:

```console
distilabel pipeline run --script "https://huggingface.co/datasets/MavenGlider/my-distiset/raw/main/app.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/MavenGlider/my-distiset/raw/main/pipeline.yaml"
```

or explore the configuration:

```console
distilabel pipeline info --config "https://huggingface.co/datasets/MavenGlider/my-distiset/raw/main/pipeline.yaml"
```

## Dataset structure

The examples have the following structure per configuration:


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

```json
{
    "completion": "Integrating IoT oracles with a policy management system using Python involves several steps:\n\n### Step 1: Set up IoT Oracles\n\nFirst, you need to set up IoT oracles to collect data from various devices and sensors. You can use popular libraries like AWS IoT Core, Google Cloud IoT Core, or Azure IoT Hub to connect to your devices. For this example, we will use AWS IoT Core.\n\nExample using AWS IoT Core:\n```python\nimport boto3\n\n# Initialize AWS IoT Core client\niot_core = boto3.client(\u0027iot-data\u0027)\n\n# Set up IoT Core credentials\naws_access_key = \u0027YOUR_AWS_ACCESS_KEY\u0027\naws_secret_key = \u0027YOUR_AWS_SECRET_KEY\u0027\n\n# Set up IoT Core endpoint URL\nendpoint_url = \u0027YOUR_IOT_CORE_ENDPOINT_URL\u0027\n\n# Publish data to IoT Core topic\ndef publish_iot_data(device_id, data):\n    response = iot_core.publish(\n        endpointUrl=endpoint_url,\n        qos=1,\n        topic=device_id,\n        payload=data\n    )\n    print(response)\n\n# Example usage:\ndevice_id = \u0027MyDevice\u0027\ndata = b\u0027Hello, IoT Core!\u0027\npublish_iot_data(device_id, data)\n```\n\n### Step 2: Set up Digital Twin and IoT Oracles Connection\n\nNext, you need to set up a digital twin to connect to your IoT oracles. You can use a library like PyTwin or OpenFMB to create a digital twin.\n\nExample using PyTwin:\n```python\nfrom pytwin import DigitalTwin\n\n# Initialize digital twin\ndigital_twin = DigitalTwin(\u0027your_digital_twin\u0027)\n\n# Define IoT oracles connection\noracles = digital_twin.add_oracles(\u0027IoT Oracles\u0027)\n\n# Define IoT oracles configuration\noracles.add_config({\n    \u0027aws_iot_core\u0027: {\n        \u0027endpoint_url\u0027: \u0027YOUR_IOT_CORE_ENDPOINT_URL\u0027,\n        \u0027access_key\u0027: \u0027YOUR_AWS_ACCESS_KEY\u0027,\n       \u0027secret_key\u0027: \u0027YOUR_AWS_SECRET_KEY\u0027\n    }\n})\n\n# Example usage:\ndigital_twin.connect()\n```\n\n### Step 3: Integrate with Policy Management System\n\nNow, you need to integrate your IoT oracles with your policy management system. You can use a library like GitPython to interact with your Git repository.\n\nExample using GitPython:\n```python\nimport git\n\n# Initialize Git repository\nrepo = git.Repo(\u0027your_policy_repository\u0027)\n\n# Define policy management system configuration\npolicy_config = {\n    \u0027git_repository\u0027: \u0027your_policy_repository\u0027,\n    \u0027branch\u0027:\u0027main\u0027\n}\n\n# Load policy from Git repository\ndef load_policy(policy_id):\n    try:\n        policy = repo.gitcat_file(policy_id + \u0027.md\u0027)\n        return policy\n    except git.GetGitException:\n        return None\n\n# Example usage:\npolicy_id = \u0027your_policy_id\u0027\npolicy = load_policy(policy_id)\n```\n\n### Step 4: Use IFTTT to Trigger Policy Execution\n\nFinally, you can use IFTTT (If-This-Then-That) to trigger policy execution based on IoT data. You can use a library like pyifttt to connect to IFTTT.\n\nExample using pyifttt:\n```python\nimport pyifttt\n\n# Initialize IFTTT client\nifttt = pyifttt.IFTTT(\u0027your_ifttt_key\u0027)\n\n# Define IFTTT applet configuration\napplet_config = {\n    \u0027trigger\u0027: {\n        \u0027device_id\u0027: \u0027your_device_id\u0027,\n        \u0027event\u0027: \u0027data_received\u0027\n    },\n    \u0027action\u0027: {\n       \u0027service\u0027: \u0027your_policy_service\u0027,\n       \u0027method\u0027: \u0027execute_policy\u0027,\n        \u0027args\u0027: {\n            \u0027policy_id\u0027: \u0027your_policy_id\u0027\n        }\n    }\n}\n\n# Trigger IFTTT applet\ndef trigger_policy(policy_id):\n    ifttt.trigger_applet(applet_config)\n\n# Example usage:\ntrigger_policy(\u0027your_policy_id\u0027)\n```\n\n### Putting it all together\n\nHere is an example of how you can integrate IoT oracles with your policy management system using Python:\n```python\nimport boto3\nfrom pytwin import DigitalTwin\nimport git\nimport pyifttt\n\n# Initialize AWS IoT Core client\niot_core = boto3.client(\u0027iot-data\u0027)\n\n# Initialize digital twin\ndigital_twin = DigitalTwin(\u0027your_digital_twin\u0027)\n\n# Define IoT oracles connection\noracles = digital_twin.add_oracles(\u0027IoT Oracles\u0027)\n\n# Define IoT oracles configuration\noracles.add_config({\n    \u0027aws_iot_core\u0027: {\n        \u0027endpoint_url\u0027: \u0027YOUR_IOT_CORE_ENDPOINT_URL\u0027,\n        \u0027access_key\u0027: \u0027YOUR_AWS_ACCESS_KEY\u0027,\n       \u0027secret_key\u0027: \u0027YOUR_AWS_SECRET_KEY\u0027\n    }\n})\n\n# Initialize Git repository\nrepo = git.Repo(\u0027your_policy_repository\u0027)\n\n# Define policy management system configuration\npolicy_config = {\n    \u0027git_repository\u0027: \u0027your_policy_repository\u0027,\n    \u0027branch\u0027:\u0027main\u0027\n}\n\n# Define IFTTT client\nifttt =",
    "model_name": "meta-llama/Meta-Llama-3.1-8B-Instruct",
    "prompt": "How do I integrate IoT oracles with your policy management system using Python? \n\n"
}
```

This subset can be loaded as:

```python
from datasets import load_dataset

ds = load_dataset("MavenGlider/my-distiset", "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("MavenGlider/my-distiset")
```


</details>





## References


```
@misc{xu2024magpiealignmentdatasynthesis,
    title={Magpie: Alignment Data Synthesis from Scratch by Prompting Aligned LLMs with Nothing},
    author={Zhangchen Xu and Fengqing Jiang and Luyao Niu and Yuntian Deng and Radha Poovendran and Yejin Choi and Bill Yuchen Lin},
    year={2024},
    eprint={2406.08464},
    archivePrefix={arXiv},
    primaryClass={cs.CL},
    url={https://arxiv.org/abs/2406.08464},
}
```


