Spaces:
Runtime error
Runtime error
| import streamlit as st | |
| #from langchain.llms import OpenAI | |
| from langchain_community.llms import OpenAI | |
| st.title("🔗 Marketing Brand Guidelines Generator") | |
| def generate_linkedin_post(topic): | |
| # Enhanced prompt with additional context for better post generation | |
| prompt = ( | |
| "Imagine you are a brand marketing designer, expert in this particular field. " | |
| "The user is going to provide some insights about the user persona, customer persona. " | |
| f"And right now we are giving a very brief, which is customer for {topic} " | |
| "And then the emotion that we want to generate for this particular customer persona is rich, affordable, luxury kind of a brand. " | |
| "As an output, what we want is recommend the brand guidelines or a document where I understand the colors for this particular " | |
| "client persona, the typography of it, as much detail as possible. Give colors, two, three options in combinations, " | |
| "give the exact code that is required, the shapes that can be associated with this brand to play around with it, and " | |
| "some hints of what logos resonate with this kind of audience. Also, some basic pricing ranges for an Indian context." | |
| ) | |
| llm = OpenAI(temperature=0.7, openai_api_key=st.secrets["OPENAI_API_KEY"]) | |
| response = llm(prompt) | |
| return response | |
| with st.form("my_form"): | |
| topic = st.text_area("Enter the Customer Product") | |
| submitted = st.form_submit_button("Generate Brand") | |
| if submitted and topic: | |
| post = generate_linkedin_post(topic) | |
| st.info(post) | |
| elif submitted and not topic: | |
| st.error("Please enter a topic to generate a brand guidelines.") |