andreasmartin commited on
Commit
a3d3d25
1 Parent(s): d6f53d4

deepnote update

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -93,8 +93,7 @@ def get_retriever(context_state: str, vectordb):
93
 
94
  @cl.langchain_factory(use_async=True)
95
  def factory():
96
- if "OPENAI_API_KEY" not in os.environ:
97
- os.environ["OPENAI_API_KEY"] = cl.user_session.get("env").get("OPENAI_API_KEY")
98
  df_agent = load_agent()
99
  load_vectordb()
100
  user_session.set("context_state", "")
@@ -119,6 +118,7 @@ def factory():
119
  model_name=llm_settings.model_name,
120
  temperature=llm_settings.temperature,
121
  streaming=True,
 
122
  )
123
 
124
  default_prompt = """{History}
 
93
 
94
  @cl.langchain_factory(use_async=True)
95
  def factory():
96
+ #if "OPENAI_API_KEY" not in os.environ:
 
97
  df_agent = load_agent()
98
  load_vectordb()
99
  user_session.set("context_state", "")
 
118
  model_name=llm_settings.model_name,
119
  temperature=llm_settings.temperature,
120
  streaming=True,
121
+ openai_api_key=cl.user_session.get("env").get("OPENAI_API_KEY") if "OPENAI_API_KEY" not in os.environ else None
122
  )
123
 
124
  default_prompt = """{History}