dipsmom commited on
Commit
493a6ce
1 Parent(s): 50bd232

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -14
app.py CHANGED
@@ -3,28 +3,26 @@ import streamlit as st
3
  from langchain_community.llms import OpenAI
4
 
5
 
6
- st.title("🔗 Network_Navigator")
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)
28
  st.info(post)
29
  elif submitted and not topic:
30
  st.error("Please enter a topic to generate a post.")
 
3
  from langchain_community.llms import OpenAI
4
 
5
 
6
+ st.title("ask me anything!")
7
 
8
+ def mathematics(topic):
9
  # Enhanced prompt with additional context for better post generation
10
+ prompt =(
11
+ f"Calculate cost based on unit rate."
12
+ "Example: 20 chocolates for Rs 320. Find cost for 35 chocolates."
13
+ "Format: Given: 20 chocolates = Rs 320. Cost per chocolate = (320/20)."
14
+ "Cost for 35 = (320/20) × 35 = Rs 560.solve this {topic}"
 
 
 
15
  )
16
  llm = OpenAI(temperature=0.7, openai_api_key=st.secrets["OPENAI_API_KEY"])
17
  response = llm(prompt)
18
  return response
19
 
20
+ with st.form("my_form"):
21
+ topic = st.text_area("mathematics with dipanwita")
22
+
23
+ submitted = st.form_submit_button("Ask dilip")
24
  if submitted and topic:
25
+ post = mathematics(topic)
26
  st.info(post)
27
  elif submitted and not topic:
28
  st.error("Please enter a topic to generate a post.")