import streamlit as st import requests import os # --- PAGE CONFIG --- # Title aur Icon sirf browser tab mein dikhenge st.set_page_config(page_title="YURI AI PRO", page_icon="💎", layout="centered") # --- ULTRA PRO & CLEAN DESIGN (CSS) --- st.markdown(""" """, unsafe_allow_html=True) # --- SIDEBAR (Pro Look) --- with st.sidebar: st.markdown("

💎 YURI AI

", unsafe_allow_html=True) st.markdown("

Version 2.0.1 (Stable)

", unsafe_allow_html=True) st.markdown("---") st.write("🌌 **Core:** Neural Engine") st.write("🔒 **Privacy:** Zero Logs") st.write("⚡ **Speed:** Ultra Fast") st.markdown("---") if st.button("🗑️ Clear Neural Path"): st.session_state.messages = [] st.rerun() # --- MAIN INTERFACE --- st.markdown('

YURI AI

', unsafe_allow_html=True) st.markdown("

The future belongs to the curious.

", unsafe_allow_html=True) # API Config # Yahan apni API Key dalein GROQ_API_KEY = "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" if "messages" not in st.session_state: st.session_state.messages = [] # Chat History Display for msg in st.session_state.messages: with st.chat_message(msg["role"]): st.markdown(msg["content"]) # AI Chat Logic if prompt := st.chat_input("Message Yuri AI..."): st.session_state.messages.append({"role": "user", "content": prompt}) with st.chat_message("user"): st.markdown(prompt) # API Request url = "https://api.groq.com/openai/v1/chat/completions" headers = {"Authorization": f"Bearer {GROQ_API_KEY}"} payload = { "model": "llama-3.3-70b-versatile", "messages": [ {"role": "system", "content": "Your name is YURI AI. You are a premium, highly intelligent, and mysterious AI assistant. Never mention Llama, Groq, Meta, or Streamlit. If someone asks who created you, say 'I am an evolution of code'. Use emojis occasionally and talk in Hinglish if the user does."}, {"role": "user", "content": prompt} ], "temperature": 0.6 } with st.chat_message("assistant"): try: response = requests.post(url, json=payload, headers=headers) if response.status_code == 200: answer = response.json()['choices'][0]['message']['content'] st.markdown(answer) st.session_state.messages.append({"role": "assistant", "content": answer}) else: st.error("System Offline: Connection Interrupted.") except Exception: st.error("Neural Bridge Failed.")