1"use strict";(self.webpackChunkshortgpt_documentation=self.webpackChunkshortgpt_documentation||[]).push([[538],{3905:(e,t,n)=>{n.d(t,{Zo:()=>u,kt:()=>h});var o=n(7294);function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a(Object(n),!0).forEach((function(t){r(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function s(e,t){if(null==e)return{};var n,o,r=function(e,t){if(null==e)return{};var n,o,r={},a=Object.keys(e);for(o=0;o<a.length;o++)n=a[o],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)n=a[o],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var l=o.createContext({}),c=function(e){var t=o.useContext(l),n=t;return e&&(n="function"==typeof e?e(t):i(i({},t),e)),n},u=function(e){var t=c(e.components);return o.createElement(l.Provider,{value:t},e.children)},p="mdxType",d={inlineCode:"code",wrapper:function(e){var t=e.children;return o.createElement(o.Fragment,{},t)}},m=o.forwardRef((function(e,t){var n=e.components,r=e.mdxType,a=e.originalType,l=e.parentName,u=s(e,["components","mdxType","originalType","parentName"]),p=c(n),m=r,h=p["".concat(l,".").concat(m)]||p[m]||d[m]||a;return n?o.createElement(h,i(i({ref:t},u),{},{components:n})):o.createElement(h,i({ref:t},u))}));function h(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var a=n.length,i=new Array(a);i[0]=m;var s={};for(var l in t)hasOwnProperty.call(t,l)&&(s[l]=t[l]);s.originalType=e,s[p]="string"==typeof e?e:r,i[1]=s;for(var c=2;c<a;c++)i[c]=n[c];return o.createElement.apply(null,i)}return o.createElement.apply(null,n)}m.displayName="MDXCreateElement"},2418:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>l,contentTitle:()=>i,default:()=>d,frontMatter:()=>a,metadata:()=>s,toc:()=>c});var o=n(7462),r=(n(7294),n(3905));const a={title:"ShortGPT Hello World Example",sidebar_label:"ShortGPT Hello World Example"},i="ShortGPT Hello World Example",s={unversionedId:"getting-started",id:"getting-started",title:"ShortGPT Hello World Example",description:'This guide provides a basic example of how to use the shortGPT framework. ShortGPT encapsulates the entire process of content automation into content engines. In this example, we\'ll show you how to instantiate the FactsShortEngine, which will automate the production of the "Interesting Facts" niche of Shorts.',source:"@site/docs/getting-started.mdx",sourceDirName:".",slug:"/getting-started",permalink:"/docs/getting-started",draft:!1,editUrl:"https://github.com/RayVentura/ShortGPT/edit/stable/docs/docs/getting-started.mdx",tags:[],version:"current",lastUpdatedBy:"RayV",lastUpdatedAt:1736759328,formattedLastUpdatedAt:"Jan 13, 2025",frontMatter:{title:"ShortGPT Hello World Example",sidebar_label:"ShortGPT Hello World Example"},sidebar:"docs",previous:{title:"Installation Guide",permalink:"/docs/how-to-install"},next:{title:"ContentVideoEngine",permalink:"/docs/content-video-engine"}},l={},c=[{value:"Prerequisites",id:"prerequisites",level:2},{value:"Code",id:"code",level:2}],u={toc:c},p="wrapper";function d(e){let{components:t,...n}=e;return(0,r.kt)(p,(0,o.Z)({},u,n,{components:t,mdxType:"MDXLayout"}),(0,r.kt)("h1",{id:"shortgpt-hello-world-example"},"ShortGPT Hello World Example"),(0,r.kt)("p",null,"This guide provides a basic example of how to use the shortGPT framework. ShortGPT encapsulates the entire process of content automation into ",(0,r.kt)("inlineCode",{parentName:"p"},"content engines"),'. In this example, we\'ll show you how to instantiate the FactsShortEngine, which will automate the production of the "Interesting Facts" niche of Shorts.'),(0,r.kt)("h2",{id:"prerequisites"},"Prerequisites"),(0,r.kt)("p",null,"Before you start, make sure you have ",(0,r.kt)("a",{parentName:"p",href:"./how-to-install"},"followed the installation steps")," and have your API keys ready."),(0,r.kt)("h2",{id:"code"},"Code"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-python"},'from shortGPT.config.api_db import ApiKeyManager, ApiProvider\nfrom shortGPT.config.asset_db import AssetDatabase, AssetType\nfrom shortGPT.engine.facts_short_engine import FactsShortEngine\nfrom shortGPT.audio.eleven_voice_module import ElevenLabsVoiceModule\nfrom shortGPT.config.languages import Language\nfrom shortGPT.audio.edge_voice_module import EdgeTTSVoiceModule, EDGE_TTS_VOICENAME_MAPPING\n\n# Set API Keys\nApiKeyManager.set_api_key(ApiProvider.OPENAI, "your_openai_key")\nApiKeyManager.set_api_key(ApiProvider.ELEVEN_LABS, "your_eleven_labs_key")\n\n# Add Assets\nAssetDatabase.add_remote_asset("minecraft background cube", AssetType.BACKGROUND_VIDEO, "https://www.youtube.com/watch?v=Pt5_GSKIWQM")\nAssetDatabase.add_remote_asset(\'chill music\', AssetType.BACKGROUND_MUSIC, "https://www.youtube.com/watch?v=uUu1NcSHg2E")\nAssetDatabase.add_local_asset(\'my_music\', AssetType.AUDIO, "./my_music.wav")\n\nUSE_ELEVEN_LABS = False\n# Configure the ElevenLabs Voice Module\nif USE_ELEVEN_LABS:\n eleven_labs_key = ApiKeyManager.get_api_key(ApiProvider.ELEVEN_LABS)\n voice_module = ElevenLabsVoiceModule(api_key = eleven_labs_key, voiceName="Chris")\nelse:\n ## You can also use the EdgeTTS for Free voice synthesis\n voice_name = EDGE_TTS_VOICENAME_MAPPING[Language.GERMAN][\'male\']\n voice_module = EdgeTTSVoiceModule(voice_name)\n\n# Configure Content Engine\nfacts_video_topic = "Interesting scientific facts from the 19th century"\ncontent_engine = FactsShortEngine(voiceModule=voice_module,\n facts_type=facts_video_topic,\n background_video_name="minecraft background cube", # <--- use the same name you saved in the AssetDatabase\n background_music_name=\'chill music\', # <--- use the same name you saved in the AssetDatabase\n num_images=5, # If you don\'t want images in your video, put 0 or None\n language=Language.GERMAN)\n\n# Generate Content\nfor step_
1num, step_logs in content_engine.makeContent():\n print(f" {step_logs}")\n\n# Get Video Output Path\nprint(content_engine.get_video_output_path())\n')),(0,r.kt)("p",null,"That's it! You have now successfully generated your first content using the shortGPT framework."))}d.isMDXComponent=!0}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.