Spaces:
Sleeping
Sleeping
Update src/streamlit_app.py
Browse files1234568 unmodified lines151617181920218 unmodified lines30313233343536373839404142434445464748495051525354555657import streamlit as stfrom groq import Groqimport pandas as pdst.set_page_config(page_title="مجموعة ادوات الذكاء الاصطناعي", page_icon="robot")8 unmodified linesst.title("مجموعة ادوات الذكاء الاصطناعي")tab1, tab2, tab3 = st.tabs(["تلخيص النصوص", "محتوى سوشال ميديا", "تحليل Excel"])with tab1:st.header("تلخيص النصوص")8 unmodified lineswith tab2:st.header("توليد محتوى سوشال ميديا")topic = st.text_input("موضوع المنشور:")platform = st.selectbox("المنصة:", ["انستاغرام", "تويتر", "فيسبوك", "تيك توك"])if st.button("ولد المحتوى"):if topic:with st.spinner("جاري توليد المحتوى..."):result = ask_ai(f"اكتب منشور احترافي لمنصة {platform} عن موضوع: {topic} باللغة العربية مع هاشتاقات مناسبة")st.success(result)else:st.warning("ادخل موضوعا اول")with tab3:st.header("تحليل Excel")file = st.file_uploader("ارفع ملف Excel او CSV:", type=["xlsx", "csv"])if file:if file.name.endswith(".csv"):df = pd.read_csv(file)else:df = pd.read_excel(file)st.dataframe(df)question = st.text_input("اسال سوالا عن البيانات:")if st.button("حلل"):if question:with st.spinner("جاري التحليل..."):result = ask_ai(f"عندي بيانات: {df.head(10).to_string()} - {question}")st.success(result)123458 unmodified lines141516171819208 unmodified lines293031323334353637383940414243444546474849505152535455565758596061626364656667import streamlit as stfrom groq import Groqst.set_page_config(page_title="مجموعة ادوات الذكاء الاصطناعي", page_icon="robot")8 unmodified linesst.title("مجموعة ادوات الذكاء الاصطناعي")tab1, tab2 = st.tabs(["تلخيص النصوص", "محتوى سوشال ميديا"])with tab1:st.header("تلخيص النصوص")8 unmodified lineswith tab2:st.header("توليد محتوى سوشال ميديا")col1, col2 = st.columns(2)with col1:topic = st.text_input("موضوع المنشور:")platform = st.selectbox("المنصة:", ["انستاغرام", "تويتر/X", "فيسبوك", "تيك توك", "لينكدان"])with col2:tone = st.selectbox("نبرة المنشور:", ["رسمي", "ودي", "مرح", "تحفيزي", "اخباري"])lang = st.selectbox("اللغة:", ["العربية", "الانكليزية", "كلاهما"])hashtags = st.checkbox("اضف هاشتاقات")emoji = st.checkbox("اضف ايموجي")cta = st.checkbox("اضف دعوة للتفاعل")if st.button("ولد المحتوى"):if topic:extras = []if hashtags: extras.append("مع هاشتاقات مناسبة")if emoji: extras.append("مع ايموجي مناسبة")if cta: extras.append("مع دعوة للتفاعل في النهاية")prompt = f"اكتب منشور {tone} لمنصة {platform} عن: {topic}. باللغة {lang}. {' '.join(extras)}"with st.spinner("جاري توليد المحتوى..."):result = ask_ai(prompt)st.success("تم توليد المحتوى!")edited = st.text_area("يمكنك التعديل على المحتوى:", value=result, height=200)st.download_button(label="تحميل المحتوى",data=edited,file_name="content.txt",mime="text/plain")else:st.warning("ادخل موضوعا اول")
src/streamlit_app.py+33-23