v2
Browse files- Home.py +4 -3
- __pycache__/utilities.cpython-311.pyc +0 -0
- utilities.py +1 -1
Home.py
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
import streamlit as st, pathlib
|
2 |
from utilities import get_products, aichat
|
3 |
folder = pathlib.Path(__file__).parent.resolve()
|
4 |
|
@@ -18,8 +18,9 @@ st.sidebar.image(f"{folder}/resources/sslogo.png", use_column_width=True)
|
|
18 |
|
19 |
with st.sidebar:
|
20 |
# store_link = st.text_input("Enter Your Store URL:", value="http://hypech.com/StoreSpark", disabled=True, key="store_link")
|
21 |
-
openai_api_key = st.text_input("OpenAI API Key", key="chatbot_api_key", type="password")
|
22 |
-
|
|
|
23 |
|
24 |
if "openai_model" not in st.session_state:
|
25 |
st.session_state["openai_model"] = "gpt-3.5-turbo-0125"
|
|
|
1 |
+
import streamlit as st, pathlib, os
|
2 |
from utilities import get_products, aichat
|
3 |
folder = pathlib.Path(__file__).parent.resolve()
|
4 |
|
|
|
18 |
|
19 |
with st.sidebar:
|
20 |
# store_link = st.text_input("Enter Your Store URL:", value="http://hypech.com/StoreSpark", disabled=True, key="store_link")
|
21 |
+
# openai_api_key = st.text_input("OpenAI API Key", key="chatbot_api_key", type="password")
|
22 |
+
openai_api_key = os.environ.get("OPENAI_API_KEY")
|
23 |
+
# "[Get an OpenAI API key](https://platform.openai.com/account/api-keys)"
|
24 |
|
25 |
if "openai_model" not in st.session_state:
|
26 |
st.session_state["openai_model"] = "gpt-3.5-turbo-0125"
|
__pycache__/utilities.cpython-311.pyc
CHANGED
Binary files a/__pycache__/utilities.cpython-311.pyc and b/__pycache__/utilities.cpython-311.pyc differ
|
|
utilities.py
CHANGED
@@ -29,7 +29,7 @@ def get_products():
|
|
29 |
|
30 |
def get_embedding(text, model="text-embedding-3-small"):
|
31 |
text = text.replace("\n", " ")
|
32 |
-
|
33 |
|
34 |
# text = "test embedding"
|
35 |
# embeddings = get_embedding(text)
|
|
|
29 |
|
30 |
def get_embedding(text, model="text-embedding-3-small"):
|
31 |
text = text.replace("\n", " ")
|
32 |
+
# return client.embeddings.create(input = [text], model=model).data[0].embedding
|
33 |
|
34 |
# text = "test embedding"
|
35 |
# embeddings = get_embedding(text)
|