Creating An AI Assistant GUI App Using OpenAI API And Python: A Comprehensive Tutorial

  • Post comments:6 Comments



In this video, we will learn how to build an AI assistant (aka ChatGPT) desktop application with OpenAI API and PyQt6 in Python. This is a project you can added to your portfolio to demonstrate your proficient in Python and use of APIs.

OpenAI API is a cloud-based service provided by OpenAI that allows developers to integrate state-of-the-art artificial intelligence models into their applications without the need for extensive machine learning expertise or resources. The API provides access to a wide range of language-based AI models, including language translation, text summarization, text completion, sentiment analysis, and question-answering.

📑 Download source code here ($8 donation is required): https://www.buymeacoffee.com/jiejenn/e/124604 (This is replaced with ChatGPT Desktop App)

📺 Sign up for OpenAI API Account: https://openai.com/api/

📺 Getting Started With OpenAI API In Python For Beginners: https://youtu.be/RK6XJtFoHV4

📋 Download pyinstaller_template.spec file: https://drive.google.com/file/d/1iHirCJAr-0sCFqMAv-sut2E4H-z_VlLn/view?usp=sharing

📑 Download the Source Code ($5 For the time I spent typing the code): https://www.buymeacoffee.com/jiejenn/e/119509

► Buy Me a Coffee? Your support is much appreciated!
——————————————————————————————-
☕ Paypal: https://www.paypal.me/jiejenn/5
☕ Venmo: @Jie-Jenn
💸 Join Robinhood with my link and we’ll both get a free stock: https://bit.ly/3iWr7LC

► Support my channel so I can continue making free contents
—————————————————————————————————————
🛒 By shopping on Amazon → https://amzn.to/2JkGeMD
👩‍💻 Follow me on Linked: https://www.linkedin.com/in/jiejenn/
🌳 Becoming a Patreon supporter: https://www.patreon.com/JieJenn
✉️ Business Inquiring: YouTube@LearnDataAnalysis.org

00:00 – Intro
01:03 – Prerequisites
01:22 – Agenda
02:33 – Generate OpenAi API key
03:11 – Create a Python virtual environment
04:55 – Install Python packages
05:19 – Create project files
06:02 – password_manage.ini file
06:30 – App demo
08:00 – openai_playground.py (openai module development)
10:52 – app.py (app development)
44:30 – Package the app with pyinstaller

#gpt #python #pythonprogramming #openai #chatgpt #desktopapp
hey how soon guys in this video we’ll learn how to build an AI assistance desktop application using open AI API in Python if you are new to open AI or open AI API open AI is an AIR research company founded in 2015 focused on developing user-friendly air engines some of the popular products like chat gbt or daoi are created by openai I have a tutorial on how to get started with open air API in more detail which you can find the link in the description below now in terms of building the AI assistant desktop application I’ll be using gvt 3.0 DaVinci model which is the latest capable Air Model available from the API just an FYI chat GPT is based on gbt 3.5 which will be released hopefully soon and for the GUI framework I’ll be using pi qd6 which is a popular degree framework used by many companies and professionals now before dive into the tutorial let’s review the practices and the agenda first now in terms of the practices you’ll need to have basic foundations of Python Programming such as knowing how to work a race dictionaries Loops if statements Etc some knowledge working with classes will be extremely helpful you also need to know how to install python packages and that’s all the requirements now let’s cover the agenda so I divide the tutorial into four parts in part one we’ll generally open AI API key from open ai’s website to get access to open AI API service if you don’t have an account go to openai.com API to sign for an account and it’s free as a new user you get 18 000 credit to use just to keep in mind that the credit will expire after three months in part two we’ll create a python virtual environment dedicated to departure a python filter environment is an isolated environment for python installations which allows you to install packages and dependencies for a specific project or affecting other projects this can be particularly useful when you have multiple projects with different requirements or if you need to test your code against different versions of python packages in part 3 we’ll be building the application we’ll first install open AI python package in other dependencies they will create the open ai ai assistance application in Python and Powerful is going to be packaging the application so it can be distributed using a command line tool called Pi installer with that being said let’s dive into the tutorial now to generate API key open your browser and navigate to openair.com API then log into account click on your username then click on view API keys right so here I’m going to click on create new SQL key to generate a new set of API key I’m going to leave this window open because I need to copy the key to my client secret manager file which I haven’t created yet in here for security reason you won’t be able to view the API key again to your open AI account now let’s create a python virtual environment dedicated to this project now finally want to also python project in launcher terminal and I’m using Bash right so let me make the window a bit bigger Now to create a python virtual environment want to run the commit python VMV followed by the project name for the projecting I’m going to name the project open air underscore AI underscore the system from the school app enter now going back to my directory let me open the project folder now we need to activate the environment and to do that so here in the scripts folder we need to run this activate file and since I’m using bash I need to insert a source statement followed by the file path and it’s going to be scripts slash activate and you have got to change the directory to my project folder right so let me do that first and it’s going to be open AI assistance app and we see here we go I sanded a typo before now if I run the command source scripts slash activate and I’ll activate the open AI assistance app environment if you’re using Power Shot then you can run the file directly now let’s install the python packages to build the app so there are three python packages I’m going to install to build the application open AI pi qd6 and Pi installer and to install all the package all together I’m going to run the commit pen install open AI pi qd6 and Pi installer enter and once I install the python packages I’m going to create three files so he might know I’m going to type touch the first file is going to be the password manager or the client secret manager and I’ll name the file password manager dot ini the second file is going to be the application file and I’ll name the file app.pi and the last file is going to be a module that we’re going to create to connect to open AI API service not only in the file open AI playground top high enter all right so going back to my project folder so here are the three files that I just created now let me open the password manager file so this file is going to be used to manage my API key so my client Secret inside the file I’m going to create a section called open AI now create a variable called API key now here I’ll go back to open ai’s website and I’ll grab the API key and I’ll send the key to the API key variable save the file and close now I can close the browser now before we dive into the development I want to give you a quick demo of the application that we’ll be building in this tutorial so here’s the application from the interface will be able to adjust the Maximo token that the API will be able to consume as well as the temperature value in the presence penalty so these are the three parameters that while providing in this application that will be able to adjust then we have the prompt text and the output text and since gbt is a language model we can ask any question basically second ask what can you do with gbt API and I can click on submit and it’s going to make a API request to the API engine then it’s going to return the response and he’ll have the status bar to choose how much token that we have consumed uh using this API call we can also create multiple tabs in case you want to have multiple conversations in case of want to save the composition of the output we’ll be creating this file menu to help design save output option to save the composition as a text file alright so I’m going to put this on the side let me launch my co-editor I’ll be using Facebook to create this application all right so I’m going to open the open AI playground.pi file first to create the open UI module now hear me activate the environment first so the environment is going to be open AI assistant app inside the file I’m going to import the open air module and increase the font size then I’m going to create a class called open air playground right so if we look at the Constructor so basically what providing an API key when we create the open AI playground object then while creating object called self.open AI to reference to the open air module they will need to attach the API key and we delete this line here since we don’t need it and to make the API code I’m going to create my vehicle send prompt requests and this function takes one required parameter called prompt which is going to be the input followed by three option parameters temperature max tokens aim presence penalty and for the output size I’m going to high quote the output size to 1 since uh for each composition we can only have one output at a time let’s look at the code block that creates the same prompt request method and here let me change the Embry to 1. so when we make an API code to the open AI service we’ll be referencing the open air module the completion.create inside the create method we need to provide the mod ID in this case we’re going to be using the DaVinci 3.0 model the one providing the prompt text temperature value Max tokens and presence penalty and for the output we’re going to store the output in this result dictionary inside the district we have a SIM slide ID when the API code was made the model ID completion token use pump tokens total tokens and here’s the outputs right so for the output I’m going to change this to a reference the first element because the output is going to only be one item at a time dot text in Samsung for the stylus and this would be finish recent then from the function we will send the result option or the result dictionary plus the output and just in case if we run into any exception then we’re going to use the exception block to capture any error and it’s going to be everything we need to write to create the open AirPlay girl module now save the file and open the app.pi file the app.pi file is going to build the application interface some of the features we’ll be implementing such as being able to set the output to a text file being able to come through different parameters and menu bars and create multiple compositions Etc and since there are many moving pieces I’ll try my best to explain in the most logical order as possible and for the application logo I’ll be using open ai’s Logo just for demonstration purpose all right so going back to the app.pi file I’m going to import the libraries first so there actually quite a few libraries that I’ll be using to build this application let me hide the panel so for this app I’m going to import the system module and to create the temp stem from daytime I’m going to import the daytime class and to load the API key from the config parser module I’m going to import the config passer class and just add the widgets I’ll be using to create the interface followed by some other Pi qd6 classes that I’ll be using and which I’ll go to uh each one one by one lay down once I start doing the development and finally found the open AI playground module I’m going to import the open AI playground class now to construct the application main window I’ll create a classical app window and I’ll pass the QR as the parent class enemy Center phone size a little bit smaller so this app window is going to be the main application interface in Q which is basically just a window itself so hear me into my main routine so him saying that if this is going to be the python file that I’m going to execute to run the application then we’re going to run this code block here so this code block is going to load the open AI API key then you to construct the care application instance and I’ll name the outputs app so basically uh this line here is going to keep the application running in the background and to create the application window so here we need to create an object of the app window class and I name the option app window and to display the application so you need to use the Dasher method and when we close the window we need to make sure that we terminate the process using the system.xm method and we’ll provide the application the execution instance all right so if I go in the launch the application by pressing F5 when I have a blank window that we can freely insert any widgets to create the interface right so let me close the window all right so let’s go back to the app window class now I’ll set the windows property so these two lines here is going to set the minimum window size and for the Windows size I’m going to set the width to 700 and for the Heights I’m going to set that to 500. then we’re going to set the windows icon and the sell window title method is going to create the windows title on the top so in PIQ D6 we can actually apply CSS style sheets to make the interface a little bit more elegant and to keep things simple I’m going to change the font size to 15 and that’s it now to keep the widgets organized I’m going to create additional code self-doubt layout right so here I’m getting an error uh I send you a couple uh empty spaces somewhere right so let me fix that all right so basically what I did was I simply replaced the four spaces for the tab in that Sims 2 solve the inconsistent indentation issue so for the main layout I’m going to use QV box layout stands for a vertical box layout so basically I’m using this layout manager I can organize or align the widgets vertically and here I’m storing the layout manager inside this setup layout dictionary and now name the kios mean they can set the application layer using the set layout method providing the layout object that I want to use all right so let me take a look what I’m missing right so the first item I want to create is the time manager which are these tabs right here all right so going back to the app so on the top I’m going to create a classical tag manager and I’ll pass q-tab widget as the parent class so what I’m doing here is I’m actually creating my own customized tab manager widget synthesis is a template to create your own temperature template now for this tag manager class I want to create a customized signal and I’ll name the signal plus click so in pi QT framework we can actually create different signals using the piquely signal class then I’ll create my Constructor now if we look at the code that creates the Constructor for the time manager class so this line here is going to enable the open filter which allows us to capture any signal that comes to this tab manager class aim by default the close button is not enabled so as you need to manually enable the close button using the set tabs closable method it will set the value to 2. and same thing with the help me go to the right and same thing with this add tab button so the button is actually created mainly in the 10 manager class and unfortunately qtab manager doesn’t have a default interface to add a tab now if we look at these two lines so these two lines are how I create the add tab button so here I’m creating a Q2 button to create the plus button right here and for the display the text I’m going to use the plus symbol and I’ll name the button so that add tab button and to make the signal a little bit more descriptive instead of Click I want to swap the single name by using the dot connect method it will basically code the plus click signal and when we click on the close button we can reference the tab close request signal and we’ll call the closed type method to close the active tab now here let me create the closed tab method and this method is assigned to the tab close request signal so right here now if we look at this code block so basically when this type close request signal is file it’s going to pass the tab index where the close button is being clicked and the tab index is going to get passed to this tab index argument and to make sure that we have at least one tab open here I’m installing if statement if the type count is equals to one they will basically X Out the method otherwise I’m going to close the tab using the remove tab method and now pass the tab index all right so here why insert the add tab button the button is actually located in your stationary location and we need to create a method to dynamically position the button position or location and to do that so here we can use the event filter so when you enable the event filter in this case I’m enabling the event filter for the tab bar which is going to be each individual tab right here and we enable the event filter this FM filter method is going to capture any signals that triggered the tab bar basically and the cineworld contains uh two items the virtual source and the event type now if we look at this code block right here so basically I’m saying that if the widget type is a tab bar and the event type is a resize event they want to retrieve the active tab bars geometry such as the heights with top location and level location and so on but in this case I’m simply only interested in the height so I’m going to store the high value into this H variable then can set the add tab button size using the set fixed size method and this adjustable formula that I came up with to set the color height and this method here is going to directly move the add tab button at the end then we need to return the event filter state so there’s going to be everything we need to write to create the tab manager class now let’s add the tab manager to the application interface all right so here I’m going to go back to the app window class so usually one building by QD applications I like to create a separate method to insert the widgets individually all right so here I’m going to create mythical init UI and I’m going to cut a method inside the Constructor now if we look at the innate UI method so basically I’m creating an instance of the tag manager object and I’ve named the object self.tag manager then add the tab major region to the main layout now if I launch the application so from the main window so this white area is going to be the tag manager widget now what is missing is the interface so you can think of this app window and a tab manager as his own template Now to create the interface for the personal AI assistance so here I’m going to create another class called personal assistance it should let me name these two AI assistance now inside the Constructor I’m going to create an instance of the open air playground option and I’ll pass the API key so you can sync this AI system class with another window except for this window we have another server interface that we embedded to this window so essentially you are basically embedding this uh AI system window on the Queue tag manager widget inside this window I’m going to create another layer object to organize the widgets now to insert the controls I’m going to create the Instagram method that is specifically just for this AI system window now I’m going to look at the application again now to organize the labels in the sliders I’ll be using the coupon layout manager in the name delay object as inputs ascended to this self-doubt layout dictionary and from the main layout we can actually add another layout using the add layer method in our supply the input layout and here I need to code the inner UI method to insert the widgets alright so let’s do this I’m going to create the AI assistance UI from the app window in the UI method so here I’m going to reference the tag manager object and I add a new tab using the add time method the first parameter is going to be asking for the widget that we’re going to embed it to the tab in this case we want to embedded the AI assistance window and the second parameter is going to be the tab label now for the label I’m going to name this as composition followed by the type ID so to check the tab ID I’m going to go back to the Constructor and here I’m going to create attribute called tab index checker Now set a default value of one right so ah this is annoying right so help me do this I’m going to fix the indentation issue first all right so what I can do here is I can maybe uh tap out and tap in and this one too and that seems to solve the issue right so going back to the inner um method all right so for the tab label I’m going to type conversation number and here I want to insert the tab index the format tab index checker right so if I go in the run the script to launch the app we now have the tag manager with the AI assistance window which is blank right now since we haven’t inserted anything and the add tab button is now working because we haven’t implement the method yet to send to this button all right so going back to the AI assistance window now inside the Instagram method I want to insert the text boxes the self.com object is going to be the input text box and it’s going to be the response text box and here I’m inserting the three sliders one for the max tokens one for the temperature and one for the presence penalty all right so let’s look at how we create the slider widget so when you insert a slider the sliders orientation is going to be uh vertical now want to change the orientation to horizontal so here I need to reference the QD class the orientation then I’ll provide the horizontal’s constant value and here’s the slightest range instance for The gbt3 DaVinci model the maximum token the API will be able to use is 4000 so he was sending the maximum to 4000. and single step is going to be the distance the the slider is going to travel when you press the left or right arrow key on your keyboard and Page step is going to be the distance when you use your mouse click and that is going to be the default value when you launch the slider now for temperature and presence penalty and since the slider widget does not support a decimal point so here I’m using a range between 0 and 200 and I’m going to divide the value by 102 convert the slightest value into two decimal point between 0 and 2. instancing for presence penalty slider and here are the two buttons submit and reset right so if we look at how we create the push buttons the first parent is going to be the label followed by the method I want to run when click on the push button and you need to reference The Click signal to trigger the button click event now for these two methods I haven’t created the submit method and the reset Fields May forgets which I’ll create that uh in a second and the last video I want to create is the status bar now to organize the switches I’m going to insert a bunch of layout managers so here let’s go to each layer one by one right so because I found the Q form layout you can only insert two widgets one the left and one the right if we look at the max token row so here the max token label is One widget followed by the value label which is another widget then we have the slider which is another widget and to fit three ridges in the same row I basically create another horizontal bus layout option and I name the layers slider layout inside the slider layer I’m going to insert the max token label and which is going to be uh this label right here then I’m going to insert the slider now when we construct the row I’m going to insert the main label first followed by the slider layout option in Simpson for the temperature slider as well as for the presence penalty slider now to insert the prompt and response text boxes so here I’m installing the label followed by The Prompt text box to the input layout object Samsung for the output or response on a text box and to make sure that all the labels are aligned correctly so I’m sending the text alignment to the right then we’re going to organize the buttons so here I’m creating a separate layer manager to organize the push buttons and I want to organize the buttons horizontally so here I’m creating a qh box layer Archer and I add the buttons layout option to the main layout then I’m going to insert those two buttons to the buttons layout object and finally I’m going to insert the status bar at the end of the window which is right here so if I click on submit a button and because I don’t have any uh textile provided so here the start spot is going to display a text prompt is empty and this is basically your error message all right so let me go back to the top right so if I launch the application let’s take a look all right so let’s see no attribute uh cement okay now let’s go ahead and create these two methods button submit method and the button is semi-fit now for the method I’m going to assign to the reset button it’s going to be this reset Fields method so basically when clicking on the reset button I simply just want to clear the text boxes in the status bar all right so here I’m going to assign this method to the reset push button and it’s going to be right here and for the submit method I’m going to create a mythical submit now if we look at the submit method so this line here is going to retrieve the text from The Prompt text box down to insert if statement to check if anything is provided to the pump text box if not they want to use the status bar to show a message otherwise I want to clear the status bar message as for the self output clear method so every time I’m generating a new response I want to clear the output text box first down to insert the response from the open AI API call now to make the API call I first of all need to grab the parameter values so this line here is going to grab the temperature value from the slider then we’re going to divide the value by 100 and format the number to two decimal places then can run the same prompt request method and I’ll provide the prompt text maximum tokens temperature value in presence penalty value and once we receive the response back then we can paste the response to the output text box using the set plane text method and here from the response object I’m going to reference the outputs key then I’ll grab the first element actually hold on let me take a look I remember I changed the output response so from the output key it’s going to return the response directly right so that’s actually going to make sense a lot easier so here I can simply reference the outputs key and it’s going to return the response text directly then can remove any empty spaces on both ends and to show the total tokens consumed by the API call I can reference the status bar then insert the text to display the total tokens consumed and to make the text Pop I’m going to change the font color of the stats bar to Green using the set style sheet method now if I’m wrong into any error or exception in that case I want to change the font color to red then I’ll display the error message right so let me save the file and launch the application now if we look at the application right now we now have all the interface created for Max tokens temperature persons penalty the two text passes and the two push buttons right so we need to test out the push buttons now every single is good so far the next thing I want to do is I want to configurate the slider signal to update the label on the left right so if we uh look at the application again so right now if I change the Sliders bar the label value is not going to change and that’s because we haven’t implemented the signal here right so let’s go to the top now right here I’m going to create method in it configure using notes so this method is going to be used to configure your widget signals all right so right here I’m going to use the value chain signal from each slider and I want to pass the slightest value so this widget here is going to be the max token label temperature variable and the presence penalty on label and for these two values because the value is going to be between 0 and 2. so I need to again I need to divide the value by 100 and send the formula to two decimal places all right so let me fix the spacing all right so I’m going to take this method and I’ll call the method when launch the application so I’m going to code the inits configure signal method in the Constructor now if I slide the slider bar now the label is going to update based on the current uh sliders position right so the next thing I want to do here is I want to create another method to apply the default settings all right so for the method I’m going to name the method as init set default settings so basically what I’m doing here is I’m inserting a ticker to the slider right so here I’m installing the tech label then I’m sending the interval between a stick and by set the set tracking value to two the sliders value chain signal is going to fire when we move the slider bar s if we set the value to false then the sliders values are very change signal is only going to fire when we let go the slider bar and this line here is going to set the default caption for the area label for each slider and here I’m doing the same thing for other two sliders all right so I’m going to code uh DNA set default settings method in the Constructor as well and I’ll keep things organized so we’re almost finished with the application there are just a couple more things to do now what I want to do here is I want to test out the functionality of the application so here I’m going to ask what is 1 plus 10. and I can use the shortcut LTS to uh run the submit button and w1011 is the response now let me just make sure that all the sliders are working now everything looks good to me so I’m going to continue we’ll finish with the AI assistance class now we can finish the application by going to the app window class which is going to be the main window all right so let me take a look again so the add tab button is now working let’s create the method to add a new tab right so I’ll name the method add tab and the AI is going to be AI assistance all right so here when we add a new tab we want to increase the tab index by one then we can use the time manager.ad time method then we insert the widget and here’s the tab caption and it’s going to be identical to this line here then I’m going to assign this add tab method to the tag manager dot plus click signal and to configure the signal I’m going to again I’m going to create the innate config signal method under the app window class right so I’m going to code uh this method right below the energy method now the last thing we’re going to create is the menu bar which is going to be right here Now to create a menu bar I’m going to create method called init menu now inside this method I’m going to insert the Q menu bar directly to the window itself and to change the background color when we hover the mouse to each menu item so here I need to use CSS style sheets so I’m signing the default background color to this light gray color then I’m going to reference the identity property to change the menu item background color to a little bit of a darker gray so this helps that menu bar option is going to be the menu itself but currently it does not contains anything we need to add each menu item individually to the menu bar option and we can do that using the Q menu widget so this is going to be the menu label you’ll need to attach the Q menu widget to the menu bar option and to create the sub menus under the file menu from the file menu option we need to use the addition method and it’s going to be the set menu label followed by the method I want to execute then we can add the file menu option or the file menu item to the Celta menu option right so here let me do this I’m going to I’m going to call the innate menu method right below the right below the innate config signal method and we launch the application to see what we have so far right so I haven’t created the uh this save output method yet right so I mean make a copy and I’ll take out the method all right so let’s take a look so if you noticing that the file menu widget is covering the top area of the Q type manager and to fix the issue what we can do here is we can go back to the Constructor we can move the main layout towards the button just a little bit right so here I’m doing is I’m referencing the menu object and referencing the first row and I want to move the first row twist the button by 15 points right so going back to the in the menu method right so here I’m getting a type here I need to move this right here and because I create the main layout right after the self-doubt layout option all right so I’ll put the line here let me launch the application again now this time the file menu and the tag manager are quickly uh position let’s finish the application this is only one more thing to do which is to create a method to generate the output text file all right so let’s do this I’m going to create the last method and it’s going to be save output all right so let me launch the application so basically uh this line here is going to reference to the active bar right so for example here four tabs by referencing the conversion method it’s going to return the widget that’s embedded under the add tip tab so this additive Tech option is going to be referencing the AI systems window and from there we can reference all the widgets based on the objecting so these two lines here is going to achieve the string from the text boxes they want to insert the timestamp they want to construct the string down to insert to my text file and to create the text file I’m going to use the way open statement followed by the file name then I’m going to write the content to the text file now let me just make sure that I insert the save output method to the action method all right so there’s going to be everything we need to write to create the application now let me just save the file and we close all the applications all right so I’m going to do a test run so I’m going to open my project folder all right so here I’m going to change the maximum token to 10. and for the problem I’m going to ask what can you do with open AI API and I’ll click on the submit button and because I set the maximum token to 10 so the API won’t be able to use more than 10 tokens to generate the response and if I click on the reset button it’s going to clear everything oh and this one would say I forgot to test which is this same output function okay so help me go back what can you do with open AI now if I click on file save output and it’s going to create a text file in my project folder and if I look at the text file it hits the pump and here’s the response let’s learn how to package the application right so if you create a template file which you can download from the link in the description below and let me open the file so the file is called Pi installer underscore template.spec and we go to the important properties right so this one is going to be uh the file name that you want to use to execute the application in this case it’s going to be the app.pi file and the data’s property are going to be the files that I want to include that this application request in this case I want to include the icon file and the open AI playground.pi file and I’ll keep everything else the same under this analysis section all right so let’s go to the uh this exe section right so the name part piece is going to be uh the executable file name in this case I want to name the file open ai ai assistance and if you want to display the console when you launch the application you can set the console value to 2. but in this case I simply just want to display degrees so I’m going to set the value to pause and icon is going to be the file path that I want to use as the application icon and for demonstration purpose I’m going to use this a monitor.icom file and it’s going to be I’ve seen that I will modify from this template now to package this application as a S6 super file now on the terminal I’m going to type installer and here insert the spec template file path and it’s going to be Pi installer underscore template Dash spec enter else line made a mistake let me take a look at the template so let me save the file and try again yes I forgot to save the last time all right so I’m going to run the uh the spec file and once the process is finished if you go back to the project folder you should see two folders got created once the build folder and the other one is the distribution folder so the build folder contains all the files that are required to package the app now if you want to distribute the application they want to go into the distribution folder and here’s the executable file that we can distribute to other users to use the application now if I double click on the application to launch the app and because one of the required file is missing in this case if we look at a DM message configure no session here the open AI section is not fun and that’s because the password manager file is missing now if I move the file to the project folder now this time if I run the app again and I’m able to launch the application successfully this time right so if I type what is 10 plus 10 instrument and it’s going to return 20 as the output so this concludes this tutorial and hope you guys enjoyed this video and feel free to post your question or feedback in the comment section below and if you find this video useful please don’t forget to give this video a like And subscribe to my channel and I’ll see you guys next time bye

This Post Has 6 Comments

  1. Hi there!
    When typing some text in the prompt textbox I'm getting "NoneType object has no attribute strip". After some research, I figured out that response.get('outputs') from submit method returns none. You got any ideas?

  2. @johnslack9623

    When running the App Python source file and enter a prompt I keep getting "AttributeError: 'AttributeError' object has no attribute 'user_message'" pointing to line 145.

  3. @toddwmac

    Thanks a ton. Just getting started with VSC and PY so your vids are super helpful. If you don't mind, I did have a general question about activating virtual environments from the CMD prompt.: If from a CMD prompt I run the activate.bat file in the scripts folder of a .venv directory that I created with VSC, should I see any kind of message? I only get a line refresh with no error and no change in the prompt. But then when I run a ..py file that has a package dependency associated with the .veve environment, I get a file not found error as if it did not do any kind of activation. If I run from VSC, all is well. Thanks again. Your demo was exactly what I was trying to build and now I have something working that I can learn with.

  4. @ahmadsalih9985

    i treid many time to contact you our find your contact number code you please help in this

Leave a Reply