vikaskookna commited on
Commit
cbdf261
·
1 Parent(s): 5d38eed

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -12,7 +12,7 @@ import openai
12
  from openai.error import AuthenticationError, InvalidRequestError, RateLimitError
13
  from typing import Optional, Tuple
14
 
15
- TOOLS_DEFAULT_LIST = ['serpapi', 'pal-math']
16
  MAX_TOKENS = 512
17
  PROMPT_TEMPLATE = PromptTemplate(
18
  input_variables=["original_words"],
@@ -22,6 +22,8 @@ PROMPT_TEMPLATE = PromptTemplate(
22
  BUG_FOUND_MSG = "Congratulations, you've found a bug in this application!"
23
  AUTH_ERR_MSG = "Please paste your OpenAI key."
24
 
 
 
25
  def run_chain(chain, inp, capture_hidden_text):
26
  output = ""
27
  hidden_text = None
@@ -93,7 +95,7 @@ def load_chain(tools_list, llm):
93
  express_chain = None
94
  print("\ntools_list", tools_list)
95
  tool_names = tools_list
96
- tools = load_tools(tool_names, llm=llm)
97
 
98
  memory = ConversationBufferMemory(memory_key="chat_history")
99
 
 
12
  from openai.error import AuthenticationError, InvalidRequestError, RateLimitError
13
  from typing import Optional, Tuple
14
 
15
+ TOOLS_DEFAULT_LIST = ['serpapi', 'news-api', 'pal-math']
16
  MAX_TOKENS = 512
17
  PROMPT_TEMPLATE = PromptTemplate(
18
  input_variables=["original_words"],
 
22
  BUG_FOUND_MSG = "Congratulations, you've found a bug in this application!"
23
  AUTH_ERR_MSG = "Please paste your OpenAI key."
24
 
25
+ news_api_key = os.environ["NEWS_API_KEY"]
26
+
27
  def run_chain(chain, inp, capture_hidden_text):
28
  output = ""
29
  hidden_text = None
 
95
  express_chain = None
96
  print("\ntools_list", tools_list)
97
  tool_names = tools_list
98
+ tools = load_tools(tool_names, llm=llm, news_api_key=news_api_key)
99
 
100
  memory = ConversationBufferMemory(memory_key="chat_history")
101