# ============================================ # 1. app.py (កូដ Streamlit របស់អ្នក) # ============================================ import streamlit as st import openai import os st.title("🤖 Aruch Mini AI") # អាន API Key ពី Environment Variable (សុវត្ថិភាព) api_key = os.getenv("OPENAI_API_KEY") if api_key: openai.api_key = api_key # កូដ Streamlit របស់អ្នក... user_input = st.text_input("សួរខ្ញុំបាន...") if user_input and api_key: response = openai.chat.completions.create( model="gpt-3.5-turbo", messages=[{"role": "user", "content": user_input}] ) st.write(response.choices[0].message.content) elif user_input and not api_key: st.warning("⚠️ សូមកំណត់ OPENAI_API_KEY ក្នុង Settings")