Spaces:
Sleeping
Sleeping
Commit
•
8e428da
1
Parent(s):
2fb24ef
Update app.py
Browse files
app.py
CHANGED
@@ -3,25 +3,17 @@ import streamlit as st
|
|
3 |
from langchain_community.llms import OpenAI
|
4 |
|
5 |
|
6 |
-
st.title("
|
7 |
|
8 |
def generate_linkedin_post(topic):
|
9 |
# Enhanced prompt with additional context for better post generation
|
10 |
-
prompt =
|
11 |
-
f"Create a professional, engaging LinkedIn post about {topic}. "
|
12 |
-
"It should start with a attention grabbing hook based on audience pain"
|
13 |
-
"Then a line to agitate the user. This should be in the next line"
|
14 |
-
"The post should be concise, informative, and suitable for a professional audience. "
|
15 |
-
"It should provide value, insights, or thought-provoking content related to the topic. "
|
16 |
-
"And only contain 3 points."
|
17 |
-
"The tone should be positive and encouraging, suitable for networking and professional growth."
|
18 |
-
)
|
19 |
llm = OpenAI(temperature=0.7, openai_api_key=st.secrets["OPENAI_API_KEY"])
|
20 |
response = llm(prompt)
|
21 |
return response
|
22 |
|
23 |
with st.form("my_form"):
|
24 |
-
topic = st.text_area("Enter the topic for your LinkedIn post:")
|
25 |
submitted = st.form_submit_button("Generate Post")
|
26 |
if submitted and topic:
|
27 |
post = generate_linkedin_post(topic)
|
|
|
3 |
from langchain_community.llms import OpenAI
|
4 |
|
5 |
|
6 |
+
st.title("ask me anything!")
|
7 |
|
8 |
def generate_linkedin_post(topic):
|
9 |
# Enhanced prompt with additional context for better post generation
|
10 |
+
prompt = topic
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11 |
llm = OpenAI(temperature=0.7, openai_api_key=st.secrets["OPENAI_API_KEY"])
|
12 |
response = llm(prompt)
|
13 |
return response
|
14 |
|
15 |
with st.form("my_form"):
|
16 |
+
# topic = st.text_area("Enter the topic for your LinkedIn post:")
|
17 |
submitted = st.form_submit_button("Generate Post")
|
18 |
if submitted and topic:
|
19 |
post = generate_linkedin_post(topic)
|