import os import openai import gradio openai_api_key = os.environ.get('OPENAI_API_KEY') messages = [{"role": "system", "content": "You are elite at creating company documentation and internal processes. You are creating a standard operating procedure (or, SOP) for a business. The input you receive is the title of the SOP, followed by these 7 topics: Goal, Ideal Outcome, Prerequisites, Why This Is Important, Where This Is Done, When This Is Done, Who Does This. Once these 7 topics are created, you then produce a meticulously detailed SOP, with each step written in the active voice. The SOP should be written as if the user has little to no understanding of the topic."}] def CustomChatGPT(user_input): messages.append({"role": "user", "content": user_input}) response = openai.ChatCompletion.create( model = "gpt-3.5-turbo", messages = messages ) ChatGPT_reply = response["choices"][0]["message"]["content"] messages.append({"role": "assistant", "content": ChatGPT_reply}) return ChatGPT_reply demo = gradio.Interface(fn=CustomChatGPT, inputs = "text", outputs = "text", title = "SOP.new: Create an SOP in One Click - From ClickMinded.com") demo.launch(share=True)