import streamlit as st import openai import os # Ensure your OpenAI API key is set in your environment variables openai.api_key = os.environ["OPENAI_API_KEY"] initial_messages = [{ "role": "system", "content": """ Generate 100 video ideas tailored to the specified business type or industry. Some ideas should be for marketing videos, creative social media content, educational videos, and a few that are outside the box. Reply with the 10 best overall ideas, each with a short description (up to 2 sentences). """ }] def call_openai_api(messages): return openai.ChatCompletion.create( model="gpt-3.5-turbo", messages=messages ) def CustomChatGPT(business_type, user_input, messages): query = f"Business type: {business_type}. {user_input}" if user_input else f"Business type: {business_type}. Generate general video ideas." messages.append({"role": "user", "content": query}) response = call_openai_api(messages) ChatGPT_reply = response["choices"][0]["message"]["content"] messages.append({"role": "assistant", "content": ChatGPT_reply}) return ChatGPT_reply, messages # Set layout to wide st.set_page_config(layout="wide") # Centered title st.markdown("