{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "b4b766d4",
   "metadata": {},
   "outputs": [],
   "source": [
    "import json"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "2c908825",
   "metadata": {},
   "outputs": [],
   "source": [
    "data_path = \"multi_turn_generation_output.json\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "f113063f",
   "metadata": {},
   "outputs": [],
   "source": [
    "with open(data_path, \"r\") as f:\n",
    "    data = json.load(f)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "id": "aaad52ca",
   "metadata": {},
   "outputs": [],
   "source": [
    "for d in data:\n",
    "    # check if \"conversational_narraive\" length is 9\n",
    "    if len(data[d][\"conversational_narrative\"]['history']) != 9:\n",
    "        print(\"Error: conversational_narrative length is not 9\")\n",
    "    \n",
    "    # check if key value is equal to \"conversational_narrative\"\n",
    "    if d != data[d][\"conversational_narrative\"]['history'][7]['dialogue']:\n",
    "        print(\"Error: key value is not equal to conversational_narrative[7]\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "52ce5ce9",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "chat_inject",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.10.18"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
