alikayh commited on
Commit
dbaa4ba
·
verified ·
1 Parent(s): 2c2459a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -3
app.py CHANGED
@@ -2,10 +2,14 @@ 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 = "AIzaSyCnGOmzLjc0KmtlVbphefE9Y8r9w7I8UFw"
 
6
  st.title("Content With Seo Generator")
7
  content = st.text_input("Please Enter Your prompt to make content via seo")
8
  model = genai.GenerativeModel("gemini-2.0-flash-exp")
9
  but = st.button("Lets Go")
10
- response = model.generate_content([content, "برای این متنی که داده شده یک محتوا یا مقاله سئو سازی شده بنویس"])
11
- st.markdown(response.text)
 
 
 
 
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
  content = st.text_input("Please Enter Your prompt to make content via seo")
9
  model = genai.GenerativeModel("gemini-2.0-flash-exp")
10
  but = st.button("Lets Go")
11
+ if content is not None and but:
12
+ response = model.generate_content([content, "برای این متنی که داده شده یک محتوا یا مقاله سئو سازی شده بنویس"])
13
+ st.markdown(response.text)
14
+ else:
15
+ st.warning("متنی وارد نشده یا اشتباه واردش شده است.")