Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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 = "
|
|
|
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 |
-
|
11 |
-
|
|
|
|
|
|
|
|
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("متنی وارد نشده یا اشتباه واردش شده است.")
|