[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"detail-sidebar-cat-0-en-105":3,"doc-seo-760069-105":59,"doc-detail-760069-en":129,"doc-similar-760069":164},{"code":4,"msg":5,"data":6},0,"success",[7,13,18,23,28,33,38,43,48,51,55],{"id":8,"doc_module":4,"doc_module_name":9,"category_name":10,"show_sort_weight":11,"slug":12},1,"Document","Story & Novel",90,"story-novel",{"id":14,"doc_module":4,"doc_module_name":9,"category_name":15,"show_sort_weight":16,"slug":17},2,"Literature",80,"literature",{"id":19,"doc_module":4,"doc_module_name":9,"category_name":20,"show_sort_weight":21,"slug":22},4,"Exam",70,"exam",{"id":24,"doc_module":4,"doc_module_name":9,"category_name":25,"show_sort_weight":26,"slug":27},5,"Comic",60,"comic",{"id":29,"doc_module":4,"doc_module_name":9,"category_name":30,"show_sort_weight":31,"slug":32},6,"Technology",50,"technology",{"id":34,"doc_module":4,"doc_module_name":9,"category_name":35,"show_sort_weight":36,"slug":37},7,"Healthcare",40,"healthcare",{"id":39,"doc_module":4,"doc_module_name":9,"category_name":40,"show_sort_weight":41,"slug":42},8,"Research & Report",30,"research-report",{"id":44,"doc_module":4,"doc_module_name":9,"category_name":45,"show_sort_weight":46,"slug":47},9,"Religion & Spirituality",20,"religion-spirituality",{"id":46,"doc_module":4,"doc_module_name":9,"category_name":49,"show_sort_weight":46,"slug":50},"World Cup","world-cup",{"id":52,"doc_module":4,"doc_module_name":9,"category_name":53,"show_sort_weight":52,"slug":54},10,"Lifestyle","lifestyle",{"id":56,"doc_module":4,"doc_module_name":9,"category_name":57,"show_sort_weight":24,"slug":58},19,"General","general",{"code":4,"msg":60,"data":61},"ok",{"site_id":62,"language":63,"slug":64,"title":65,"keywords":66,"description":67,"schema_data":68,"social_meta":122,"head_meta":124,"extra_data":126,"updated_unix":128},105,"en","magic-storybook-with-chatgpt-build-and-run-an-ai-story-machine","Magic Storybook with ChatGPT - Build and Run an AI Story Machine","","Create a never-ending, touch-enabled storybook using a Raspberry Pi and a touchscreen display. The system speaks a prompt out loud, then uses OpenAI/ChatGPT to generate original stories in an endless format. Includes setup steps for the Raspberry Pi OS environment, required libraries, display backlight control, and prompt/key management via bookprompt.txt. Covers software structure, electronics assembly, book hardware assembly, decoration, usage workflows like running, navigation, sleep state, prompt changes, and troubleshooting.",{"@graph":69,"@context":121},[70,84,104],{"@type":71,"itemListElement":72},"BreadcrumbList",[73,77,79,82],{"item":74,"name":75,"@type":76,"position":8},"https://docshare.wps.com","Home","ListItem",{"item":78,"name":9,"@type":76,"position":14},"https://docshare.wps.com/document/",{"item":80,"name":30,"@type":76,"position":81},"https://docshare.wps.com/document/technology/",3,{"item":83,"name":65,"@type":76,"position":19},"https://docshare.wps.com/document/magic-storybook-with-chatgpt-build-and-run-an-ai-story-machine/760069/",{"url":83,"name":65,"@type":85,"image":86,"author":91,"headline":65,"publisher":94,"fileFormat":97,"inLanguage":63,"description":67,"dateModified":98,"datePublished":98,"encodingFormat":97,"isAccessibleForFree":99,"interactionStatistic":100},"DigitalDocument",{"url":87,"@type":88,"width":89,"height":90},"https://docshare.wps.com/thumbnails/magic-storybook-with-chatgpt-build-and-run-an-ai-story-machine/760069.png","ImageObject",300,407,{"name":92,"@type":93},"Terk","Person",{"url":74,"name":95,"@type":96},"DocShare","Organization","application/pdf","2026-11-28",true,{"@type":101,"interactionType":102,"userInteractionCount":8},"InteractionCounter",{"@type":103},"ViewAction",{"@type":105,"mainEntity":106},"FAQPage",[107,113,117],{"name":108,"@type":109,"acceptedAnswer":110},"What does the Magic Storybook do when you speak a request?","Question",{"text":111,"@type":112},"It accepts a spoken prompt and uses OpenAI/ChatGPT to generate an original, never-ending story based on your request.","Answer",{"name":114,"@type":109,"acceptedAnswer":115},"What is bookprompt.txt used for?",{"text":116,"@type":112},"It is an editable prompt file that lets you dictate character names, story length, writing style, and other parameters.",{"name":118,"@type":109,"acceptedAnswer":119},"Which Raspberry Pi and display components are required?",{"text":120,"@type":112},"The guide uses a Raspberry Pi (shown as Raspberry Pi 4 Model B) paired with a 7-inch touchscreen display for Raspberry Pi.","https://schema.org",{"og:url":83,"og:type":123,"og:title":65,"og:site_name":95,"og:description":67},"article",{"robots":125,"canonical":83},"index,follow",{"doc_id":127,"site_id":62},760069,1795898384,{"code":4,"msg":5,"data":130},{"doc_id":127,"user_id":131,"nickname":92,"user_avatar":132,"doc_module":4,"category_id":29,"category_name":30,"doc_title":65,"doc_description":67,"doc_content":133,"file_id":134,"file_url":135,"file_type":136,"file_size":137,"view_count":8,"is_deleted":4,"is_public":8,"is_downloadable":8,"audit_status":8,"page_count":31,"language":138,"language_code":63,"site_id":62,"html_lang":63,"table_of_contents":139,"faqs":140,"seo_title":141,"seo_description":67,"update_tm":128,"read_time":142,"preview_page_count":24,"preview_urls":143},1099525198933,"https://ap-avatar.wpscdn.com/davatar_155a257f0dc6eb9ab79c44ca47cae57d","Magic Storybook with ChatGPT  \nCreated by Erin St Blaine  \n[https://learn.adafruit.com/magic-storybook-with-chatgpt](https://learn.adafruit.com/magic-storybook-with-chatgpt)  \nLast updated on 2025-03-04 03:52:01 PM EST  \n©Adafruit Industries Page 1 of 50  \nTable of Contents  \nOverview 3  \n\n| • Parts\u003Cbr>Wiring Diagram | 6 |\n| --- | --- |\n| Create an Account with OpenAI | 7 |\n| Software Setup | 9 |\n| • Install Raspberry Pi OS 64-bit Desktop\u003Cbr>• Setup Virtual Environment\u003Cbr>• Blinka Installation\u003Cbr>• Install OpenAI Library\u003Cbr>• Additional Required Dependencies\u003Cbr>• Enable Backlight Control\u003Cbr>• Download the Files\u003Cbr>• Move Prompt and Key Files\u003Cbr>• Add Your OpenAI Key\u003Cbr>• Update ALSA Config\u003Cbr>• Create Desktop and Autostart Shortcuts\u003Cbr>• Optional: Making the File System Read-only\u003Cbr>Code Overview | 15 |\n| • Story Code\u003Cbr>• Configuration Options\u003Cbr>• External Config Files\u003Cbr>• UI Element Classes\u003Cbr>• The Book Class\u003Cbr>• Parse Arguments\u003Cbr>• Main\u003Cbr>• Listener Code\u003Cbr>Electronics Assembly | 30 |\n| Book Assembly | 34 |\n| Decoration | 39 |\n| Usage | 43 |\n\n• Running the Code  \n• Creating a New Story  \n• Navigation  \n• Putting the Book in a Sleep State  \n• Exiting the Script  \n• Changing the Prompt: bookprompt.txt  \n• Troubleshooting  \n©Adafruit Industries Page 2 of 50  \nOverview  \n‘I wonder,’ he said to himself, ‘what’s in a book while it’s closed. Oh, I know it’s full of letters printed on paper, but all the same, something must be happening, because as soon as I open it, there’s a whole story with people I don’t know yet and all kinds of adventures, deeds and battles. And  \nsometimes there are storms at sea, or it takes you to strange cities and  \ncountries. All those things are somehow shut in a book. Of course you have to read it to find out. But it’s already there, that’s the funny thing. I just wish I knew how it could be.’  \nBastian, the Neverending Story  \nWe live in an age of wonder. Every day, new innovations and inventions change the way we interact with the world around us and with each other. Many of the marvels we read about in the science fiction stories of our youth are suddenly, magically possible with a little clever engineering and a healthy dose of imagination.  \nThis guide will show you how to create your own never-ending story book using a Raspberry Pi and a touch screen display. Speak your request out loud, and the book will write you an original story based on your prompt. The software uses Open AI to leverage ChatGPT, a language-based AI, to fill an endless storybook with imaginative stories.  \nThis code includes an editable prompt file called bookprompt.txt , so you can dictate the character names, story length, writing style, or any other parameters you'd like. Your daughter will love reading stories about herself and her cat as they adventure through an endless world of imagination, in the style of Dr. Seuss!  \nWhat will you imagine?  \n©Adafruit Industries Page 3 of 50  \nParts  \nPi Foundation Display-7\" Touchscreen Display for Raspberry Pi  \nThe 7” Touchscreen Display for Raspberry Pi gives users the ability to create all-inone, integrated projects such as tablets, infotainment systems and embedded...  \n[https://www.adafruit.com/product/2718](https://www.adafruit.com/product/2718)  \n[Raspberry Pi 4 Model B-8 GB RAM](Raspberry Pi 4 Model B-8 GB RAM)  \nThe Raspberry Pi 4 Model B is the newest Raspberry Pi computer made, and the Pi Foundation knows you can always make a good thing better! And what could make the Pi 4 better   \n[https://www.adafruit.com/product/4564](https://www.adafruit.com/product/4564)  \n©Adafruit Industries Page 4 of 50  \n1 x Heat Shrink Heat Shrink Pack  \nMini USB Microphone  \nHey, listen up! It's the world's smallest USB microphone! OK maybe it's not in the Guinness Record Book, but it is pretty darn small! This plug-and-play...  \n[https://www.adafruit.com/product/3367](https://www.adafruit.com/product/3367)  \nMagnetic contact switch (door sensor)  \nThis sensor is essentially a reed sw","cbCaiuP2Sbjyfy0U","https://ap.wps.com/l/cbCaiuP2Sbjyfy0U","pdf",7053808,"English","# Overview\n## Parts\n## Software Setup\n## Code Overview\n## Electronics Assembly\n## Book Assembly\n## Decoration\n## Usage","[{\"question\":\"What does the Magic Storybook do when you speak a request?\",\"answer\":\"It accepts a spoken prompt and uses OpenAI/ChatGPT to generate an original, never-ending story based on your request.\"},{\"question\":\"What is bookprompt.txt used for?\",\"answer\":\"It is an editable prompt file that lets you dictate character names, story length, writing style, and other parameters.\"},{\"question\":\"Which Raspberry Pi and display components are required?\",\"answer\":\"The guide uses a Raspberry Pi (shown as Raspberry Pi 4 Model B) paired with a 7-inch touchscreen display for Raspberry Pi.\"}]","Magic Storybook with ChatGPT - Build and Run an AI Story Machine | PDF",126,[144,148,152,156,160],{"page_no":8,"url":145,"width":146,"height":147},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-28/e7fad0d3cb7ad0f1e7586656c1103871.webp",983,1390,{"page_no":14,"url":149,"width":150,"height":151},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-28/8b3219f89d8370649394a1c82063d66b.webp",982,1388,{"page_no":81,"url":153,"width":154,"height":155},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-28/900083b2c499e635fef96a005735eead.webp",981,1387,{"page_no":19,"url":157,"width":158,"height":159},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-28/eb0a4a309c47641a1aabdef6d7842cef.webp",980,1385,{"page_no":24,"url":161,"width":162,"height":163},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-28/a112c3cc63a2c3b0dbb298d29c861927.webp",979,1384,{"list":165,"token":66},[166,173,179,186,193,199,205,211,217,223],{"doc_id":167,"doc_title":168,"file_type":136,"home_preview_img_url":169,"slug":170,"view_count":171,"category_name":30,"create_tm":172},43021,"Hacking Electronics Learning Electronics with Arduino and Raspberry Pi","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229796207513/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796234699&Signature=vEGAbXmuhL2s5AUNRwsC02BHp3c%3D","hacking-electronics-learning-electronics-with-arduino-and-raspberry-pi",28,1783376076,{"doc_id":174,"doc_title":175,"file_type":136,"home_preview_img_url":176,"slug":177,"view_count":19,"category_name":30,"create_tm":178},697902,"Cupcade - the Raspberry Pi Micro Arcade Cabinet","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230010126672/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796234699&Signature=cqOMP%2BYu38E7zb9m5B82LzpN7%2FY%3D","cupcade-the-raspberry-pi-micro-arcade-cabinet",1794445693,{"doc_id":180,"doc_title":181,"file_type":136,"home_preview_img_url":182,"slug":183,"view_count":184,"category_name":30,"create_tm":185},23029,"Raspberry Pi Official Magazine Issue 163 March 2026","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229716042395/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796234699&Signature=AuHbMxSBEdYBBNFTYzZ2EaZSqEU%3D","raspberry-pi-official-magazine-issue-163-march-2026",62,1777634668,{"doc_id":187,"doc_title":188,"file_type":136,"home_preview_img_url":189,"slug":190,"view_count":191,"category_name":30,"create_tm":192},513359,"Practical Raspberry Pi Projects - Get Hands-on With Your Raspberry Pi - Build Incredible Gadgets","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229936597198/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796234699&Signature=n%2FH0u0hXwdB2z2CtqREVi66v65c%3D","practical-raspberry-pi-projects-get-hands-on-with-your-raspberry-pi-build-incredible-gadgets",13,1791283702,{"doc_id":194,"doc_title":195,"file_type":136,"home_preview_img_url":196,"slug":197,"view_count":34,"category_name":30,"create_tm":198},692443,"OpenClaw on Raspberry Pi","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230003321860/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796234699&Signature=ZIztsJdp%2BrjYuPxcT%2BDZRzgN6YM%3D","openclaw-on-raspberry-pi",1794208487,{"doc_id":200,"doc_title":201,"file_type":136,"home_preview_img_url":202,"slug":203,"view_count":19,"category_name":30,"create_tm":204},700556,"Raspberry Pi Compute Module 4 - datasheet","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230011567751/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796234699&Signature=E0aWJRjTsnlsKEqSx96XGk7WjUA%3D","raspberry-pi-compute-module-4-datasheet",1794519324,{"doc_id":206,"doc_title":207,"file_type":136,"home_preview_img_url":208,"slug":209,"view_count":29,"category_name":30,"create_tm":210},662787,"Mechanical Components Assembly - Raspberry Pi Touch Screen Case","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229981690258/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796234699&Signature=pYChu7i8W%2BwwF%2FNyD7Doougl3Mo%3D","mechanical-components-assembly-raspberry-pi-touch-screen-case",1793222470,{"doc_id":212,"doc_title":213,"file_type":136,"home_preview_img_url":214,"slug":215,"view_count":19,"category_name":30,"create_tm":216},720514,"BNO055 Absolute Orientation Sensor with Raspberry Pi & BeagleBone Black","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230024397699/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796234699&Signature=GA1PsZNNp%2BieWnM7mmCoPHp1%2BEE%3D","bno055-absolute-orientation-sensor-with-raspberry-pi-beaglebone-black",1795037667,{"doc_id":218,"doc_title":219,"file_type":136,"home_preview_img_url":220,"slug":221,"view_count":81,"category_name":30,"create_tm":222},700484,"Arduino GIGA Display Shield - Product Reference Manual","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230012027075/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796234699&Signature=7UPtKUIiu2%2FExkHKlB9AxO8ukUE%3D","arduino-giga-display-shield-product-reference-manual",1794519026,{"doc_id":224,"doc_title":225,"file_type":136,"home_preview_img_url":226,"slug":227,"view_count":81,"category_name":30,"create_tm":228},691566,"Raspberry Pi Compute Module 5 - System on Module Hardware Overview - Specifications","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230002679503/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796234699&Signature=OxahD3EB4SkZ7JwEAU47BMT7Lug%3D","raspberry-pi-compute-module-5-system-on-module-hardware-overview-specifications",1794175100]