TUTORIAL: How to Create a Python GUI that will use the power of CHATgpt
CHATgpt SEARCH BOX V1.0 ... seeking comments, features, better code... ' ''This script (I named it py_chat_to_me.py, but you can call it whatever you want!) creates a GUI with an input field for the topic and another input field for the file name. It also creates a button that when pressed, calls the generate_text function to generate the text and save it to the specified file. This file must be saved where the api_key.py folder lives. The api_key.py folder contains the your private openai.com access key. The associated libraries are openai, re, api_key (see script at the bottom), and tkinter''' import openai import re from api_key import API_KEY import tkinter as tk from tkinter import messagebox openai.api_key = API_KEY # Set the model to use model_engine = "text-davinci-003" def generate_text(): # Get the topic from the user input topic = topic_entry.get() prompt = topic # Gene...

Comments
Post a Comment