Update app.py
Browse files
app.py
CHANGED
@@ -10,6 +10,7 @@ df = pd.read_csv("original_huberman.csv")
|
|
10 |
|
11 |
storage_context = StorageContext.from_defaults(persist_dir="./storage")
|
12 |
# load index
|
|
|
13 |
|
14 |
def get_podcast_and_youtube(response):
|
15 |
podcasts = []
|
@@ -56,7 +57,7 @@ with gr.Blocks() as demo:
|
|
56 |
def respond(openai_api_key, message, chat_history):
|
57 |
if not openai_api_key:
|
58 |
return "No OpenAI key provided, please provide one.", chat_history
|
59 |
-
|
60 |
index = load_index_from_storage(storage_context)
|
61 |
query_engine = index.as_query_engine(similarity_top_k=3)
|
62 |
response = query_engine.query(message)
|
|
|
10 |
|
11 |
storage_context = StorageContext.from_defaults(persist_dir="./storage")
|
12 |
# load index
|
13 |
+
import os
|
14 |
|
15 |
def get_podcast_and_youtube(response):
|
16 |
podcasts = []
|
|
|
57 |
def respond(openai_api_key, message, chat_history):
|
58 |
if not openai_api_key:
|
59 |
return "No OpenAI key provided, please provide one.", chat_history
|
60 |
+
os.environ["OPENAI_API_KEY"] = openai_api_key
|
61 |
index = load_index_from_storage(storage_context)
|
62 |
query_engine = index.as_query_engine(similarity_top_k=3)
|
63 |
response = query_engine.query(message)
|