| ο»Ώ |
| |
| |
|
|
| import streamlit as st |
| import openai |
| import os |
|
|
| st.title("π€ Aruch Mini AI") |
|
|
| |
| api_key = os.getenv("OPENAI_API_KEY") |
| if api_key: |
| openai.api_key = api_key |
|
|
| |
| 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") |