alikayh commited on
Commit
e13e319
·
verified ·
1 Parent(s): 639e0be

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -6
app.py CHANGED
@@ -2,20 +2,23 @@ import streamlit as st
2
  import subprocess
3
  subprocess.run("pip install -q -U google-generativeai", shell=True)
4
  import google.generativeai as genai
 
5
  API = "AIzaSyBOOuFWwlywK77pLGg82li1m1mkNgeyQz4"
6
  genai.configure(api_key=API)
 
7
  st.title("Content With Seo Generator")
8
  st.info("Developed by Alikay_h --> github.com/kayhgng")
9
  content = st.text_input("Please Enter Your prompt to make content via seo")
10
  model = genai.GenerativeModel("gemini-2.0-flash-exp")
11
  but = st.button("Lets Go")
12
  st.title("Your content via seo:")
13
- if content is not None and but:
 
14
  response = model.generate_content([content, "خودت رو بعنوان یک متخصص سئو تصمور کن و طبق این متنی که بهت داده شده یک مقاله فوق العاده خوب و سئو سازی شده بنویس و کلمات کلیدی مقاله رو بنویس"])
15
  st.markdown(response.text)
 
 
 
 
16
  else:
17
- st.warning("متنی وارد نشده یا اشتباه واردش شده است.")
18
-
19
- st.title("Your content with JSON format")
20
- json = model.generate_content([response, "مقاله ای که نوشتی رو بیا به صورت ساختارمند JSON بنویس"])
21
- st.markdown(json.text)
 
2
  import subprocess
3
  subprocess.run("pip install -q -U google-generativeai", shell=True)
4
  import google.generativeai as genai
5
+
6
  API = "AIzaSyBOOuFWwlywK77pLGg82li1m1mkNgeyQz4"
7
  genai.configure(api_key=API)
8
+
9
  st.title("Content With Seo Generator")
10
  st.info("Developed by Alikay_h --> github.com/kayhgng")
11
  content = st.text_input("Please Enter Your prompt to make content via seo")
12
  model = genai.GenerativeModel("gemini-2.0-flash-exp")
13
  but = st.button("Lets Go")
14
  st.title("Your content via seo:")
15
+
16
+ if content and but:
17
  response = model.generate_content([content, "خودت رو بعنوان یک متخصص سئو تصمور کن و طبق این متنی که بهت داده شده یک مقاله فوق العاده خوب و سئو سازی شده بنویس و کلمات کلیدی مقاله رو بنویس"])
18
  st.markdown(response.text)
19
+
20
+ st.title("Your content with JSON format")
21
+ json_response = model.generate_content([response.text, "مقاله ای که نوشتی رو بیا به صورت ساختارمند JSON بنویس"])
22
+ st.markdown(json_response.text)
23
  else:
24
+ st.warning("متنی وارد نشده یا اشتباه واردش شده است.")