angelesteban00 commited on
Commit
cbd1f0b
1 Parent(s): 90e40a6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -9,8 +9,8 @@ from gradio.themes.base import Base
9
  #import key_param
10
  import os
11
 
12
- mongo_uri = os.getenv("MONGO_URI")
13
- openai_api_key = os.getenv("OPENAI_API_KEY")
14
 
15
  client = MongoClient(mongo_uri)
16
  dbName = "langchain_demo"
@@ -64,6 +64,7 @@ with gr.Blocks(theme=Base(), title="Question Answering App using Vector Search +
64
  """
65
  # Question Answering App using Atlas Vector Search + RAG Architecture
66
  """)
 
67
  textbox = gr.Textbox(label="Enter your Question:")
68
  with gr.Row():
69
  button = gr.Button("Submit", variant="primary")
@@ -73,6 +74,6 @@ with gr.Blocks(theme=Base(), title="Question Answering App using Vector Search +
73
 
74
  # Call query_data function upon clicking the Submit button
75
 
76
- button.click(query_data, textbox, outputs=[output1, output2])
77
 
78
  demo.launch()
 
9
  #import key_param
10
  import os
11
 
12
+ #mongo_uri = os.getenv("MONGO_URI")
13
+ #openai_api_key = os.getenv("OPENAI_API_KEY")
14
 
15
  client = MongoClient(mongo_uri)
16
  dbName = "langchain_demo"
 
64
  """
65
  # Question Answering App using Atlas Vector Search + RAG Architecture
66
  """)
67
+ openai_api_key = gr.Textbox(label = "OpenAI 3.5 API Key", value = "sk-", lines = 1)
68
  textbox = gr.Textbox(label="Enter your Question:")
69
  with gr.Row():
70
  button = gr.Button("Submit", variant="primary")
 
74
 
75
  # Call query_data function upon clicking the Submit button
76
 
77
+ button.click(query_data, textbox, openai_api_key, outputs=[output1, output2])
78
 
79
  demo.launch()