fishytorts commited on
Commit
a8087b3
1 Parent(s): 927dc9c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -2
app.py CHANGED
@@ -67,6 +67,10 @@ st.caption('Never share your OpenAI API key to anyone. Note that usage of your O
67
  # Initialize messages object
68
  messages = []
69
 
 
 
 
 
70
 
71
  # new line space
72
  st.write("")
@@ -78,9 +82,10 @@ uploaded_files = st.file_uploader("", help='Up to five images only.', type=["jpg
78
 
79
  if api_key:
80
  # Initialize the OpenAI client with the API key
81
- client = OpenAI(api_key=api_key)
 
82
  # load from disk
83
- docsearch = Chroma(persist_directory="./knowledge_base", embedding_function=OpenAIEmbeddings())
84
 
85
  metadata_field_info = [
86
  AttributeInfo(
 
67
  # Initialize messages object
68
  messages = []
69
 
70
+ # Retrieve the OpenAI API Key from secrets
71
+ # load_dotenv()
72
+ # api_key = os.getenv("OPENAI_API_KEY")
73
+
74
 
75
  # new line space
76
  st.write("")
 
82
 
83
  if api_key:
84
  # Initialize the OpenAI client with the API key
85
+ client = OpenAI(api_key=api_key)
86
+
87
  # load from disk
88
+ docsearch = Chroma(persist_directory="./knowledge_base", embedding_function=OpenAIEmbeddings(api_key=api_key))
89
 
90
  metadata_field_info = [
91
  AttributeInfo(